Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N,M,R = map(int,input().split())
Visit = list(map(int,input().split()))
lVisit = len(Visit)

Data = []
INF = 10**10
for _ in range(N):
    Data.append([INF]*N)
for i in range(N):
    Data[i][i] = 0
for _ in range(M):
    a,b,c = map(int,input().split())
    Data[a-1][b-1] = c
    Data[b-1][a-1] = c

for k in range(N):
    for i in range(N):
        for j in range(N):
            Data[i][j] = min(Data[i][j], Data[i][k]+Data[k][j])

ans = 10**10
for course in list(itertools.permutations(Visit)):
    sum1 = 0
    for i in range(lVisit-1):
        to = course[i+1]
        fm = course[i]
        sum1 += Data[fm-1][to-1]
    ans = min(ans,sum1)
print(ans)


Fixed submission:
import itertools

N,M,R = map(int,input().split())
Visit = list(map(int,input().split()))
lVisit = len(Visit)

Data = []
INF = 10**10
for _ in range(N):
    Data.append([INF]*N)
for i in range(N):
    Data[i][i] = 0
for _ in range(M):
    a,b,c = map(int,input().split())
    Data[a-1][b-1] = c
    Data[b-1][a-1] = c

for k in range(N):
    for i in range(N):
        for j in range(N):
            Data[i][j] = min(Data[i][j], Data[i][k]+Data[k][j])

ans = 10**10
for course in list(itertools.permutations(Visit)):
    sum1 = 0
    for i in range(lVisit-1):
        to = course[i+1]
        fm = course[i]
        sum1 += Data[fm-1][to-1]
    ans = min(ans,sum1)
print(ans)
Buggy python submission (verdict: Runtime Error):
def gcm(a,b):
    if a < b:
        a,b = b,a
    while True:
        if a % b == 0:
            return b
        else:
            a,b = b,a % b

def lcm(a,b):
    g = gcm(a,b)
    return a*b//g;

N = int(input())
Data = []
for _ in range(N):
    Data.append(int(input()))
ans = Data[0]
for i in range(1,N):
    ans = lcm(ans,Data[i])
print(ans)
def gcm(a,b):
    if a < b:
        a,b = b,a
    while True:
        if a % b == 0:
            return b
        else:
            a,b = b,a % b

def lcm(a,b):
    g = gcm(a,b)
    return a*b//g;

N = int(input())
Data = []
for _ in range(N):
    Data.append(int(input()))
ans = Data[0]
for i in range(1,N):
    ans = lcm(ans,Data[i])
print(ans)


Fixed submission:
def gcm(a,b):
    if a < b:
        a,b = b,a
    while True:
        if a % b == 0:
            return b
        else:
            a,b = b,a % b

def lcm(a,b):
    g = gcm(a,b)
    return a*b//g;

N = int(input())
Data = []
for _ in range(N):
    Data.append(int(input()))
ans = Data[0]
for i in range(1,N):
    ans = lcm(ans,Data[i])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
Data = list(map(int,input().split()))
Ans = []
if len(Data) % 2 == 0:
    m = len(Data) // 2
    for i in range(m):
        Ans.insert(0,Data[2*i+1])
    for i in range(m):
        Ans.append(Data[2*i])
else:
    m = len(Data) // 2
    for i in range(m+1):
        Ans.insert(0,Data[2*i])
    for i in range(m):
        Ans.append(Data[2*i+1])

for a in Ans:
    print(a,end=' ')


Fixed submission:
n = int(input())
m = n // 2
Data = list(map(int,input().split()))
Ans = []
if n % 2 == 0:
    for i in range(m):
        Ans.append(Data[n-1-i*2])
    for i in range(m):
        Ans.append(Data[2*i])
else:
    for i in range(m+1):
        Ans.append(Data[n-1-i*2])
    for i in range(m):
        Ans.append(Data[2*i+1])

for a in Ans:
    print(a,end=' ')

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
Data = list(map(int,input().split()))
Ans = []
for d in Data:
    Ans.append(d)
    Ans.reverse()
for a in Ans:
    print(a, end=' ')


Fixed submission:
n = int(input())
m = n // 2
Data = list(map(int,input().split()))
Ans = []
if n % 2 == 0:
    for i in range(m):
        Ans.append(Data[n-1-i*2])
    for i in range(m):
        Ans.append(Data[2*i])
else:
    for i in range(m+1):
        Ans.append(Data[n-1-i*2])
    for i in range(m):
        Ans.append(Data[2*i+1])

