Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N = int(input())
s = [list(input()) for _ in range(N)]
S = []
cnt = 0

for i in range(N):
    mycounter = Counter(S)
    temp = "".join(sorted(s[i]))
    S.append(temp)
    cnt += mycounter[temp]

print(cnt)


Fixed submission:
N = int(input())
s = [list(input()) for _ in range(N)]
S = []
for i in range(N):
    temp = "".join(sorted(s[i]))
    S.append(temp)

D = {}
cnt = 0
for str in S:
    if str in D:
        cnt += D[str]
        D[str] += 1
    else:
        D[str] = 1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = [list(input()) for _ in range(N)]
S = []
for i in range(N):
    S.append("".join(sorted(s[i])))

cnt = 0
for i in range(N):
    cnt += S.count(S[i]) - 1
print(cnt // 2)


Fixed submission:
N = int(input())
s = [list(input()) for _ in range(N)]
S = []
for i in range(N):
    temp = "".join(sorted(s[i]))
    S.append(temp)

D = {}
cnt = 0
for str in S:
    if str in D:
        cnt += D[str]
        D[str] += 1
    else:
        D[str] = 1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = [input() for _ in range(N)]

hantei = True
cnt = 0
for i in range(N):
    temp = s.pop(0)
    for S in s:
        for k in range(len(temp)):
            if S.count(temp[k]) != temp.count(temp[k]):
                hantei = False
                break
        if hantei:
            cnt += 1
        else:
            hantei = True

print(cnt)


Fixed submission:
N = int(input())
s = [list(input()) for _ in range(N)]
S = []
for i in range(N):
    temp = "".join(sorted(s[i]))
    S.append(temp)

D = {}
cnt = 0
for str in S:
    if str in D:
        cnt += D[str]
        D[str] += 1
    else:
        D[str] = 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
L, R = map(int, input().split())

if R - L >= 2018:
      mod = 0
else:
    tempL = L%2019
    tempR = R%2019
    if tempR - tempL < R-L-1:
        temp = tempL
        tempL = 0
        X = list(range(tempL,temp))
        Y = list(range(tempR,2018+1))
        Z = X + Y
    else:
        Z = list(range(tempL,tempR+1))

ans = 2019
for i in range(len(Z)):
    for j in range(i+1, len(Z)):
        if (Z[i]*Z[j])%2019 < ans:
            ans = (Z[i]*Z[j])%2019
print(ans)


Fixed submission:
L, R = map(int, input().split())

if R - L >= 2018:
      ans = 0
else:
    tempL = L%2019
    tempR = R%2019
    if tempR - tempL < R-L-1:
        temp = tempL
        tempL = 0
        X = list(range(tempL,temp))
        Y = list(range(tempR,2018+1))
        Z = X + Y
    else:
        Z = list(range(tempL,tempR+1))

    ans = 2019
    for i in range(len(Z)):
        for j in range(i+1, len(Z)):
            if (Z[i]*Z[j])%2019 < ans:
                ans = (Z[i]*Z[j])%2019
print(ans)

Buggy python submission (verdict: Runtime Error):
L, R = map(int, input().split())

if R - L >= 2018:
      mod = 0
else:
    tempL = L%2019
    tempR = R%2019
    if tempR - tempL < R-L-1:
        temp = tempL
        tempL = 0
        X = range(tempL,temp)
        Y = range(tempR,2018)
        Z = extend(X,Y+1)
    else:
        Z = range(tempL,tempR+1)

ans = 2019
for i in range(len(Z)):
    for j in range(i+1, len(Z)):
        if (Z[i]*Z[j])%2019 < ans:
            ans = (Z[i]*Z[j])%2019
print(ans)


Fixed submission:
L, R = map(int, input().split())

if R - L >= 2018:
      ans = 0
else:
    tempL = L%2019
    tempR = R%2019
    if tempR - tempL < R-L-1:
        temp = tempL
        tempL = 0
        X = list(range(tempL,temp))
        Y = list(range(tempR,2018+1))
        Z = X + Y
    else:
        Z = list(range(tempL,tempR+1))

    ans = 2019
    for i in range(len(Z)):
        for j in range(i+1, len(Z)):
            if (Z[i]*Z[j])%2019 < ans:
                ans = (Z[i]*Z[j])%2019
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())

count = 0
len = B-A+1

count += math.floor(B/C)
count -= math.floor((A-1)/C)
count += math.floor(B/D)
count -= math.floor((A-1)/D)

