Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02783 (python)

Fixed submission:
hp, attack = map(int, input().split())

x, y = divmod(hp, attack)

if y == 0:
	print(x)
else:
  	print(x + 1)

Buggy submission (verdict: Runtime Error):
H, N = map(int, input().split())
A = input()

waza = 0
for i in range(0, N):
    waza = waza + int(A.split()[i])

if waza >= H:
    print("Yes")
else:
    print("No")
Problem p02818 (python)

Fixed submission:
def actual(a, b, k):
    if a >= k:
        # return f'{a - k} {b}'
        return '{} {}'.format((a - k), b)

    if b > (k - a):
        # return f'0 {b - (k - a)}'
        return '0 {}'.format(b - (k - a))

    return '0 0'

a, b, k = map(int, input().split())
print(actual(a, b, k))

Buggy submission (verdict: Runtime Error):
def actual(a, b, k):
    if a >= k:
        # return f'{a - k} {b}'
        return '{} {}'.format((a - k), b)

    if b > (k - a):
        # return f'0 {b - (k - a)}'
        return f'0 {}'.format(b - (k - a))

    return '0 0'

a, b, k = map(int, input().split())
print(actual(a, b, k))
Problem p02848 (python)

Fixed submission:
def actual(n, s):
    # 方針: 0->25 の世界で nだけシフトさせる → 65-90の世界に復元
    answer = ''

    ord_A = ord('A')

    for char in s:
        x = ord(char) - ord_A  # Aが0になるように初期化する
        y = (x + n) % 26  # mod 26 で 26パターンに分類できる
        z = y + ord_A  # 復元できるように補正する

        answer += chr(z)

    return answer


n = int(input())
s = input()
 
print(actual(n, s))

Buggy submission (verdict: Runtime Error):
from string import ascii_uppercase


def actual(n, s):
    answer = ''

    for char in s:
        # mod 26 で 26パターンに分類できる。 `-13` はidx調整項
        old_ord = ord(char) % 26
        shift_n = n % 26
        idx_shift_n = old_ord + shift_n - 13

        answer += ascii_uppercase[idx_shift_n]

    return answer

n = int(input())
s = input()

print(actual(n, s))

Buggy submission (verdict: Runtime Error):
from string import ascii_uppercase


def actual(n, s):
    answer = ''

    for char in s:
        # mod 26 で 26パターンに分類できる。 `-13` はidx調整項
        idx_shift_n = (ord(char) % 26) + n - 13

        answer += ascii_uppercase[idx_shift_n]

    return answer


n = int(input())
s = input()

print(actual(n, s))

Buggy submission (verdict: Runtime Error):
from string import ascii_uppercase


def actual(n, s):
    answer = ''

    for char in s:
        # mod 26 で 26パターンに分類できる。 `-13` はidx調整項
        idx_shift_n = (ord(char) % 26) + n - 13

        answer += ascii_uppercase[idx_shift_n]

    return answer

n = int(input())
s = input()

print(actual(n, s))
Problem p02885 (python)

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

if a <= b * 2:
	print(0)
else:
	print(a - b * 2)

Buggy submission (verdict: Runtime Error):
import itertools


def actual(n, D):
    """
    combinations でゴリ押し
    """
    comb = itertools.combinations(D, 2)

    # return sum([x * y for x, y in comb])

    """
    「順番を考慮しない2要素の選び方」を全探索する際のポイント
        内側のループ変数の始点を外側のループ変数 +1 から始めるとよい。
        これにより、内側のループで選ぶインデックスが必ず外側のループで選ぶインデックスより大きくなり、
        同じ選び方を 2 回見てしまうことを回避できます。
    """
    # s = 0
    # for i in range(len(D)):
    #     for j in range(i + 1, len(D)):
    #         s += D[i] * D[j]
    #
    # return s

    """
    O(N)で解くパターン
    
    ex: a, b, c, d
        a*b + a*c + a*d = a * (b + c +d)
              b*c + b*d = b * (    c +d)
                    c*d = c * (       d)
    """
    s = 0
    for i in range(len(D) - 1):
        s += D[i] * sum(D[i + 1:])

    return s


n = int(input())
D = list(map(int, input().split()))

print(actual(n, D))