for a in Ans:
    print(a,end=' ')
Buggy python submission (verdict: Runtime Error):
import itertools

N,M = map(int,input().split())
Data = []
for _ in range(M+1):
    Data.append([0]*(M+1))
for _ in range(M):
    a,b = map(int,input().split())
    Data[a][b] = 1
    Data[b][a] = 1

ans = 0
for r in itertools.permutations(range(2,N+1)):
    Rlist = list(r)
    a = 1
    b = Rlist[0]
    if Data[a][b] == 0:
        continue
    else:
        flag = True 
        for i in range(len(Rlist)-1):
            a = Rlist[i]
            b = Rlist[i+1]
            if Data[a][b] == 0:
                flag = False
                break
        if flag:
            ans += 1

print(ans)


Fixed submission:
import itertools

N,M = map(int,input().split())
Data = []
for _ in range(N+1):
    Data.append([0]*(N+1))
for _ in range(M):
    a,b = map(int,input().split())
    Data[a][b] = 1
    Data[b][a] = 1

ans = 0
for r in itertools.permutations(range(2,N+1)):
    Rlist = list(r)
    a = 1
    b = Rlist[0]
    if Data[a][b] == 0:
        continue
    else:
        flag = True 
        for i in range(len(Rlist)-1):
            a = Rlist[i]
            b = Rlist[i+1]
            if Data[a][b] == 0:
                flag = False
                break
        if flag:
            ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
class UnionFind:
    MAX_N = 0
    PAR  = [] 
    RANK = []

    def __init__(self,n):
        self.MAX_N = n
        self.PAR = [ i for i in range(n)]
        self.RANK= [ 0 ] * n

    def find(self,x):
        if self.PAR[x] == x:
            return x
        else:
            self.PAR[x] = self.find(self.PAR[x])
            return self.PAR[x] 

    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.RANK[x] < self.RANK[y]:
            self.PAR[x] = y
        else:
            self.PAR[y] = x
            if self.RANK[x] == self.RANK[y]:
                self.RANK[x] += 1

    def same(self,x,y):
        return self.find(x) == self.find(y)

N,K,L = map(int,input().split())
path = UnionFind(N+1)
for _ in range(K):
    p,q = map(int,input().split())
    path.union(p,q)
rail = UnionFind(N+1)
for _ in range(L):
    p,q = map(int,input().split())
    rail.union(p,q)

Data = {}
for i in range(1,N+1):
    p = path.find(i)
    r = rail.find(i)
    k = str(p)+"-"+str(r)
    if k in Data.keys():
        Data[k] += 1
    else:
        Data[k] = 1

for i in range(1,N+1):
    p = path.find(i)
    r = rail.find(i)
    k = str(p)+"-"+str(r)
    print( Data[k], end= ' ')



Fixed submission:
c = input()
boin = 'aeiou'
if c in boin:
    print('vowel')
else:
    print('consonant')
Buggy python submission (verdict: Time Limit Exceeded):
class UnionFind:
    MAX_N = 0
    PAR  = [] 
    RANK = []

    def __init__(self,n):
        self.MAX_N = n
        self.PAR = [ i for i in range(n)]
        self.RANK= [ 0 ] * n

    def find(self,x):
        if self.PAR[x] == x:
            return x
        else:
            self.PAR[x] = self.find(self.PAR[x])
            return self.PAR[x] 

    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.RANK[x] < self.RANK[y]:
            self.PAR[x] = y
        else:
            self.PAR[y] = x
            if self.RANK[x] == self.RANK[y]:
                self.RANK[x] += 1

    def same(self,x,y):
        return self.find(x) == self.find(y)

N,K,L = map(int,input().split())
path = UnionFind(N+1)
for _ in range(K):
    p,q = map(int,input().split())
    path.union(p,q)
rail = UnionFind(N+1)
for _ in range(L):
    p,q = map(int,input().split())
    rail.union(p,q)

Data = {}
for i in range(1,N+1):
    p = path.find(i)
    r = rail.find(i)
    k = str(p)+"-"+str(r)
    if k in Data.keys():
        Data[k] += 1
    else:
        Data[k] = 1

for i in range(1,N+1):
    p = path.find(i)
    r = rail.find(i)
    k = str(p)+"-"+str(r)
    print( Data[k], end= ' ')