lcm = C*D / math.gcd(C,D)
count -= math.floor(B/lcm)
count += math.floor((A-1)/lcm)

print(len - count)


Fixed submission:
import math
def gcd(a, b):
    if b==0:
        return a
    return gcd(b, a%b)

A,B,C,D = map(int,input().split())

count = 0
lcm = C*D // gcd(C,D)


print(B - B//C - B//D + B//lcm - (A - 1 - (A-1)//C - (A-1)//D + (A-1)//lcm))

Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())

count = 0
len = B-A+1

count += math.floor(B/C)
count -= math.floor((A-1)/C)
count += math.floor(B/D)
count -= math.floor((A-1)/D)

lcm = C*D / math.gcd(C,D)
count -= math.floor(B/lcm)
count += math.floor((A-1)/lcm)

print(len - count)


Fixed submission:
import math
def gcd(a, b):
    if b==0:
        return a
    return gcd(b, a%b)

A,B,C,D = map(int,input().split())

count = 0
lcm = C*D // gcd(C,D)


print(B - B//C - B//D + B//lcm - (A - 1 - (A-1)//C - (A-1)//D + (A-1)//lcm))
Buggy python submission (verdict: Runtime Error):
W, H, x, y = map(int,input().split())
hantei = 0
if (x != 0) or (y != 0):
    if (W%x == 0):
        if y*(W/x) == H:
            hantei = 1
print("{0} {1}".format(W*H/2, hantei))


Fixed submission:
W, H, x, y = map(int,input().split())
hantei = 0
if (x != 0) and (y != 0):
    if (W/2 == x) and (H/2 == y):
        hantei = 1
print("{0} {1}".format(W*H/2, hantei))

Buggy python submission (verdict: Runtime Error):
W, H, x, y = map(int,input().split())
hantei = 0
if (W%x == 0):
    if y*(W/x) == H:
        hantei = 1
print("{0} {1}".format(W*H/2, hantei))


Fixed submission:
W, H, x, y = map(int,input().split())
hantei = 0
if (x != 0) and (y != 0):
    if (W/2 == x) and (H/2 == y):
        hantei = 1
print("{0} {1}".format(W*H/2, hantei))

Buggy python submission (verdict: Runtime Error):
W, H, x, y = map(int,input().split())
hantei = 0
if (W%x == 0) and (H%y == 0):
    hantei = 1
print("{0} {1}".format(W*H/2, hantei))


Fixed submission:
W, H, x, y = map(int,input().split())
hantei = 0
if (x != 0) and (y != 0):
    if (W/2 == x) and (H/2 == y):
        hantei = 1
print("{0} {1}".format(W*H/2, hantei))
Buggy python submission (verdict: Runtime Error):
N, Q = map(int, input().split())
str = input()
length = [list(map(int, input().split())) for _ in range(Q)]

ans = [0 for _ in range(N)]
for i in range(1, N):
    if (str[i-1] == "A"):
        if (str[i] == "C"):
            ans[i] = ans[i-1] + 1
        else:
            ans[i] = ans[i-1]
    else:
        ans[i] = ans[i-1]
        ans[i+1] = ans[i-1]
        i += 1

for l1, l2 in length:
    # print(ans)
    print(ans[l2-1] - ans[l1-1])


Fixed submission:
N, Q = map(int, input().split())
str = input()
length = [list(map(int, input().split())) for _ in range(Q)]

ans = [0 for _ in range(N)]
for i in range(1, N):
    if (str[i-1] == "A") and (str[i] == "C"):
        ans[i] = ans[i-1] + 1
    else:
        ans[i] = ans[i-1]

for l1, l2 in length:
    # print(ans)
    print(ans[l2-1] - ans[l1-1])

Buggy python submission (verdict: Runtime Error):
N, Q = map(int, input().split())
str = input()
length = [list(map(int, input().split())) for _ in range(Q)]

ans = [0 for _ in range(N)]
for i in range(1, N):
    if (str[i-1] == "A")
        if (str[i] == "C"):
            ans[i] = ans[i-1] + 1
        else:
            ans[i] = ans[i-1]
    else:
        ans[i] = ans[i-1]
        ans[i+1] = ans[i-1]
        i += 1

for l1, l2 in length:
    # print(ans)
    print(ans[l2-1] - ans[l1-1])


Fixed submission:
N, Q = map(int, input().split())
str = input()
length = [list(map(int, input().split())) for _ in range(Q)]

ans = [0 for _ in range(N)]
for i in range(1, N):
    if (str[i-1] == "A") and (str[i] == "C"):
        ans[i] = ans[i-1] + 1
    else:
        ans[i] = ans[i-1]

for l1, l2 in length:
    # print(ans)
    print(ans[l2-1] - ans[l1-1])
Buggy python submission (verdict: Runtime Error):
N, K = map(int,input().split())
cost = list(map(int, input().split()))

ans_list = [0]*N
ans_list[1] = abs(cost[0] - cost[1])
temp = 10 **10

for i in range(2,N):
    temp = 10**10
    for j in range(1,K+1):
        if i-j >=0:
            compare = ans_list[i-j] + abs(cost[i-j]-cost[i])
            temp = min(compare, temp)
        else:
            break
    ans_list[i] = temp
print(ans_list.pop())


Fixed submission:
N = int(input())
h = list(map(int, input().split()))

dp = [0] * N
dp[1] = dp[0] + abs(h[1]-h[0])

for i in range(2, N):
    compare1 = dp[i-1] + abs(h[i]-h[i-1])
    compare2 = dp[i-2] + abs(h[i]-h[i-2])
    dp[i] = min(compare1, compare2)

print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
N, W = map(int, input().split())
Data = [list(map(int, input().split())) for _ in range(N)]

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

for i in range(1, N+1):
    for j in range(W+1):
        if Data[i-1][0] <= j:
            dp[i][j] = max(dp[i-1][j], dp[i-1][j-Data[i-1][0]] + Data[i-1][1])
        else:
            dp[i][j] = dp[i-1][j]

print(max(dp[-1]))


Fixed submission:
N, W = map(int, input().split())
Data = [list(map(int, input().split())) for _ in range(N)]

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

for i in range(1, N+1):
    for j in range(W+1):
        if Data[i-1][0] <= j:
            dp[i][j] = max(dp[i-1][j], dp[i-1][j-Data[i-1][0]] + Data[i-1][1])
        else:
            dp[i][j] = dp[i-1][j]

print(max(dp[-1]))
Buggy python submission (verdict: Time Limit Exceeded):
N, W = map(int, input().split())
Data = [list(map(int, input().split())) for _ in range(N)]

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

for i in range(1, N+1):
    for j in range(W+1):
        if Data[i-1][0] <= j:
            dp[i][j] = max(dp[i-1][j], dp[i-1][j-Data[i-1][0]] + Data[i-1][1])
        else:
            dp[i][j] = dp[i-1][j]

print(max(dp[-1]))


Fixed submission:
N, W = map(int, input().split())
Data = [list(map(int, input().split())) for _ in range(N)]
sum_value_aploximate = N * 10**3 + 1

dp = [[None for _ in range(sum_value_aploximate)] for _ in range(N+1)]
temp = float("inf")
dp[0] = [temp for _ in range(sum_value_aploximate)]
dp[0][0] = 0

for i in range(1, N+1):
    for j in range(sum_value_aploximate):
        if Data[i-1][1] <= j:
            dp[i][j] = min(dp[i-1][j], (dp[i-1][j-Data[i-1][1]] + Data[i-1][0]))
        else:
            dp[i][j] = dp[i-1][j]

ans = 0
for j in range(sum_value_aploximate):
    if dp[N][j] <= W:
        ans = max(ans, j)

print(ans)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]