Buggy submission (verdict: Runtime Error):
import itertools


def actual(n, D):
    """
    combinations でゴリ押し
    """
    comb = itertools.combinations(D, 2)

    # return sum([x * y for x, y in comb])

    """
    「順番を考慮しない2要素の選び方」を全探索する際のポイント
        内側のループ変数の始点を外側のループ変数 +1 から始めるとよい。
        これにより、内側のループで選ぶインデックスが必ず外側のループで選ぶインデックスより大きくなり、
        同じ選び方を 2 回見てしまうことを回避できます。
    """
    # s = 0
    # for i in range(len(D)):
    #     for j in range(i + 1, len(D)):
    #         s += D[i] * D[j]
    #
    # return s

    """
    O(N)で解くパターン
    
    ex: a, b, c, d
        a*b + a*c + a*d = a * (b + c +d)
              b*c + b*d = b * (    c +d)
                    c*d = c * (       d)
    """
    s = 0
    for i in range(len(D) - 1):
        s += D[i] * sum(D[i + 1:])
    
    return s


n = int(input())
D = list(map(int, input().split()))

print(actual(n, D))
Problem p02886 (python)

Fixed submission:
import itertools


def actual(n, D):
    comb = itertools.combinations(D, 2)

    return sum([x * y for x, y in comb])

n = int(input())
D = map(int, input().split())

print(actual(n, D))

Buggy submission (verdict: Runtime Error):
import itertools


def actual(n, D):
    comb = itertools.combinations(D, 2)

    # return sum([x * y for x, y in comb])

    """
    「順番を考慮しない2要素の選び方」を全探索する際のポイント
        内側のループ変数の始点を外側のループ変数 +1 から始めるとよい。
        これにより、内側のループで選ぶインデックスが必ず外側のループで選ぶインデックスより大きくなり、
        同じ選び方を 2 回見てしまうことを回避できます。"""
    s = 0
    for i in range(len(D)):
        for j in range(i + 1, len(D)):
            s += D[i] * D[j]

    return s

n = int(input())
s = input()

print(actual(n, s))
Problem p03086 (python)

Fixed submission:
def generate_substrings(s):
    N = len(s)

    if N == 0:
        return {''}

    if N == 1:
        return {'', s}

    substrings = set()

    for i in range(N):
        for j in range(1, N + 1):
            substrings.add(s[i:j])

    return substrings


def actual(s):
    sub_strings = generate_substrings(s)
    is_agct = lambda string: set(string).issubset({'A', 'G', 'C', 'T'})

    agct_length_list = [len(s) for s in sub_strings if is_agct(s)]

    return max(agct_length_list)

s = input()
print(actual(s))

Buggy submission (verdict: Runtime Error):
def actual(s):
    sub_string_list = []

    N = len(s)
    for i in range(N):
        for j in range(N - 1):
            sub_string_list.append(s[i:j])

    set_ACGT = {'A', 'C', 'G', 'T'}
    length_list = []

    for sub_string in sub_string_list:
        if set(sub_string).issubset(set_ACGT):
            length_list.append(len(sub_string))

    return max(length_list)

s = input()
print(actual(s))
Problem p03126 (python)

Fixed submission:
def actual(N, M, K, A):
    # 各人のAの積集合の要素数が答え
    s = set(A[0])

    for a in A[1:]:
        s &= set(a)

    return len(s)


N, M = map(int, input().split())

K = []
A = []

for _ in range(N):
    ka = list(map(int, input().split()))
    K.append(ka[0])
    A.append(ka[1:])

print(actual(N, M, K, A))

Buggy submission (verdict: Runtime Error):
5 5
4 2 3 4 5
4 1 3 4 5
4 1 2 4 5
4 1 2 3 5
4 1 2 3 4
Problem p03280 (python)

Fixed submission:
def actual(a, b):
    return (a - 1) * (b - 1)

a, b = map(int, input().split())
print(actual(a, b))

Buggy submission (verdict: Runtime Error):
def actual(a, b):
    return (a - 1) * (b - 1)

a, b = map(int, input())
print(actual(a, b))
Problem p03378 (python)