Fixed submission:
class UnionFind:
    MAX_N = 0
    PAR  = [] 
    RANK = []

    def __init__(self,n):
        self.MAX_N = n
        self.PAR = [ i for i in range(n)]
        self.RANK= [ 0 ] * n

    def find(self,x):
        if self.PAR[x] == x:
            return x
        else:
            self.PAR[x] = self.find(self.PAR[x])
            return self.PAR[x] 

    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.RANK[x] < self.RANK[y]:
            self.PAR[x] = y
        else:
            self.PAR[y] = x
            if self.RANK[x] == self.RANK[y]:
                self.RANK[x] += 1

    def same(self,x,y):
        return self.find(x) == self.find(y)

N,K,L = map(int,input().split())
path = UnionFind(N+1)
for _ in range(K):
    p,q = map(int,input().split())
    path.union(p,q)
rail = UnionFind(N+1)
for _ in range(L):
    p,q = map(int,input().split())
    rail.union(p,q)

Data = {}
for i in range(1,N+1):
    p = path.find(i)
    r = rail.find(i)
    k = str(p)+"-"+str(r)
    if k in Data.keys():
        Data[k] += 1
    else:
        Data[k] = 1

for i in range(1,N+1):
    p = path.find(i)
    r = rail.find(i)
    k = str(p)+"-"+str(r)
    print( Data[k], end= ' ')
Buggy python submission (verdict: Runtime Error):
K=int(input())
S=input()
A=len(S)
if A=K:
  print(S)
if A>K:
  print(S[0:K:1]+'...')
  
  


Fixed submission:
K=int(input())
S=input()
A=len(S)
if A<=K:
  print(S)
if A>K:
  print(S[0:K:1]+'...')
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce

n, k = map(int, input().split())
a = list(map(int, input().split()))

# 評点計算

# s[0]~s[k-2]まで0埋め
s = [0 for _ in range(k-1)]

# s[n-k] = a[0] * a[1] * ... * a[n-k]
s.append(reduce(lambda x, y: x*y, [a[i] for i in range(0, n-k+1)]))

# s[i+1] = s[i] / a[i-k+1] * a[i+1]
for i in range(k-1, n-1):
    s.append(s[i] / a[i-k+1] * a[i+1])

# 出力
for i in range(k, n):
    print("Yes" if s[i] > s[i-1] else "No" )

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))

for i in range(k-1, n-1):
    print("Yes" if a[i+1] > a[i-k+1] else "No")

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))

# 評点計算
# s[i-1]: i学期の評点
s = [0 for _ in range(k)]
for i in range(n - k + 1):
    p = 1
    for j in range(k):
        p *= a[i + j]
    s.append(p)

# 出力
for i in range(n - k):
    print("Yes" if s[k + i + 1] > s[k + i] else "No" )


Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))

for i in range(k-1, n-1):
    print("Yes" if a[i+1] > a[i-k+1] else "No")
Buggy python submission (verdict: Runtime Error):

iAC = 0
iWA = 0
iTLE = 0
iRE = 0

N = int(input())
for i in range(N):
    S = input()
    if S == "AC":
        iAC += 1
    elif S == "WA":
        iWA += 1
    elif S == "TLE":
        iTLE += 1
    elif S == "RE":
        iRE += 1

print("AC x {}".format(iAC))
print("WA x {}".format(iWA))
print("TLE x {}".format(iTLE))
print("RE x {}".format(iRE))

Fixed submission:
import math
N = int(input())
print(math.ceil(N/1000)*1000 - N)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

from heapq import heappush, heappop

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

# A日後、報酬B
a = []
b = []
for i in range(n):
    ai, bi = map(int, input().split())
    a.append(ai)
    b.append(bi)

sum = 0
used = [False] * n
for i in range(0, m):
    # A <= iで未使用のものをheapqに入れる
    hq = []
    for j in range(n):
        # print(a[j], i+1,a[j]<=i+1, not used[j])

        if a[j] <= i + 1 and not used[j]:
            heappush(hq, (-b[j], j, a[j]))

    val = None
    if len(hq) > 0:
        val = heappop(hq)
    if val is not None:
        sum += -val[0]
        used[val[1]] = True

print(sum)


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

from heapq import heappush, heappop

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

# A日後、報酬B
workList = {}
for i in range(n):
    a, b = map(int, input().split())
    if a not in workList:
        workList[a] = [-b]
    else:
        workList[a].append(-b)
# print(workList)

hq = []
sum = 0
for i in range(1, m + 1):
    if i in workList:
        for w in workList[i]:
            heappush(hq, w)

    val = None
    if len(hq) > 0:
        val = heappop(hq)
    if val is not None:
        sum += -val