# 小さい順にソートする
#def sort(h):
#    if len(h) <= 1:
        return h
#    base = h[-1]
#    low_temp = [];
#    high_temp = [];
#    base_count = 1
#    for i in range(len(h)-1):
#        if h[i] < base:
#            low_temp.append(h[i])
#        elif h[i] > base:
#            high_temp.append(h[i])
#        else:
#            base_count += 1
#    low = sort(low_temp)
#    high = sort(high_temp)
#    return low + [base]*base_count + high

h.sort()
hantei = 10**10
for i in range(N-K+1):
    temp = h[i:i+K]
    temp_dif = max(temp) - min(temp)
    if temp_dif < hantei:
        hantei = temp_dif

print(hantei)


Fixed submission:
D = int(input())
if D == 25:
  print("Christmas")
elif D == 24:
  print("Christmas Eve")
elif D == 23:
  print("Christmas Eve Eve")
else:
  print("Christmas Eve Eve Eve")
Buggy python submission (verdict: Runtime Error):
N, K = map(int(input().split()))
if N % K == 0:
    print("0")
else:
    print("1")


Fixed submission:
N, K = map(int, (input().split()))
if N % K == 0:
    print("0")
else:
    print("1")

Buggy python submission (verdict: Runtime Error):
N, K = int(input().split())
if N % K == 0:
    print("0")