Fixed submission:
def actual(N, M, X, A):
    # マスXの左右それぞれにある料金所の数を調べればOK
    toll_gates_left = [a_i for a_i in A if a_i < X]
    toll_gates_right = [a_i for a_i in A if X < a_i]

    return min(len(toll_gates_left), len(toll_gates_right))

N, M, X = map(int, input().split())
A = list(map(int, input().split()))

print(actual(N, M, X, A))

Buggy submission (verdict: Runtime Error):
def actual(N, M, X, A):
    # マスXの左右それぞれにある料金所の数を調べればOK
    toll_gates_left = [a_i for a_i in A if a_i < X]
    toll_gates_right = [a_i for a_i in A if X < a_i]

    return min(len(toll_gates_left), len(toll_gates_right))

N, M, X = map(int, input().split())
A = [int(input()) for _ in range(N + 1)]

print(actual(N, M, X, A))
Problem p03385 (python)

Fixed submission:
def actual(s):
    if set(s) == {'a', 'b', 'c'}:
        return 'Yes'

    return 'No'

s = input()
print(actual(s))

Buggy submission (verdict: Runtime Error):
def actual(A, B, C, X):
    count = 0

    for n_500yen in range(A + 1):
        for n_100yen in range(B + 1):
            for n_050yen in range(C + 1):
                amount = 500 * n_500yen + 100 * n_100yen + 50 * n_050yen

                if amount == X:
                    count += 1

    return count

A = int(input())
B = int(input())
C = int(input())
X = int(input())

print(actual(A, B, C, X))
Problem p03386 (python)

Fixed submission:
def actual(A, B, K):
    min_a = A
    max_a = min(A + (K - 1), B)

    min_b = max(B - (K - 1), max_a + 1)
    max_b = B

    left = list(range(min_a, max_a + 1))
    right = list(range(min_b, max_b + 1))

    return '\n'.join(map(str, sorted(set(left + right))))

  
A, B, K = map(int, input().split())
print(actual(A, B, K))

Buggy submission (verdict: Runtime Error):
def actual(A, B, K):
    min_left = A
    max_left = min(A + (K - 1), B)

    min_right = max(B - (K - 1), max_left + 1)
    max_right = B

    left = set(range(min_left, max_left + 1))
    right = set(range(min_right, max_right + 1))

    unique_nums = left | right

    return '\n'.join(map(str, sorted(unique_nums)))

A, B, K = map(int, input().split())
print(actual_TLE(A, B, K))
Problem p03400 (python)

Fixed submission:
def actual(N, D, X, A):
    count = 0

    for a_i in A:
        for i in range(100+1):
            eating_day = 1 + (a_i * i)

            if eating_day <= D:
                count += 1

    return X + count

N = int(input())
D, X = map(int, input().split())
A = [int(input()) for _ in range(N)]

print(actual(N, D, X, A))

Buggy submission (verdict: Runtime Error):
def actual(N, D, X, A):
    count = 0

    for a_i in A:
        for i in range(100+1):
            eating_day = 1 + (a_i * i)

            if eating_day <= D:
                count += 1

    return X + count

N = int(input())
D, X = map(int, input().split())
A = [int(input) for _ in range(N)]

print(actual(N, D, X, A))
Problem p03455 (python)

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

product = a * b

if product % 2 == 1:
    print('Odd')
else:
    print('Even')

Buggy submission (verdict: Runtime Error):
def actual(a, b):
    if (a * b) % 2 == 0:
        return 'Even'

    return 'Odd

a, b = map(int, input().split())
print(actual(a, b))
Problem p03474 (python)

Fixed submission:
import re


def actual(a, b, s):
    pattern = r'\d{' + f'{a}' + r'}-\d{' + f'{b}' + '}'
    
    if re.fullmatch(pattern, s):
        return 'Yes'

    return 'No'

a, b = map(int, input().split())
s = input()

print(actual(a, b, s))

Buggy submission (verdict: Runtime Error):
def actual(a, b, s):
    if s[a] != '-':
        return 'No'

    for i in range(0, a):
        if not '0' <= s[i] <= '9':
            return 'No'

    for j in range(a + 1, len(s) + 1):
        if not '0' <= s[j] <= '9':
            return 'No'

    return 'Yes'


a, b = map(int, input().split())
s = input()

print(actual(a, b, s))
Problem p03694 (python)

Fixed submission:
def actual(N, A):
    return max(A) - min(A)