print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

from operator import itemgetter

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

# A日後、報酬B
a = []
b = []
for i in range(n):
    ai, bi = map(int, input().split())
    a.append(ai)
    b.append(bi)

sum = 0
used = [False] * n
for i in range(1, m+1):
    # A <= iでBが最大となるjを探す(使用済み除く)
    max_b = 0
    use_j = None
    for j in range(n):
        # print('i:{}, j:{}'.format(i, j))
        if a[j] <= i:
            if not used[j]:
                if b[j] > max_b:
                    max_b = b[j]
                    use_j = j
    if not use_j == None:
        used[use_j] = True
        sum += max_b

print(sum)


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

from heapq import heappush, heappop

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

# A日後、報酬B
workList = {}
for i in range(n):
    a, b = map(int, input().split())
    if a not in workList:
        workList[a] = [-b]
    else:
        workList[a].append(-b)
# print(workList)

hq = []
sum = 0
for i in range(1, m + 1):
    if i in workList:
        for w in workList[i]:
            heappush(hq, w)

    val = None
    if len(hq) > 0:
        val = heappop(hq)
    if val is not None:
        sum += -val

print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
S= list(input())
N = len(S)
cnt = 10**5

# dp(i,j) 最初jにいた子供がi回の移動後にいるマス
# dp(1,j) = j-1 or j+1
# dp(2,j) = dp(1, dp(1,j))
# dp(2,j) = dp(1, dp(1,j))

# dp(10^5, j) 1 <= j <= Nをもとめる

dp = [[0] * N for i in range(cnt + 1)]

for j in range(N):
    dp[0][j] = j
for i in range(cnt):
    for j in range(N):
        if S[dp[i][j]] == 'L':
            dp[i+1][j] = dp[i][j] - 1
        else:
            dp[i+1][j] = dp[i][j] + 1
# print(dp)
ans = [0] * N
for j in range(N):
    # print(dp[cnt][j])
    ans[dp[cnt][j]] += 1
print(' '.join([str(n) for n in ans]))

Fixed submission:
# -*- coding: utf-8 -*-
S= list(input())

isR = True
cnt_tmp = 0
cntList = []
for s in S:
    if s == 'R':
        if isR:
            cnt_tmp += 1
        else:
            cntList.append(cnt_tmp)
            isR = True
            cnt_tmp = 1
    else:
        if isR:
            cntList.append(cnt_tmp)
            isR = False
            cnt_tmp = 1
        else:
            cnt_tmp += 1

cntList.append(cnt_tmp)

ans = []

for i,cnt in enumerate(cntList):
    if i % 2 == 0:
        # R
        ans += [0] * (cnt - 1)
        q, mod = divmod(cnt, 2)
        ans += [q+mod, q]
    else:
        #L
        q, mod = divmod(cnt, 2)
        ans[len(ans)-2] += q
        ans[len(ans)-1] += (q+mod)
        ans += [0] * (cnt - 1)

print(' '.join([str(n) for n in ans]))
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

N, Ma, Mb = map(int, input().split())

d = []
for i in range(N):
    a, b, c = map(int, input().split())
    d.append((a, b, c))

# それぞれの薬品を購入するかしないかでbit全探索
can = False
min = -1
n = len(d)
for i in range(2**n):
    sum_a = 0
    sum_b = 0
    sum_c = 0
    for j in range(n):
        if (i >> j) & 1:
            sum_a += d[j][0]
            sum_b += d[j][1]
            sum_c += d[j][2]
    if sum_a > 0 and Ma*sum_b == Mb*sum_a:
        if min < 0 or sum_c < min:
            min = sum_c

print(min)



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

N, Ma, Mb = map(int, input().split())

d = []
for i in range(N):
    a, b, c = map(int, input().split())
    d.append((a, b, c))

# 全探索だとTLEなのでDPを用いる

# dp[i][ca][cb] := i-1番目までの組み合わせでAがca,Bがcbとなるときの最小コスト

INF = float('inf')
g_max = 10 * N
dp = [[[INF for cb in range(g_max+1)] for ca in range(g_max+1)] for i in range(N+1)]

dp[0][0][0] = 0