else:
    print("1")


Fixed submission:
N, K = map(int, (input().split()))
if N % K == 0:
    print("0")
else:
    print("1")

Buggy python submission (verdict: Runtime Error):
N, K = input().split()
if N % K == 0:
    print("0")
else:
    print("1") 


Fixed submission:
N, K = map(int, (input().split()))
if N % K == 0:
    print("0")
else:
    print("1")
Buggy python submission (verdict: Runtime Error):
R = int(input())
if R < 1200:
    print("ABC")
elif R < 2800:
    print(ARC)
else:
    print(AGC)


Fixed submission:
R = int(input())
if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
N1 = []

for n in range(1, (N + 1)):
    N1.append(2 * n)

for i in N1:
    if i % N == 0:
        print(i)
        break


Fixed submission:
N = int(input())
if N % 2 == 0:
    print(N)
else:
    print(2*N)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(input())

ans = 3*10**5
for i in range(N):
    cnt = 0
    # 基準より左側の人
    for j in range(i):
        if S[j] == "W":
            cnt += 1
    # 基準より右側の人
    for k in range(1,N-i):
        if S[i+k] == "E":
            cnt += 1
    if ans > cnt:
        ans = cnt
print(ans)


Fixed submission:
N = int(input())
S = list(input())

cnt = [0] * N
if S[0] == "W":
    cnt[0] = 1

for i in range(1, N):
    if S[i] == "W":
        cnt[i] = cnt[i-1] + 1
    else:
        cnt[i] = cnt[i-1]

ans = 3*10**5
for i in range(N):
    temp = 0
    # 基準より左側の人
    if i != 0:
        temp += cnt[i-1]
    # 基準より右側の人
    if i != N-1:
        temp = temp + ((N-1) - i) - (cnt[N-1] - cnt[i])
    if ans > temp:
        ans = temp
print(ans)
Buggy python submission (verdict: Runtime Error):
row = 3
column = 3
c=[]

for i in range(1, (row+1)):
    c.append(list(map(str, input().split())))
print(c[0][0],c[1][1],c[2][2],sep="")


Fixed submission:
row = 3
column = 3
c=[]

for i in range(1, (row+1)):
    c.append(input())

print(c[0][0],c[1][1],c[2][2],sep="")
Buggy python submission (verdict: Runtime Error):
Weiht = list(map(int, input().split()))
if (Weight[0] + Weight[1]) > (Weight[2] + Weight[3]):
    print("Left")
elif (Weight[0] + Weight[1]) < (Weight[2] + Weight[3]):
    print("Right")
else:
    print("Balanced")


Fixed submission:
Weight = list(map(int, input().split()))
if (Weight[0] + Weight[1]) > (Weight[2] + Weight[3]):
    print("Left")
elif (Weight[0] + Weight[1]) < (Weight[2] + Weight[3]):
    print("Right")
else:
    print("Balanced")
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())

M = [["."*W]]
M = [[".", *input(), "."] for i in range(H)]
M.insert(0,[*("."*(W+2))])
M.append([*("."*(W+2))])

cnt = 0
Ans = []
for i in range(1, H+1):
    for j in range(1, W+1):
        if M[i][j] == ".":
            for k in range(-1, 2):
                if M[i+k][j-1] == "#":
                    cnt += 1
                if M[i+k][j] == "#":
                    cnt += 1
                if M[i+k][j+1] == "#":
                    cnt += 1
            print(cnt, end = "")
            cnt = 0
        else:
            print("#", end = "")
    print()


Fixed submission:
H, W = map(int, input().split())

M = [list("." + input() + ".") for i in range(H)]
M.insert(0, list(("."*(W+2))))
M.append(list("."*(W+2)))

cnt = 0
for i in range(1, H+1):
    for j in range(1, W+1):
        if M[i][j] == ".":
            for k in range(-1, 2):
                if M[i+k][j-1] == "#":
                    cnt += 1
                if M[i+k][j] == "#":
                    cnt += 1
                if M[i+k][j+1] == "#":
                    cnt += 1
            print(cnt, end = "")
            cnt = 0
        else:
            print("#", end = "")
    print()
Buggy python submission (verdict: Time Limit Exceeded):
N, M = input().split(" ")
N, M = int(N), int(M)
H = [int(h) for h in input().split(" ")]
A = []
B = []
for i in range(M):
    a, b = input().split(" ")
    a, b = int(a), int(b)
    A.append(a)
    B.append(b)