N = int(input())
A = list(map(int, input().split()))

print(actual(N, A))

Buggy submission (verdict: Runtime Error):
def actual(N, A):
    return max(A) - min(A)

N = int(input())
A = map(int, input().split())

print(actual(N, A))
Problem p03997 (python)

Fixed submission:
def actual(a, b, h):
    return int((a + b) * h / 2)

a = int(input())
b = int(input())
h = int(input())

print(actual(a, b, h))

Buggy submission (verdict: Runtime Error):
def actual(a, b, h):
    return int((a + b) * h / 2)

a, b, h = map(int, input().split())
print(actual(a, b, h))

Buggy submission (verdict: Runtime Error):
def actual(a, b, h):
    return int((a + b) * h / 2)

a, b, h = map(int, input())
print(actual(a, b, h))
Problem p02621 (python)

Fixed submission:
a = int(input())
b = a ** 3 + a ** 2 + a
print(b)

Buggy submission (verdict: Runtime Error):
a=input()
b=a**3+a**2+a
print(b)
Problem p02646 (python)

Fixed submission:
A_V = input().split(" ")
B_W = input().split(" ")
T = int(input())
A = int(A_V[0])
V = int(A_V[1])
B = int(B_W[0])
W = int(B_W[1])
dA = A + V * T
dB = B + W * T
ndA = A - V * T
ndB = B - W * T
if (A<B):
    if (dA < dB):
        print("NO")
    else:
        print("YES")
else:
    if (ndA > ndB):
        print("NO")
    else:
        print("YES")

Buggy submission (verdict: Runtime Error):
A_V = input().split(" ")
B_W = input().split(" ")
T = int(input())
A = int(A_V[0])
V = int(A_V[1])
B = int(B_W[0])
W = int(B_W[1])
dA = A + V * T
dB = B + W * T
ndA = A - V * T
ndB = B - W * T
if (dA < dB):
    if (ndA > ndB)
        print("NO")
    else:
        print("YES")
Problem p02789 (python)

Fixed submission:
# -*- coding: utf-8 -*-

def fun():
    A = input("")
    return A

N = str(fun()).split(" ")
if (N[0] == N[1]):
    print("Yes")
    
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = input("")
L = input("").split(" ")
suc = int(N)

for i in range(int(N)):
    for j in range(i):
        if (L[j] < L[i]):
            suc -= 1
            break
    
print(suc)
Problem p02791 (python)

Fixed submission:
N = input("")
L = input("").split(" ")
suc = int(N)
min_ = 200001

for i in range(int(N)):
    if (L[i] == 1):
        min_= 1
        continue
    if (int(min_) < int(L[i])):
        suc -= 1
        continue
    if (int(min_) >= int(L[i])):
        min_ = L[i]
print(suc)

Buggy submission (verdict: Runtime Error):
N = input("")
L = input("").split(" ")
suc = int(N)
min_ = 200001

for i in range(int(N)):
    if (L[i] == 1):
        continue
    if (min_ < L[i]):
        suc -= 1
        continue
    for j in range(i):
        if (L[j] < L[i]):
            suc -= 1
            break
    
print(suc)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

N = input("")
L = input("").split(" ")
suc = N

for i in range(int(N)):
    for j in range(i):
        if (L[j] < L[i]):
            suc -= 1
            break
    
print(suc)
Problem p02606 (python)

Fixed submission:
L,R,d=map(int, input().split())
cnt=0
 
for i in range(L, R+1):
  if i%d == 0: cnt+=1
  
print(cnt)

Buggy submission (verdict: Runtime Error):
L,R= map(int, input().split())
d = input()
 
for L in range(R):
  if(i%d == 0) cnt++
  
print(cnt)

Buggy submission (verdict: Runtime Error):
L,R,d = (int(_) for _ in input().split())
 
for i in range(d):
  if(i%d == 0) cnt++
  
print(cnt)

Buggy submission (verdict: Runtime Error):
L,R,d = map(int(_) for _ in input().split())

for i in range(0, d):
  if(i%d == 0) cnt++
  
print(cnt)

Buggy submission (verdict: Runtime Error):
L,R,d = input(int(_) for _ in input().split())

for i in range(d):
  if(i%d == 0) cnt++
  