for i in range(N):
    for ca in range(g_max+1):
        for cb in range(g_max+1):
            if dp[i][ca][cb] == INF:
                continue
            a, b, c = d[i]
            # i番目の薬品を選ばない場合
            dp[i+1][ca][cb] = min(dp[i+1][ca][cb], dp[i][ca][cb])
            # i番目の薬品を選ぶ場合
            dp[i+1][ca+a][cb+b] = min(dp[i+1][ca+a][cb+b], dp[i][ca][cb]+c)

ans = -1
for ca in range(g_max+1):
    for cb in range(g_max+1):
        c = dp[N][ca][cb]
        if c == INF:
            continue
        if ca*Mb == cb*Ma and c > 0:
            if ans < 0 or c < ans:
                ans = c

print(ans)
Buggy python submission (verdict: Runtime Error):
s,t=input().split()
if(t[0:-1]==s):
  print("Yes")
else:
  print("No")

Fixed submission:
s=input()
t=input()
if(t[0:-1]==s):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
print("{} {} {}".format(c,a,b))

Fixed submission:
array = list(map(int, input().split()))
print(array.index(0)+1)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
print(int(n*(n+1)/2+m*(m+1)/2)

Fixed submission:
n,m=map(int,input().split())
print(int(n*(n-1)/2+m*(m-1)/2))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(Max(a-2*b,0))

Fixed submission:
a,b=map(int,input().split())
print(max(a-2*b,0))
Buggy python submission (verdict: Runtime Error):
l=input()
for i in range(len(l)):
    if l[i]==l[i+1]:
        print('Bad')
        break
else:
    print('Good')

Fixed submission:
l=input()
for i in range(len(l)-1):
    if l[i]==l[i+1]:
        print('Bad')
        break
else:
    print('Good')

Buggy python submission (verdict: Runtime Error):
l=list(input())
for i in range(len(l)):
    if l[i]==l[i+1]:
        print('Bad')
        break
else:
    print('Good')

Fixed submission:
l=input()
for i in range(len(l)-1):
    if l[i]==l[i+1]:
        print('Bad')
        break
else:
    print('Good')

Buggy python submission (verdict: Runtime Error):
for i in range(len(l)):
    if l[i]==l[i+1]:
        print('Bad')
        break
else:
    print('Good')

Fixed submission:
l=input()
for i in range(len(l)-1):
    if l[i]==l[i+1]:
        print('Bad')
        break
else:
    print('Good')
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a<=5:
    print(0)
elif 6<=a and a<=12:
    print(int(b/2)a)
else:
    print(b)

Fixed submission:
a,b = map(int,input().split())
if a<=5:
    print(0)
elif 6<=a and a<=12:
    print(int(b/2))
else:
    print(b)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
print(a*b*/2)

Fixed submission:
a,b,c = map(int,input().split())
print(int(a*b/2))
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
a,b,c = map(int,input().split())
l=sorted([a,b,c])
print(l[2]-l[1]+l[1]-l[0])


Fixed submission:
a,b,c = map(int,input().split())
l=sorted([a,b,c])
print(l[2]-l[1]+l[1]-l[0])
Buggy python submission (verdict: Runtime Error):
s = input()
print('Yes' if s[0]!=s[1]&&s[1]!=s[2]&&s[0]!=s[2] else 'No')

Fixed submission:
s = input()
print('Yes' if s[0]!=s[1] and s[1]!=s[2] and s[0]!=s[2] else 'No')
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print('Odd' if a%2!=0 and b%2!=0 else 'Even')

Fixed submission:
a,b = map(int,input().split())
print('Odd' if a%2!=0 and b%2!=0 else 'Even')

Buggy python submission (verdict: Runtime Error):
print('Odd' if int(input())%2!=0 and int(input())%2!=0 else 'Even')

Fixed submission:
a,b = map(int,input().split())
print('Odd' if a%2!=0 and b%2!=0 else 'Even')

Buggy python submission (verdict: Runtime Error):
print('Odd' if input()%2!=0 and input()%2!=0 else 'Even')

Fixed submission:
a,b = map(int,input().split())
print('Odd' if a%2!=0 and b%2!=0 else 'Even')
Buggy python submission (verdict: Runtime Error):
import math
print(math.ceil((int(input())+int(input()))/2))

Fixed submission:
a,b = map(int,input().split())
import math
print(math.ceil((a+b)/2))

Buggy python submission (verdict: Runtime Error):
import math
print(math.ceil((int(input)+int(input))/2))

Fixed submission:
a,b = map(int,input().split())
import math
print(math.ceil((a+b)/2))
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
print(n*m-2(n+m)+4)

Fixed submission:
a,b = map(int,input().split())
print((a-1)*(b-1))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(max(a+b,a+b-24)

Fixed submission:
a,b=map(int,input().split())
if a+b>=24:
  print(a+b-24)
else:
  print(a+b)
Buggy python submission (verdict: Runtime Error):
a,b=input().split()
x= (a=="H")
y=(b=="H")
if x and y or not x and not y
  print("H")
else:
  print("D")

Fixed submission:
a,b=input().split()
x= (a=="H")
y=(b=="H")
if x and y or not x and not y:
  print("H")
else:
  print("D")

Buggy python submission (verdict: Runtime Error):
a,b=input().split()
x= (a=="H")
y=(b=="H")
if :x and y or not x and not y
  print("H")
else:
  print("D")

Fixed submission:
a,b=input().split()
x= (a=="H")
y=(b=="H")
if x and y or not x and not y:
  print("H")
else:
  print("D")

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
x= (a=="H")
y=(b=="H")
if :x and y or not x and not y
  print("H")
else:
  print("D")

Fixed submission:
a,b=input().split()
x= (a=="H")
y=(b=="H")
if x and y or not x and not y:
  print("H")
else:
  print("D")
Buggy python submission (verdict: Runtime Error):
a,b = = map(int,input().split())
if a==1 and b!=1 or a>b:
  print('Alice')
elif b==1 and a!=1 or b>a:
  print('Bob')
else:
  print('Draw')

Fixed submission:
a,b = map(int,input().split())
if a==b:
  print('Draw')
elif a==1 or b!=1 and a>b:
  print('Alice')
else:
  print('Bob')
Buggy python submission (verdict: Runtime Error):
xs = inpt().split()

print("A"+xs[2][0]+"B")

Fixed submission:
xs = input().split()
 
print("A"+xs[1][0]+"C")
Buggy python submission (verdict: Runtime Error):
ys = list(map(int,input().split()))
ys.sort()
print('Yes' if ys[0]+ys[1]==y[2] else 'No')

Fixed submission:
ys = list(map(int,input().split()))
ys.sort()
print('Yes' if ys[0]+ys[1]==ys[2] else 'No')
Buggy python submission (verdict: Runtime Error):
import math
print((int(input())*2*math.pi())

Fixed submission:
r=int(input())
print(2*r*3.141592)

Buggy python submission (verdict: Runtime Error):
r=int(input())
import math
print(math.pi()*r**2)

Fixed submission:
r=int(input())
print(2*r*3.141592)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
for num	in input().split():
  n-=num
print(n if n>=0 else -1)

Fixed submission:
n,m=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
rem = n-sum(a)
print(rem if rem>=0 else -1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
buka = [0]*n
for i in range(n):
  buka[int(input())-1] += 1
print(*buka,sep='/n')

Fixed submission:
n=int(input())
buka = [0]*n
for joushi in input().split():
  buka[int(joushi)-1] += 1
print(*buka,sep='\n')
Buggy python submission (verdict: Runtime Error):
k,n=map(int,input().split())
a=list(map(int,input().split()))
dist = [k-dist[n-1]+dist[0]]
for i in range(n):
  dist.append(a[i+1]-a[i])

print(k-max(dist))


Fixed submission:
k,n=map(int,input().split())
a=list(map(int,input().split()))
dist = [k-a[n-1]+a[0]]
for i in range(n-1):
  dist.append(a[i+1]-a[i])

print(k-max(dist))
Buggy python submission (verdict: Runtime Error):
def cmb(n,k):
  x,y=n,k
  for i in range(1,k):
    x*=n-i
    y*=k-i
  return x//y

n,m=[int(x) for x in input().split()]
N=cmb(m,2) if n>=2 else 0
M=cmb(n,2) if m>=2 eles 0
print(N+M)

Fixed submission:
def cmb(n,k):
  x,y=n,k
  for i in range(1,k):
    x*=n-i
    y*=k-i
  return x//y

n,m=[int(x) for x in input().split()]
N=cmb(n,2) if n>=2 else 0
M=cmb(m,2) if m>=2 else 0
print(N+M)
Buggy python submission (verdict: Runtime Error):
k=int(input())
nums=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(nums[k])

Fixed submission:
k=int(input())
nums=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(nums[k-1])
Buggy python submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
ans=0

se=n//(a+b)
n%=a+b
ans+=se*a + min(a,n)
prnit(ans)

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

se=n//(a+b)
n%=a+b
ans+=se*a + min(a,n)
print(ans)