Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def SolveABC106A(A,B):
    print (int(A)-1) * (int(B)-1)

A = raw_input()
B = raw_input()
SolveABC106A(A,B)

Fixed submission:
def SolveABC106A(A,B):
    print (int(A)-1) * (int(B)-1)

A, B = map(int, raw_input().split())
SolveABC106A(A,B)
Buggy python submission (verdict: Runtime Error):
import numpy as np

def SolveNegBinary(N):
    r = N
    # ansTrue allocates the "True" index for -2nary expression
    ansTrue = []
    
    while r != 0:
        ind = (- np.sign(r) + 1)/2
        s = (-2)**ind
        while np.abs(s) < np.abs(r):
            ind +=2
            s += (-2)**ind

        ansTrue.insert(0,ind)
        r = r - (-2)**ind

    displayAnswer = ""
    for k in range(ansTrue[-1] + 1)[::-1]:
        if k in ansTrue:
            displayAnswer += "1"
        else:
            displayAnswer += "0"
        
    
    print displayAnswer
    

n = input()
SolveNegBinary(n)

Fixed submission:
import numpy as np

def SolveNegBinary(N):
    if N == 0:
        print "0"
    else:
        r = N
        # ansTrue allocates the "True" index for -2nary expression
        ansTrue = []

        while r != 0:
            ind = (- np.sign(r) + 1)/2
            s = (-2)**ind
            while np.abs(s) < np.abs(r):
                ind +=2
                s += (-2)**ind

            ansTrue.insert(0,ind)
            r = r - (-2)**ind

        disAnswer = ""
        for k in range(ansTrue[-1] + 1)[::-1]:
            if k in ansTrue:
                disAnswer += "1"
            else:
                disAnswer += "0"


        print disAnswer
    

N = input()
SolveNegBinary(N)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A_s = list(map(int,input().split()))


x = 0
for l in range(N):
  for r in range(N-l):
    hoge = float(sum(A_s[l:l+r+1]) / M)
    if hoge.is_integer():
      x += 1
      
print(x)

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

Buggy python submission (verdict: Runtime Error):
N = float(input())

q = N
r_s = []
while q!=1:
  hoge = (q-1) / (-2)
  if hoge.is_integer():
    r = int(1)
    q = float(hoge)
  else:
    r = int(0)
    q = float(q/(-2))
  
  r_s.append(r)
r_s.append(1)
r_s = r_s[::-1]

for i in range(len(r_s)):
  print(r_s[i], end="")

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

Buggy python submission (verdict: Runtime Error):
N = float(input())
q = N
while q!=1:
  hoge = (q-1) / (-2)
  if hoge.is_integer():
    r = int(1)
    q = float(hoge)
  else:
    r = int(0)
    q = float(q/(-2))
  r_s.append(r)
r_s.append(1)
r_s = r_s[::-1]
for i in range(len(r_s)):
  print(r_s[i], end="")

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

Buggy python submission (verdict: Runtime Error):
N = int(input())
import numpy as np
a = np.empty((26,15))
for i in range(26):
  for j in range(15):
    a[i][j] = 4 * i + 7 * j

if N in a:
  print('Yes')
else:
  print('No')

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

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


Fixed submission:
N, K = map(int, input().split())
r = N % K
if r == 0:
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
import numpy as np
a = np.array((26,15))
for i in range(26):
  for j in range(15):
    a[i][j] = 4 * i + 7 * j

if N in a:
  print('Yes')
else:
  print('No')

Fixed submission:
N = int(input())
import numpy as np
a = np.empty((26,15))
for i in range(26):
  for j in range(15):
    a[i][j] = 4 * i + 7 * j

if N in a:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
def search(node):
    global ans

    if sum(is_visit) == n:
        ans += 1

    for i in range(n):
        if is_neighbor[node][i]:
            if not is_visit[i]:
                is_visit[i] = True
                search(i)
                is_visit[i] = False

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

is_neighbor = [[False for j in range(n)] for i in range(n)]
for i in range(n):
    a, b = map(int, input().split())
    is_neighbor[a - 1][b - 1] = True
    is_neighbor[b - 1][a - 1] = True

is_visit = [False for _ in range(n)]

ans = 0

is_visit[0] = True
search(0)
print(ans)

Fixed submission:
def search(node):
    global ans

    if sum(is_visit) == n:
        ans += 1

    for i in range(n):
        if is_neighbor[node][i]:
            if not is_visit[i]:
                is_visit[i] = True
                search(i)
                is_visit[i] = False

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