print(cnt)

Buggy submission (verdict: Runtime Error):
L,R,d = input(int(_) for _ in input().split())

for i in range(0, d):
  if(i%d == 0) cnt++
  
print(cnt)

Buggy submission (verdict: Runtime Error):
L,R,d = input(int(_) for _ in input().split())

for i in range(d):
  if(i%d == 0) cnt++;
  
print(cnt);
Problem p02675 (python)

Fixed submission:
hon = '24579'
pon = '0168'
bon = '3'
N = str(input())
if N[-1] in hon:
  print("hon")
elif N[-1] in pon:
  print("pon")
elif N[-1] in bon:
  print("bon")

Buggy submission (verdict: Runtime Error):
user = int(input())
new = str(user)
ifunction new():
    user = int(input())
    new = str(user)
        if (new == 2 or 4 or 5 or 7 or 9):
            return("hon")
        elif (new ==  0 or 1 or 6 or 8):
            return("pon")
        elif(new == 3):
            return("bon")
print()
Problem p02705 (python)

Fixed submission:
import math
user = int(input())
print((math.pi)*2*user)

Buggy submission (verdict: Runtime Error):
N = int(input())
Ai = list(map(int, input().split()))
for i in Ai:
    print(Ai.count(i))
Problem p02706 (python)

Fixed submission:
M, N = map(int ,input().split())
x = [int(x) for x in input().split()]
if (sum(x)) > M:
    print(-1)
elif(sum(x) == M):
    print(0)
elif(sum(x)<M):
    print(M-sum(x))

Buggy submission (verdict: Runtime Error):
M, N = map(int ,input().split())
x = [int(x) for x in input().split()]
if 1 <= (N) < 10**6 and 1 <= (M) < 10**4 and 1 <= x[1] < 10**4 :
    if (sum(x)) > M:
        print(-1)
    elif(sum(x) == M):
        print(0)
    elif(sum(x)<M):
        print(M-sum(x))

Buggy submission (verdict: Runtime Error):
M, N = map(int ,input().split())
x = [int(x) for x in input().split()]
if 1 <= (N) < 10**6 and 1 <= (M) < 10**4 and 1 <= x[1] < 10**4 :
    if (sum(x)) > M:
        print(-1)
    elif(sum(x) == M):
        print(0)
    elif(sum(x)<M):
        print(M-sum(x))

Buggy submission (verdict: Runtime Error):
M, N= input().split()
A1, Am = input().split()
if 1 <= int(N) < 10**6 and 1 <= int(M) < 10**4 and 1 <= int(A1) < 10**4 :
    if((int(A1) + int(Am)) <= int(M)):
        print((int(A1)+int(Am))-int(M))
    elif (int(A1) + int(Am)) == int(M):
        print(0)
    elif (int(A1)+int(Am)) > int(M):
        print(-1)
Problem p02717 (python)

Fixed submission:
A,B,C= map(int,input().split())
print(C,A,B)

Buggy submission (verdict: Runtime Error):
items,select = input().split()
x = [int(items) for x in input().split()]
for u in x:
    if u > (1 / (4 * int(select))*sum(x)):
        print("No")
        break
    else:
        print("Yes")
        break

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
print(c,a,b)

Buggy submission (verdict: Runtime Error):
x = int(input())
y = int(input())
z = int(input())
print(str(z)+' '+str(x)+' '+str(y))

Buggy submission (verdict: Runtime Error):
x = int(input())
y = int(input())
z = int(input())
result = [z,x,y]
print(*result, sep=" ")
Problem p02727 (python)

Fixed submission:
## coding: UTF-8
#最後の方のテストケースでREになってしまう。時間切れ。
from decimal import *
from itertools import permutations, combinations,combinations_with_replacement,product

s = input().split()
t = [int(p) for p in s]


sA = input().split()
p = [int(w) for w in sA]
p.sort(reverse=True) #大きい順に並べ替える


sB = input().split()
q = [int(p) for p in sB]
q.sort(reverse=True)

sC = input().split()
r = [int(p) for p in sC]
r.sort(reverse=True)