cnt = 0
for h in range(len(H)):
    flag = -1
    for m in range(M):
        if A[m] == h+1:      
            if H[B[m]-1] < H[A[m]-1]:
                flag = 1
            else:
                flag = 0
                break
        if B[m] == h+1:
            if H[A[m]-1] < H[B[m]-1]:
                flab = 1
            else:
                flag = 0
                break
    if flag == 1 or flag == -1:
        cnt += 1
print(cnt)

Fixed submission:
N, M = input().split(" ")
N, M = int(N), int(M)
H = [int(h) for h in input().split(" ")]
A = []
B = []
TF = [True] * N
for i in range(M):
    a, b = input().split(" ")
    a, b = int(a), int(b)
    if H[a-1] > H[b-1]:
        if TF[b-1]:
            TF[b-1] = False
    elif H[b-1] > H[a-1]:
        if TF[a-1]:
            TF[a-1] = False
    else:
        TF[b-1] = False
        TF[a-1] = False
            
print(sum(TF))
Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())

c = []
for i in range(1, X+1):
    if i != 0 and X % i == 0:
        c.append([i, X//i])

for x1, x2 in c:
    for b in range(-1000, 1000):
        if b != 0:
            if (x1+b)**3 * (2*b+x1) + (b**2) * (x1**2 + 3*x1*b+3*(b**2)) == x2:
                print(x1+b, b)
                break

Fixed submission:
X = int(input())

c = []
for i in range(1, int((X+1)**(1/2))+1):
    if i != 0 and X % i == 0:
        c.append([i, X//i])

for x1, x2 in c:
    for b in range(-1000, 1000):
        if b != 0:
            if (x1+b)**3 * (2*b+x1) + (b**2) * (x1**2 + 3*x1*b+3*(b**2)) == x2:
                print(x1+b, b)
                break

Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())

c = []
for i in range(-(X+1), X+1):
    if i != 0 and X % i == 0:
        c.append([i, X//i])

for x1, x2 in c:
    for b in range(-1000, 1000):
        if b != 0:
            if (x1+b)**4 + ((x1+b)**3)*b + ((x1+b)**2)*(b**2) + (x1+b)*(b**3) + b**4 == x2:
                print(x1+b, b)
                break

Fixed submission:
X = int(input())

c = []
for i in range(1, int((X+1)**(1/2))+1):
    if i != 0 and X % i == 0:
        c.append([i, X//i])

for x1, x2 in c:
    for b in range(-1000, 1000):
        if b != 0:
            if (x1+b)**3 * (2*b+x1) + (b**2) * (x1**2 + 3*x1*b+3*(b**2)) == x2:
                print(x1+b, b)
                break

Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())

c = []
for i in range(-(X+1), X+1):
    if i != 0 and X % i == 0:
        c.append([i, X//i])

for x1, x2 in c:
    for b in range(-10000, 10000):
        if b != 0:
            if (x1+b)**4 + ((x1+b)**3)*b + ((x1+b)**2)*(b**2) + (x1+b)*(b**3) + b**4 == x2:
                print(x1+b, b)
                break

Fixed submission:
X = int(input())

c = []
for i in range(1, int((X+1)**(1/2))+1):
    if i != 0 and X % i == 0:
        c.append([i, X//i])

for x1, x2 in c:
    for b in range(-1000, 1000):
        if b != 0:
            if (x1+b)**3 * (2*b+x1) + (b**2) * (x1**2 + 3*x1*b+3*(b**2)) == x2:
                print(x1+b, b)
                break
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

cnt = 0
for i in range(N):
    for j in range(i+1, N):
        for k in range(j+1, N):
            if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
                if j - i != k - j:
                    cnt += 1
print(cnt)

Fixed submission:
N = int(input())
S = input()

r = 0
g = 0
b = 0
for s in S:
    if s == "R":
        r += 1
    elif s == "G":
        g += 1
    else:
        b += 1

cnt = r * g * b
for i in range(N):
    for j in range(i, N):
        k = 2 * j - i
        if k >= N:
            break
        if S[i] != S[j] and S[j] != S[k] and S[i] != S[k]:
            cnt -= 1
        
print(cnt)
Buggy python submission (verdict: Runtime Error):
# 2入力
K, N = map(int, input().split())
A = input().split()
A = [int(i) for i in A]

lag = []
for i in range(len(A)):
    if i != N-1:
        lag.append(A[(i+1)%N] - A[i%N])
    else:
        lag.append(K-A[i] + A[0])

import numpy as np
max_index = np.argmax(lag)
del lag[max_index]
print(sum(lag))

Fixed submission:
# 2入力
K, N = map(int, input().split())
A = input().split()
A = [int(i) for i in A]

lag = []
for i in range(len(A)):
    if i != N-1:
        lag.append(A[(i+1)%N] - A[i%N])
    else:
        lag.append(K-A[i] + A[0])


max_value = max(lag)
max_index = lag.index(max_value)
lag.pop(max_index)
print(sum(lag))
Buggy python submission (verdict: Runtime Error):
# 2入力
H, W = map(int, input().split())

if H == 1 or W == 1:
    pirnt(1)
else:
    mass = 0
    if W % 2 != 0:
        if H % 2 != 0:
            mass += (int(H / 2) + 1) * (int(W / 2) + 1)
            mass += (int(H / 2)) * (int(W / 2))
            print(mass)
        else:
            mass += (int(H / 2)) * (int(W / 2) + 1)
            mass += (int(H / 2)) * (int(W / 2))
            print(mass)

    else:
        if H % 2 != 0:
            mass += (int(H / 2) + 1) * (int(W / 2))
            mass += (int(H / 2)) * (int(W / 2))
            print(mass)
        else:
            mass += (int(H / 2)) * (int(W / 2))
            mass += (int(H / 2)) * (int(W / 2))
            print(mass)

Fixed submission:
# 2入力
H, W = map(int, input().split())

if H == 1 or W == 1:
    print(1)
else:
    mass = 0
    if W % 2 != 0:
        if H % 2 != 0:
            mass += (int(H / 2) + 1) * (int(W / 2) + 1)
            mass += (int(H / 2)) * (int(W / 2))
            print(mass)
        else:
            mass += (int(H / 2)) * (int(W / 2) + 1)
            mass += (int(H / 2)) * (int(W / 2))
            print(mass)

    else:
        if H % 2 != 0:
            mass += (int(H / 2) + 1) * (int(W / 2))
            mass += (int(H / 2)) * (int(W / 2))
            print(mass)
        else:
            mass += (int(H / 2)) * (int(W / 2))
            mass += (int(H / 2)) * (int(W / 2))
            print(mass)
Buggy python submission (verdict: Runtime Error):
N, R = input().split()
N = int(N)
R = int(R)

if N >= 10:
    print(K)
else:
    print(R + 100*(10-N))

Fixed submission:
N, R = input().split()
N = int(N)
R = int(R)

if N >= 10:
    print(R)
else:
    print(R + 100*(10-N))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
ans = {i:0 for i in range(N)}
pn = {i:0 for i in range(N)}
ans_num = 0
pn_num = 0

for i in range(M):
    p_tmp, S_tmp = input().split()
    p_tmp = int(p_tmp)
    
    if ans[p_tmp] == 0 and S_tmp == "AC":
        ans[p_tmp] = 1
        ans_num += 1
        pn_num += pn[p_tmp]
        
    elif ans[p_tmp] != 1 and S_tmp == "WA":
        pn[p_tmp] = pn[p_tmp] + 1
        
print(ans_num, pn_num)

Fixed submission:
N, M = map(int, input().split())
ans = {i:0 for i in range(N+1)}
pn = {i:0 for i in range(N+1)}
ans_num = 0
pn_num = 0

for i in range(M):
    p_tmp, S_tmp = input().split()
    p_tmp = int(p_tmp)
    
    if ans[p_tmp] == 0 and S_tmp == "AC":
        ans[p_tmp] = 1
        ans_num += 1
        pn_num += pn[p_tmp]
        
    elif ans[p_tmp] != 1 and S_tmp == "WA":
        pn[p_tmp] = pn[p_tmp] + 1
        
print(ans_num, pn_num)
Buggy python submission (verdict: Runtime Error):
import math

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))

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

def gcd(m, n):
    x = max(m, n)
    y = min(m, n)
    if x % y == 0:
        return y
    else:
        while x % y != 0:
            z = x%y
            x = y
            y = z
        else:
            return z
def lcm(m, n):
    return int(m * n/gcd(m,n))

print(lcm(a,b))

Buggy python submission (verdict: Runtime Error):
import math

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))

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

def gcd(m, n):
    x = max(m, n)
    y = min(m, n)
    if x % y == 0:
        return y
    else:
        while x % y != 0:
            z = x%y
            x = y
            y = z
        else:
            return z
def lcm(m, n):
    return int(m * n/gcd(m,n))

print(lcm(a,b))