is_neighbor = [[False for j in range(n)] for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    is_neighbor[a - 1][b - 1] = True
    is_neighbor[b - 1][a - 1] = True

is_visit = [False for _ in range(n)]

ans = 0

is_visit[0] = True
search(0)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()

x = ''
if s[-1] == 'B':
    x = 'W'
else:
    x = 'B'

cnt = 0
while True:
    i = s.rfind(x)
    if i != -1:
        s = s[:i] + "".join([x]*(len(s[i:]) + 1))
        cnt += 1
        if x == 'B':
            x = 'W'
        else:
            x = 'B'
    else:
        break
print(cnt)



Fixed submission:
s = input()

cnt = 0
tmp = s[0]
for i in range(1, len(s)):
    if s[i] != tmp:
        tmp = s[i]
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
S = input()

# 2^n-1の2進数は全組み合わせを表す
combs = pow(2, len(S) - 1)
total = 0
for i in range(combs):
    # i番目の組み合わせ（2進数）
    comb_i = format(i, '0' + str(len(S)) + 'b')
    if len(comb_i) > 1:
        comb_i = comb_i[1:]

    tmp = S[0]
    for j in range(len(comb_i)):
        b = int(comb_i[j])
        if b == 1:
            tmp += "+"
        tmp += S[j + 1]
    total += eval(tmp)
print(total)



Fixed submission:
import sys

S = input()

# 2^n-1の2進数は全組み合わせを表す
combs = pow(2, len(S) - 1)
if len(S) == 1:
    print(S)
    sys.exit()

total = 0
for i in range(combs):
    # i番目の組み合わせ（2進数）
    comb_i = format(i, '0' + str(len(S)) + 'b')
    if len(comb_i) > 1:
        comb_i = comb_i[1:]

    tmp = S[0]
    for j in range(len(comb_i)):
        b = int(comb_i[j])
        if b == 1:
            tmp += "+"
        tmp += S[j + 1]
    total += eval(tmp)
print(total)
Buggy python submission (verdict: Runtime Error):
H, W, N = (int(i) for i in input().split())

P = []
for i in range(N):
    pa, pb = input().split()
    P.append((int(pa)-1, int(pb)-1))

Q = {}
for pa, pb in P:
    for i in range(3):
        for j in range(3):
            if (pa - i >= 0) and (pb - j >= 0) and (pa - i <= H - 3) and (pb - j <= W - 3):
                if (pa - i, pb - j) in Q:
                    Q[(pa - i, pb - j)] += 1
                else:
                    Q[(pa - i, pb - j)] = 1
cnt = [0] * 9
for k, v in Q.items():
    cnt[v] += 1
cnt[0] = (H - 2) * (W - 2) - len(Q)
print(cnt)

Fixed submission:
H, W, N = (int(i) for i in input().split())

P = []
for i in range(N):
    pa, pb = input().split()
    P.append((int(pa)-1, int(pb)-1))

Q = {}
for pa, pb in P:
    for i in range(3):
        for j in range(3):
            if (pa - i >= 0) and (pb - j >= 0) and (pa - i <= H - 3) and (pb - j <= W - 3):
                if (pa - i, pb - j) in Q:
                    Q[(pa - i, pb - j)] += 1
                else:
                    Q[(pa - i, pb - j)] = 1
cnt = [0] * 10
for k, v in Q.items():
    cnt[v] += 1
cnt[0] = (H - 2) * (W - 2) - len(Q)
for i in range(10):
    print(cnt[i])
Buggy python submission (verdict: Runtime Error):
n, k = (int(char) for char in input().split())
d = [int(i) for i in input().split()]

'''
n = 10
k = 8
d = [0, 2, 3]
D = [i for i in range(10)]
'''
like_vals = [int(str(i)) for i in D if i not in d]

i = 0

n = [int(str(n)[i]) for i in range(len(str(n)))]
r = [-1] * len(n)
while i < len(n):
    if n[i] in like_vals:
        r[i] = n[i]
        i += 1
    elif n[i] < max(like_vals):
        like_bigger = [like_val for like_val in like_vals if like_val > n[i]]
        r[i] = min(like_bigger)
        for j in range(i + 1, len(n)):
            r[j] = min(like_vals)
        break
    else:
        r = [-1] * (len(n) + 1)
        if min(like_vals) != 0:
            r[0] = min(like_vals)
        else:
            r[0] = min([like_val for like_val in like_vals if like_val != 0])

        for j in range(1, len(n) + 1):
            r[j] = min(like_vals)
        break

print(r)

Fixed submission:
n, k = (int(char) for char in input().split())
d = [int(i) for i in input().split()]

'''
n = 10
k = 8
d = [0, 2, 3]
'''
D = [i for i in range(10)]

like_vals = [int(str(i)) for i in D if i not in d]

i = 0

n = [int(str(n)[i]) for i in range(len(str(n)))]
r = [-1] * len(n)
while i < len(n):
    if n[i] in like_vals:
        r[i] = n[i]
        i += 1
    elif n[i] < max(like_vals):
        like_bigger = [like_val for like_val in like_vals if like_val > n[i]]
        r[i] = min(like_bigger)
        for j in range(i + 1, len(n)):
            r[j] = min(like_vals)
        break
    else:
        r = [-1] * (len(n) + 1)
        if min(like_vals) != 0:
            r[0] = min(like_vals)
        else:
            r[0] = min([like_val for like_val in like_vals if like_val != 0])

        for j in range(1, len(n) + 1):
            r[j] = min(like_vals)
        break

newr = ""
for _r in r:
    newr += str(_r)
newr = int(newr)
print(newr)
Buggy python submission (verdict: Runtime Error):
H, W, A, B = (int(i) for i in input().split())

#H, W, A, B = (10, 7, 3, 4)
#H, W, A, B = (2, 3, 1, 1)

def mycomb(n, k):
    return factorials[n] / (factorials[k] * factorials[n - k])

MOD = int(1e9 + 7)

factorials = []
factorials.append(1)
for i in range(1, W + H):
    factorials.append(factorials[i - 1] * i)

r = 0
for i in range(H - A):
    combination = mycomb(B-1+i, B-1) * mycomb(W+H-B-i-2, W-B-1)
    r += int(combination % MOD)

print(r)

Fixed submission:
H, W, A, B = (int(i) for i in input().split())

#H, W, A, B = (10, 7, 3, 4)
#H, W, A, B = (2, 3, 1, 1)

def mycomb(n,r):
    return (factorials[n] * pow(factorials[r],MOD-2,MOD) % MOD) * pow(factorials[n-r],MOD-2,MOD) % MOD

MOD = int(1e9 + 7)

factorials = []
factorials.append(1)
for i in range(1, W + H):
    factorials.append((factorials[i - 1] * i) % MOD)

r = 0
for i in range(H - A):
    combination = mycomb(B-1+i, B-1) * mycomb(W+H-B-i-2, W-B-1)
    r += int(combination)

print(r%MOD)

Buggy python submission (verdict: Runtime Error):
H, W, A, B = (int(i) for i in input().split())

#H, W, A, B = (10, 7, 3, 4)
#H, W, A, B = (2, 3, 1, 1)

def mycomb(n, k):
    return factorials[n] / (factorials[k] * factorials[n - k])

MOD = int(1e9 + 7)

factorials = []
factorials.append(1)
for i in range(1, W + H):
    factorials.append(factorials[i - 1] * i)

r = 0
for i in range(H - A):
    combination = mycomb(B-1+i, B-1) * mycomb(W+H-B-i-2, W-B-1)
    r += combination % MOD

print(r)

Fixed submission:
H, W, A, B = (int(i) for i in input().split())

#H, W, A, B = (10, 7, 3, 4)
#H, W, A, B = (2, 3, 1, 1)

def mycomb(n,r):
    return (factorials[n] * pow(factorials[r],MOD-2,MOD) % MOD) * pow(factorials[n-r],MOD-2,MOD) % MOD

MOD = int(1e9 + 7)

factorials = []
factorials.append(1)
for i in range(1, W + H):
    factorials.append((factorials[i - 1] * i) % MOD)

r = 0
for i in range(H - A):
    combination = mycomb(B-1+i, B-1) * mycomb(W+H-B-i-2, W-B-1)
    r += int(combination)

print(r%MOD)
Buggy python submission (verdict: Runtime Error):
N=int(input())

if (N%4)==0:
    print("Yes")
    break
elif(N%7)==0:
    print("Yes")
    break
elif(N%11)==0:
    print("Yes")
    break
while N>0:
    i=1
    N=N-11*i
    if(N%4)==0 or (N%7)==0:
        print("Yes")
        break
    i=i+1
else:
    print("No")

Fixed submission:
N=int(input())

if (N%4)==0:
    print("Yes")
elif(N%7)==0:
    print("Yes")
elif(N%11)==0:
    print("Yes")
elif(1):
    while N>0:
        i=1
        N=N-11*i
        if(N<0):
            print("No")
            break
        if(N%4)==0 or (N%7)==0:
            print("Yes")
            break
        i=i+1
Buggy python submission (verdict: Runtime Error):
t=list(input())

if t[0]=="A" and not t[1]=="C" and not t[-1]=="C":
    rs=1
else:
    rs=0

if t[1].isupper()==True or t[-1].isupper()==True:
    rs -=1

del t[:2]
del t[-1]

if not t.count("C")==1:
    rs -=1

if rs==1:
    t.remove("C")

for i in t:
    if i.isupper()==True:
        rs -=1

if rs==1:
    print("AC")
else:
    print("WA")


Fixed submission:
t=int(input())

if t<1200:
    print("ABC")
elif t<2800:
    print("ARC")
else:
    print("AGC")

Buggy python submission (verdict: Runtime Error):
t=list(input())

if t[0]=="A" and not t[1]=="C" and not t[-1]=="C":
    rs=1
else:
    rs=0

if t[1].isupper==True or t[-1].isupper==True:
    rs -=1

del t[:2]
del t[-1]

if not t.count("C")==1:
    rs -=1

if rs==1:
    t.remove("C")

for i in t:
    if i.isupper()==True:
        rs -=1

if rs==1:
    print("AC")
else:
    print("WA")


Fixed submission:
t=int(input())

if t<1200:
    print("ABC")
elif t<2800:
    print("ARC")
else:
    print("AGC")

Buggy python submission (verdict: Runtime Error):
t=list(input())

if t[0]=="A" and not t[1]=="C" and not t[-1]=="C" and t[-1].islower==True and t[1].islower==True:
    rs=1
else:
    rs=0

del t[:2]
del t[-1]

if not t.count("C")==1:
    rs -=1

if rs==1:
    t.remove("C")

for i in t:
    if i.isupper()==True:
        rs -=1

if rs==1:
    print("AC")
else:
    print("WA")

Fixed submission:
t=int(input())

if t<1200:
    print("ABC")
elif t<2800:
    print("ARC")
else:
    print("AGC")
Buggy python submission (verdict: Runtime Error):
N,X = list(map(int,input().split()))
M = [int(input()) for i in range(N)]
diff  = X - sum(M)
print(N+diff//min(M))


Fixed submission:
S = str(input())
count = S.count('o')

print(700 + count*100)

Buggy python submission (verdict: Runtime Error):

N, X = map(int, input().split())
m = [int(input()) for i in range(1, N+1)]

diff = X - sum(m)
print(N+(diff//min(m)))


Fixed submission:
S = str(input())
count = S.count('o')

print(700 + count*100)

Buggy python submission (verdict: Runtime Error):

N, X = map(int, input().split())
m = [int(input()) for i in range(N)]

diff = X - sum(m)
print(N+(diff//min(m)))


Fixed submission:
S = str(input())
count = S.count('o')

print(700 + count*100)

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

N, X = map(int, input().split())
m = [int(input()) for i in range(1, N+1)]

diff = X - sum(m)
print(math.floor(N+(diff/min(m))))


Fixed submission:
S = str(input())
count = S.count('o')

print(700 + count*100)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
count = 0

for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if S == x+y+z:
                count += 1

print(count)


Fixed submission:
K, S = map(int, input().split())
count = 0

for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if 0 <= z <= K:
            count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
A, B, C, X, Y = map(int, input().split())

min_sum = int(float('inf'))
for c in range(0, 200000+2, 2):
    print(c)
    sum = C*c
    if X - c/2 > 0:
        sum += A * (X - c/2)
    if Y - c/2 > 0:
        sum += B * (Y - c/2)
    if sum < min_sum:
        min_sum = sum
print(min_sum)

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

res = a*x + b*y # 条件を満たす買い方のうちABピザの枚数(*2)を全探索する。ABピザを一切買わない場合を一旦答えにする（これを大きい値にして、for ループを0からにしてもよい）
for i in range(1, max(x, y)+1): # 全部ABピザでまかなう時は x,yの内多い方分買うことになる
    ab = i*2 # ABピザを買う枚数奇数枚買うことはないので2倍
    cand = ab*c + a*max(0, x-i) + b*max(0, y-i) # i枚分はABピザになるので-i 負の値にはならない（あまりになる）ので0とのmaxをとる

    res = min(res, cand) # 候補との最小値を保持

print(res)

Buggy python submission (verdict: Runtime Error):
ll A, B, C, X, Y;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> A >> B >> C >> X >> Y;
    
    ll ans = infl;
    rep(ab, 0, 201010) {
        ll sm = C * ab;
 
        ll x = X - ab / 2;
        ll y = Y - ab / 2;
 
        if (0 < x) sm += x * A;
        if (0 < y) sm += y * B;
 
        chmin(ans, sm);
    }
 
    cout << ans << endl;
}

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

res = a*x + b*y # 条件を満たす買い方のうちABピザの枚数(*2)を全探索する。ABピザを一切買わない場合を一旦答えにする（これを大きい値にして、for ループを0からにしてもよい）
for i in range(1, max(x, y)+1): # 全部ABピザでまかなう時は x,yの内多い方分買うことになる
    ab = i*2 # ABピザを買う枚数奇数枚買うことはないので2倍
    cand = ab*c + a*max(0, x-i) + b*max(0, y-i) # i枚分はABピザになるので-i 負の値にはならない（あまりになる）ので0とのmaxをとる

    res = min(res, cand) # 候補との最小値を保持

print(res)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, C, X, Y = map(int, input().split())

min_sum = 9999999999
for a in range(X+1):
    for b in range(Y+1):
        c = max(X-a, Y-b)
        sum = A*a + B*b + 2*C*c
        if sum<min_sum:
            min_sum=sum
print(min_sum)

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

res = a*x + b*y # 条件を満たす買い方のうちABピザの枚数(*2)を全探索する。ABピザを一切買わない場合を一旦答えにする（これを大きい値にして、for ループを0からにしてもよい）
for i in range(1, max(x, y)+1): # 全部ABピザでまかなう時は x,yの内多い方分買うことになる
    ab = i*2 # ABピザを買う枚数奇数枚買うことはないので2倍
    cand = ab*c + a*max(0, x-i) + b*max(0, y-i) # i枚分はABピザになるので-i 負の値にはならない（あまりになる）ので0とのmaxをとる

    res = min(res, cand) # 候補との最小値を保持

print(res)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

Alice = 0
Bob = 0
while len(A)>0:
    Alice += max(A)
    A.remove(max(A))
    Bob += max(A)
    A.remove(max(A))
print(Alice - Bob)

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

Alice = 0
Bob = 0
A.sort(reverse=True)
Alice += sum(A[::2])
Bob += sum(A[1::2])
print(Alice - Bob)

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

Alice = 0
Bob = 0
while len(A)>0:
    Alice += max(A)
    A.remove(max(A))
    Bob += max(A)
    A.remove(max(A))
print(Alice - Bob)

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

Alice = 0
Bob = 0
A.sort(reverse=True)
Alice += sum(A[::2])
Bob += sum(A[1::2])
print(Alice - Bob)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

cnt=0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x+y+z == S:
                cnt += 1
print(cnt)

Fixed submission:
K, S = map(int, input().split())

cnt=0
for x in range(K+1):
    for y in range(K+1):
        z = S-x-y
        if 0<=z<=K:
            cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

cnt=0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x+y+z == S:
                cnt += 1
print(cnt)

Fixed submission:
K, S = map(int, input().split())

cnt=0
for x in range(K+1):
    for y in range(K+1):
        z = S-x-y
        if 0<=z<=K:
            cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
N,M = input().split()

if N%M ==0:
    print(0)
else:
    print(1)

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

if N%M == 0:
    print(0)
else:
    print(1)
Buggy python submission (verdict: Runtime Error):
a,b,c=(str(x) for x in input().split())
d,e,f=(str(x) for x in input().split())
g,h,i=(str(x) for x in input().split())

print(a + e + i)


Fixed submission:
f = list(input())
s = list(input())
t = list(input())

a = [f[i: i+1] for i in range(0, len(f), 1)]
b = [s[i: i+1] for i in range(0, len(s), 1)]
c = [t[i: i+1] for i in range(0, len(t), 1)]
d = ''.join(a[0] + b[1] + c[2])
print(d)

Buggy python submission (verdict: Runtime Error):
a,b,c=(str(x) for x in input().split())
d,e,f=(str(x) for x in input().split())
g,h,i=(str(x) for x in input().split())

print(a + e + i)


Fixed submission:
f = list(input())
s = list(input())
t = list(input())

a = [f[i: i+1] for i in range(0, len(f), 1)]
b = [s[i: i+1] for i in range(0, len(s), 1)]
c = [t[i: i+1] for i in range(0, len(t), 1)]
d = ''.join(a[0] + b[1] + c[2])
print(d)
Buggy python submission (verdict: Runtime Error):
mport numpy as np

l = input().split()
l = list(map(int, l))

mean    = np.mean(l)
integer = int(mean) # 切り捨て                                                                                     
decimal = mean - integer

j = decimal * 10

if j >= 5 :
    res = integer + 1
else :
    res = integer

print(res)

Fixed submission:
import numpy as np

l = input().split()
l = list(map(int, l))

mean    = np.mean(l)
integer = int(mean)
decimal = mean - integer

j = decimal * 10

if j >= 5 :
    res = integer + 1
else :
    res = integer

print(res)
Buggy python submission (verdict: Runtime Error):
l1 = input().split()
a, b = list(map(int, l1))

l2 = input().split()
l2 = list(map(int, l2))

l3 = sorted(l2)
sum = l3[-1] + l3[-2] + l3[-3]
print(sum)


Fixed submission:
l1 = input().split()
N, K = map(int, l1)
max  = K+1
l2 = input().split()
l2 = list(map(int, l2))

l3 = sorted(l2)
sum = 0


for i in range(1, max) :
    sum += l3[-i]

print(sum)
Buggy python submission (verdict: Time Limit Exceeded):

l     = input().split()
K, S  = map(int, l)
max   = K+1
sum   = 0
count = 0

#print('K= ', K)                                                                                                   
#print('S= ', S)                                                                                                   

for x in range(0, max):
    for y in range(0, max):
        for z in range(0, max):

            sum = x + y + z
            if sum == S:
                count +=1

print(count)


Fixed submission:
l     = input().split()
K, S  = map(int, l)
max   = K+1
count = 0
z     =	0

for x in range(0, max):
    for y in range(0, max):
            z = S - x - y
            if 0 <= z <= K :
                count +=1

print(count)
Buggy python submission (verdict: Runtime Error):
four_w = []
seven_w = []
cross = []

for i in range(0,100):
    if i % 4 == 0:
        four_w.append(i)
    elif i % 7 ==0:
        seven_w.append(i)

for four in four_w:
    for seven in seven_w:
        cross.append(four + seven)

n = int(input())

if n in cross:
    print("Yes")
elif n in seve_w:
    print("Yes")
elif n in four_w:
    print("yes")
else:
    print("No")

Fixed submission:
four_w = []
seven_w = []
cross = []

for i in range(1,101):
    if i % 4 == 0:
        four_w.append(i)
    elif i % 7 ==0:
        seven_w.append(i)

for four in four_w:
    for seven in seven_w:
        cross.append(four + seven)

n = int(input())

if n in cross:
    print("Yes")
elif n in seven_w:
    print("Yes")
elif n in four_w:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
four_w = []
seven_w = []
cross = []

for i in range(1,100):
    if i % 4 == 0:
        four_w.append(i)
    elif i % 7 ==0:
        seven_w.append(i)

for four in four_w:
    for seven in seven_w:
        cross.append(four + seven)

n = int(input())

if n in four_w,seven_w,cross:
    print("Yes")
else:
    print("No")

Fixed submission:
four_w = []
seven_w = []
cross = []

for i in range(1,101):
    if i % 4 == 0:
        four_w.append(i)
    elif i % 7 ==0:
        seven_w.append(i)

for four in four_w:
    for seven in seven_w:
        cross.append(four + seven)

n = int(input())

if n in cross:
    print("Yes")
elif n in seven_w:
    print("Yes")
elif n in four_w:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
from math import gcd, gcd
n = int(input())
print(2*n // gcd(2,n))

Fixed submission:
n = int(input())
print(n if n%2 == 0 else n*2)

Buggy python submission (verdict: Runtime Error):
from math import gcd, gcd
n = int(input())
print(2*n // gcd(2,n))

Fixed submission:
n = int(input())
print(n if n%2 == 0 else n*2)
Buggy python submission (verdict: Runtime Error):
input;n=list(map(itn,input().split()))
print(max(n) - min(n))

Fixed submission:
input();n=list(map(int,input().split()))
print(max(n) - min(n))
Buggy python submission (verdict: Runtime Error):
mod=N%K
if(mod !=0):
	print(1)
else:
  print(0)

Fixed submission:
N, K = map(int, input().split())
mod=N%K

if(mod !=0):
    print(1)
else:
    print(0)