X = t[0]
Y = t[1]
A = t[2]
B = t[3]
C = t[4]
p = p[:X] #下の方はいらない子
q = q[:Y] #下の方はいらない子
r = r[:X+Y] #下の方はいらない子だけど、全部無色の可能性もある。
#print('{} {} {} {} {}'.format(X,Y,A,B,C))
#print(p)
#print(q)
#print(r)

def delete_min(p, q, r):
    if(len(p) == 0 and len(q) == 0):
        del r[-1]
    elif(len(p) == 0):
        if(q[-1] <= r[-1]):
            del q[-1]
        else:
            del r[-1]
    elif(len(q) == 0):
        if(p[-1] <= r[-1]):
            del p[-1]
        else:
            del r[-1]
    elif(len(r) == 0):
        if(p[-1] <= q[-1]):
            del p[-1]
        else:
            del q[-1]
    else:
        if(p[-1] <= q[-1] and p[-1] <= r[-1]):
            del p[-1]
        elif(q[-1] <= r[-1]):
            del q[-1]
        else:
            del r[-1]
    #要素数が0になることもありうるので、その回避処理が必要だった

while len(p) + len(q) + len(r) > X + Y:
    delete_min(p, q, r)
    #print('p:{}, q:{}, r:{}'.format(p,q,r))

answer = sum(p) + sum(q) + sum(r)
print(answer)

Buggy submission (verdict: Runtime Error):
## coding: UTF-8
from decimal import *
from itertools import permutations, combinations,combinations_with_replacement,product

s = input().split()
t = [int(p) for p in s]

sA = input().split()
p = [int(w) for w in sA]
p.sort(reverse=True) #大きい順に並べ替える


sB = input().split()
q = [int(p) for p in sB]
q.sort(reverse=True)

sC = input().split()
r = [int(p) for p in sC]
r.sort(reverse=True)

X = t[0]
Y = t[1]
A = t[2]
B = t[3]
C = t[4]
p = p[:X] #下の方はいらない子
q = q[:Y] #下の方はいらない子
r = r[:X+Y] #下の方はいらない子だけど、全部無色の可能性もある。
#print('{} {} {} {} {}'.format(X,Y,A,B,C))
#print(p)
#print(q)
#print(r)

def delete_min(p, q, r):
    if(p[-1] <= q[-1] and p[-1] <= r[-1]):
        del p[-1]
    elif(q[-1] <= r[-1]):
        del q[-1]
    else:
        del r[-1]

while len(p) + len(q) + len(r) > X + Y:
    delete_min(p, q, r)
    #print('p:{}, q:{}, r:{}'.format(p,q,r))

answer = sum(p) + sum(q) + sum(r)
print(answer)
Problem p02742 (python)

Fixed submission:
## coding: UTF-8
from decimal import *
s = input().split()
t = [int(p) for p in s]


#print(t)
if(t[0] == 1 or t[1] == 1):
    answer = 1
elif( Decimal(Decimal(t[0]) % 2 )== 1 and Decimal(Decimal(t[1]) % 2) == 1):
    n = Decimal( Decimal(Decimal(t[0]) - 1) // 2  )
    #print(n)
    m = Decimal( Decimal(Decimal(t[1]) - 1) // 2  )
    answer = Decimal(    Decimal(  Decimal(Decimal(m) + 1)     *    Decimal(Decimal(n) + 1)  )   + Decimal( Decimal(m) * Decimal(n) )       )
else:
    answer = Decimal(   Decimal(Decimal(t[0]) * Decimal(t[1])) // 2  )

print(int(answer))

'''
H = t[0]
W = t[1]
ans = 0
if( W % 2 == 0):
    for i in range(H):
        ans += W / 2
else:
    for i in range(H):
        if(i % 2 == 0):
            ans += W / 2.0 + 0.5
        else:
            ans += W / 2.0 - 0.5
print(int(ans))
'''

Buggy submission (verdict: Runtime Error):
## coding: UTF-8
#from decimal import *
s = input().split()
t = [int(p) for p in s]


#print(t)
if( Decimal(Decimal(t[0]) % 2 )== 1 and Decimal(Decimal(t[1]) % 2) == 1):
    n = Decimal( Decimal(Decimal(t[0]) - 1) // 2  )
    #print(n)
    m = Decimal( Decimal(Decimal(t[1]) - 1) // 2  )
    answer = Decimal(    Decimal(  Decimal(Decimal(m) + 1)     *    Decimal(Decimal(n) + 1)  )   + Decimal( Decimal(m) * Decimal(n) )       )
else:
    answer = Decimal(   Decimal(Decimal(t[0]) * Decimal(t[1])) // 2  )

print(int(answer))

'''
H = t[0]
W = t[1]
ans = 0
if( W % 2 == 0):
    for i in range(H):
        ans += W / 2
else:
    for i in range(H):
        if(i % 2 == 0):
            ans += W / 2.0 + 0.5
        else:
            ans += W / 2.0 - 0.5
print(int(ans))
'''
Problem p02817 (python)

Fixed submission:
S, T = map(str, input().split())
print('{}{}'.format(T, S))

Buggy submission (verdict: Runtime Error):
S, T = map(input().split())
print('{}{}'.format(T, S))

Buggy submission (verdict: Runtime Error):
S, T = map(int,input().split())
print('{}{}'.format(T,S))
Problem p03164 (python)

Fixed submission:
## coding: UTF-8
import sys
#import time

#start = time.time()
N, W = map(int,input().split())
l = [list(map(int, input().split())) for _ in range(N)]


dp = [ [sys.maxsize] * (N * 1000) for _ in range(N) ]
for i in range(N):
    for j in range(N * 1000):
        w = l[i][0]
        v = l[i][1]
        if(j == 0):
            dp[i][j] = 0
        elif(j <= v):
            dp[i][j] = min(dp[i-1][j], w)
        else:
            dp[i][j] = min(dp[i-1][j], dp[i-1][j-v] + w)
#for k in range(N):
    #print(dp[k][:20])

#print(dp[-1][2999])
#print(dp[-1][3000])
cnt = 0
i = 0
while cnt <= W:
    cnt = dp[-1][i]
    i += 1
    if(i == N*1000):
        i += 2
        break
print(i-2)#0-index , while分の構造上、iが2多くなる

Buggy submission (verdict: Runtime Error):
## coding: UTF-8
import sys
#import time

#start = time.time()
N, W = map(int,input().split())
l = [list(map(int, input().split())) for _ in range(N)]


dp = [ [sys.maxsize] * (N * 1000) for _ in range(N) ]
for i in range(N):
    for j in range(N * 1000):
        w = l[i][0]
        v = l[i][1]
        if(j == 0):
            dp[i][j] = 0
        elif(j <= v):
            dp[i][j] = min(dp[i-1][j], w)
        else:
            dp[i][j] = min(dp[i-1][j], dp[i-1][j-v] + w)
#for k in range(N):
    #print(dp[k][:20])


cnt = 0
i = 0
while cnt <= W:
    cnt = dp[-1][i]
    i += 1
print(i-2)#0-index , while分の構造上、iが2多くなる

Buggy submission (verdict: Runtime Error):
## coding: UTF-8


N, W = map(int,input().split())
l = [list(map(int, input().split())) for _ in range(N)]

dp = [[0] * (W+1) for _ in range(N)]

for i in range(N):
    for j in range(W+1):
        if(j >= l[i][0]):
            dp[i][j] = max(dp[i-1][j], dp[i-1][j-l[i][0]] + l[i][1])
        else:
            dp[i][j] = dp[i-1][j]
#for k in range(N):
    #print(dp[k])
print(dp[-1][-1])

Buggy submission (verdict: Runtime Error):
## coding: UTF-8


N, W = map(int,input().split())
l = [list(map(int, input().split())) for _ in range(N)]

dp = [[0] * (W+1) for _ in range(N)]

for i in range(N):
    for j in range(W+1):
        if(j >= l[i][0]):
            dp[i][j] = max(dp[i-1][j], dp[i-1][j-l[i][0]] + l[i][1])
        else:
            dp[i][j] = dp[i-1][j]
#for k in range(N):
    #print(dp[k])
print(dp[-1][-1])
Problem p03636 (python)

Fixed submission:
## coding: UTF-8
s = input()

#print(len(s))
print('{}{}{}'.format(s[0],len(s)-2,s[-1]))

Buggy submission (verdict: Runtime Error):
s = input()
print('{}{}{}'.format(s[0],len(s)-2,s[len(s)-1])