Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S = [i for i in input()]

def henkan(a):
    if a == "0":
        a = "1"
    else:
        a = "0"
    return a
    
ans = 0
a = 0
for i in range(len(S)-1):
    if S[i] == S[i+1]:
        a = henkan(S[i+1])
        ans += 1
        print("a", a)
        S[i+1] = a
        print(S)
print(ans)

Fixed submission:
S = [i for i in input()]

def henkan(a):
    if a == "0":
        a = "1"
    else:
        a = "0"
    return a
    
ans = 0
a = 0
for i in range(len(S)-1):
    if S[i] == S[i+1]:
        a = henkan(S[i+1])
        ans += 1
        S[i+1] = a
print(ans)
Buggy python submission (verdict: Runtime Error):
list1 = []
list2 = []
for _ in range(3):
    list1.append(input().split())

for num, li_con in enumerate(list1):
    list2.append(li_con[num])

moji = "".join(list2)
print(moji)

Fixed submission:
list1 = []
list2 = []
for _ in range(3):
    list1.append(input())

for num, li_con in enumerate(list1):
    list2.append(li_con[num])

moji = "".join(list2)
print(moji)
Buggy python submission (verdict: Runtime Error):
lst = input().split()
X = int(lst[0])
Y = int(lst[1])
A = int(lst[2])
B = int(lst[3])
C = int(lst[4])

p_list = [int(num) for num in input().split(" ")]
q_list = [int(num) for num in input().split(" ")]
r_list = [int(num) for num in input().split(" ")]

sort_p = sorted(p_list,reverse = True)[:X]
sort_q = sorted(q_list,reverse = True)[:Y]
sort_r = sorted(r_list,reverse = True)[:X+Y]

max_score = 0

for i in range(X+Y):
    if len(sort_p) ==0:
        if sort_q[0] >= sort_r[0]:
            max_score += sort_q[0]
            sort_q = sort_q[1:]
        else:
            max_score += sort_r[0]
            sort_r = sort_r[1:]
            sort_q.pop()
    elif len(sort_q) ==0:
        if sort_p[0] >= sort_r[0]:
            max_score += sort_p[0]
            sort_p = sort_p[1:]
        else:
            max_score += sort_r[0]
            sort_r = sort_r[1:]
            sort_p.pop()

    else:
        if sort_p[0] >= sort_q[0] and sort_p[0] >= sort_r[0]:
            max_score += sort_p[0]
            sort_p = sort_p[1:]
        elif sort_p[0] >= sort_r[0]:
            max_score += sort_q[0]
            sort_q = sort_q[1:]
        else:
            max_score += sort_r[0]
            sort_r = sort_r[1:]
            if sort_p[-1] < sort_q[-1]:
                sort_p.pop()
            else :
                sort_q.pop()
print(max_score)


Fixed submission:
lst = input().split()
X = int(lst[0])
Y = int(lst[1])
A = int(lst[2])
B = int(lst[3])
C = int(lst[4])

p_list = [int(num) for num in input().split(" ")]
q_list = [int(num) for num in input().split(" ")]
r_list = [int(num) for num in input().split(" ")]

sort_p = sorted(p_list,reverse = True)[:X]
sort_q = sorted(q_list,reverse = True)[:Y]
sort_r = sorted(r_list,reverse = True)[:X+Y]

max_score = 0
sort_p.extend(sort_q)
sort_p.extend(sort_r)
sort_p.sort(reverse = True)
for i in range(X+Y):
    max_score += sort_p[i]

print(max_score)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
Q = int(input())
q_list = []
for i in range(Q):
    q_list.append(input().split(" "))
    if q_list[i][0] == "1":
        S = S[::-1]
    elif q_list[i][1] == "1":
        S = q_list[i][2] + S
    else :
        S = S + q_list[i][2]
print(S)


Fixed submission:
S = input()
Q = int(input())
top_str = ""
last_str = ""
s_parity = 0
for i in range(Q):
    q_list=input().split(" ")
    if q_list[0] == "1":
        s_parity += 1
    elif (s_parity%2) == 0:
        if q_list[1] == "1":
            top_str = q_list[2] + top_str
        else:
            last_str = last_str + q_list[2]
    else:
        if  q_list[1] == "1":
            last_str = last_str + q_list[2]
        else:
            top_str = q_list[2] + top_str


if s_parity % 2 ==1:
    S = S[::-1]
    S = last_str[::-1] + S + top_str[::-1]
else :
    S = top_str + S + last_str
print(S)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

MAX_DIS = 10**10
N,M,R = map(int,input().split(" "))
r_list = list(map(int,input().split(" ")))
roads = [[MAX_DIS]*N for i in range(N)]
for i in range(N):
    roads[i][i] = 0
for i in range(M):
    A,B,C = map(int,input().split(" "))
    roads[A-1][B-1] = C
    roads[B-1][A-1] = C
for k in range(N):
    for i in range(N):
        for j in range(N):
            roads[i][j] = min(roads[i][j],roads[i][k]+roads[k][j])
min_dis = MAX_DIS
for directions in itertools.permutations(r_list):
    distance  = 0
    for dir in range(1,len(directions)):
        distance += roads[directions[dir-1]-1][directions[dir]-1]
    if distance < min_dis:
        min_dis =distance
print(min_dis)


Fixed submission:
import itertools

MAX_DIS = 10**10
N,M,R = map(int,input().split(" "))
r_list = list(map(int,input().split(" ")))
roads = [[MAX_DIS]*N for i in range(N)]
for i in range(N):
    roads[i][i] = 0
for i in range(M):
    A,B,C = map(int,input().split(" "))
    roads[A-1][B-1] = C
    roads[B-1][A-1] = C
for k in range(N):
    for i in range(N):
        for j in range(N):
            roads[i][j] = min(roads[i][j],roads[i][k]+roads[k][j])
min_dis = MAX_DIS
for directions in itertools.permutations(r_list):
    distance  = 0
    for dir in range(1,len(directions)):
        distance += roads[directions[dir-1]-1][directions[dir]-1]
    if distance < min_dis:
        min_dis =distance
print(min_dis)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

MAX_DIS = 10**10
N,M,R = map(int,input().split(" "))
r_list = list(map(int,input().split(" ")))
roads = [[MAX_DIS for i in range(N)] for i in range(N)]
for i in range(N):
    roads[i][i] = 0
for i in range(M):
    A,B,C = map(int,input().split(" "))
    roads[A-1][B-1] = C
    roads[B-1][A-1] = C
for i in range(N):
    for j in range(N):
        for k in range(N):
            roads[i][j] = min(roads[i][j],roads[i][k]+roads[k][j])
min_dis = MAX_DIS
for directions in itertools.permutations(r_list):
    distance  = 0
    for dir in range(1,len(directions)):
        distance += roads[directions[dir-1]-1][directions[dir]-1]
    if distance < min_dis:
        min_dis =distance
print(min_dis)


Fixed submission:
import itertools

MAX_DIS = 10**10
N,M,R = map(int,input().split(" "))
r_list = list(map(int,input().split(" ")))
roads = [[MAX_DIS]*N for i in range(N)]
for i in range(N):
    roads[i][i] = 0
for i in range(M):
    A,B,C = map(int,input().split(" "))
    roads[A-1][B-1] = C
    roads[B-1][A-1] = C
for k in range(N):
    for i in range(N):
        for j in range(N):
            roads[i][j] = min(roads[i][j],roads[i][k]+roads[k][j])
min_dis = MAX_DIS
for directions in itertools.permutations(r_list):
    distance  = 0
    for dir in range(1,len(directions)):
        distance += roads[directions[dir-1]-1][directions[dir]-1]
    if distance < min_dis:
        min_dis =distance
print(min_dis)
Buggy python submission (verdict: Runtime Error):
import numpy as np

N,M = map(int,input().split())
A = sorted(list(map(int,input().split())))
for i in range(M):
  A[-1] = A[-1]/2
  if len(A) == 1:
    continue
  elif A[-1] < A[-2]:    
    A = sorted(A)
A = np.array(A)
A = np.floor(A)
print(int(np.sum(A)))


Fixed submission:
s = input()
if s == "Rainy":
  print("Sunny")
elif s == "Sunny":
  print("Cloudy")
else:
  print("Rainy")

Buggy python submission (verdict: Runtime Error):
s = input()
if s == "Rainy":
  print("Sunny")
elif s == "Sunny":
  prin("Cloudy")
else
print("Rainy")


Fixed submission:
s = input()
if s == "Rainy":
  print("Sunny")
elif s == "Sunny":
  print("Cloudy")
else:
  print("Rainy")
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = list(map(int, input().split()))

p_list = [1]
ne_p = a[0]
for _ in range(k):
    p_list.append(ne_p)
    ne_p = a[ne_p-1]
    if ne_p in p_list:
        ind = p_list.index(ne_p)
        break
k = k - ind
print(p_list[ind + k%(len(p_list)-ind)])

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

    p_bool = [False] * n
    ne_p = 1
    p_bool[ne_p-1] = True
    step = 0
    for i in range(n):
        ne_p = a[ne_p-1]
        step += 1
        if p_bool[ne_p-1]:
            break
        else:
            p_bool[ne_p-1] = True
        if step == k:
            print(ne_p)
            sys.exit()
    
    p_list = []
    sta = ne_p
    for i in range(n):
        ne_p = a[ne_p-1]
        step += 1
        p_list.append(ne_p)
        if ne_p == sta:
            break
        if step == k:
            print(ne_p)
            sys.exit()

    len_l = len(p_list)
    left = k-step
    left -= (left//len_l) * len_l
    print(p_list[left-1])
    # p_list = [1]
    # ne_p = a[0]
    # p_bool = [False] * n
    # p_bool[0] = True
    # check = False
    # step = 0
    # for _ in range(n):
    #     p_bool[ne_p-1] = True
    #     p_list.append(ne_p)
    #     step = 0
    #     if step == k:
    #         #print(ne_p)
    #         sys.exit()
    #     ne_p = a[ne_p-1]
    #     # if ne_p in p_list:
    #     #     ind = p_list.index(ne_p)
    #     #     break
    #     if p_bool[ne_p-1]:
    #         check = True
    #         break
        
    # #print(p_list)
    # #print(p_bool)
    # if check:
    #     ind = p_list.index(ne_p)
    # else:
    #     ind = 0
    # k = k - ind
    # #print(ind)
    # #print(k)
    # #print(p_list)
    # #print(k%(len(p_list)-ind))
    # print(p_list[ind + k%(len(p_list)-ind)])

solve()
Buggy python submission (verdict: Runtime Error):
x = int(input())
b_p = 0
b_m = 0

def div(n):
    divs = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divs.append(i)
            if i != n // i:
                divs.append(n//i)
    divs
    divs += list(map(lambda x: x*(-1), divs))
    return divs

divs = div(x)
while True:  
    for i in divs:
        a_p = i + b_p
        a_m = i + b_m
        if a_p ** 5 == x + b_p ** 5:
            print(a_p, b_p)
            exit(1)
        if a_m ** 5 == x + b_m ** 5:
            print(a_m, b_m)
            exit(1)
    b_p += 1
    b_m -= 1

Fixed submission:
import sys

x = int(input())
b_p = 0
b_m = 0

def div(n):
    divs = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divs.append(i)
            if i != n // i:
                divs.append(n//i)
    divs
    divs += list(map(lambda x: x*(-1), divs))
    return divs

divs = div(x)
while True:  
    for i in divs:
        a_p = i + b_p
        a_m = i + b_m
        if a_p ** 5 == x + b_p ** 5:
            print(a_p, b_p)
            sys.exit()
        if a_m ** 5 == x + b_m ** 5:
            print(a_m, b_m)
            sys.exit()
    b_p += 1
    b_m -= 1
Buggy python submission (verdict: Time Limit Exceeded):
import itertools 
n = int(input())
a = list(map(int, input().split()))
a_list = [[j, i] for i, j in enumerate(a)]
#a_list.sort(reverse=True)
pairs = list(itertools.combinations(a_list, 2))
#print(pairs)
ans = 0
for pair in pairs:
    if pair[0][0] + pair[1][0] >= n:
        continue
    elif pair[0][1] == pair[1][1]:
        continue
    elif abs(pair[0][1]-pair[1][1]) == (pair[0][0]+pair[1][0]):
        ans += 1

"""
pairs = list(itertools.combinations(range(n), 2))
print(pairs)
ans = 0
for pair in pairs:
    if abs(pair[0]-pair[1]) == (a[pair[0]]+a[pair[1]]):
        ans += 1
"""

print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
add_dic = {}
sub_dic = {}

for i in range(n):
    add_tmp = i + a[i]
    sub_tmp = i - a[i]
    if not add_tmp in add_dic.keys():
        add_dic[add_tmp] = 1
    else:
        add_dic[add_tmp] += 1
    if not sub_tmp in sub_dic.keys():
        sub_dic[sub_tmp] = 1
    else:
        sub_dic[sub_tmp] += 1

ans = 0
for k, v in add_dic.items():
    if k in sub_dic.keys():
        ans += v * sub_dic[k]
print(ans)

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

pairs = list(itertools.combinations(range(n), 2))
ans = 0
for pair in pairs:
    if abs(pair[0]-pair[1]) == (a[pair[0]]+a[pair[1]]):
        ans += 1

print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
add_dic = {}
sub_dic = {}

for i in range(n):
    add_tmp = i + a[i]
    sub_tmp = i - a[i]
    if not add_tmp in add_dic.keys():
        add_dic[add_tmp] = 1
    else:
        add_dic[add_tmp] += 1
    if not sub_tmp in sub_dic.keys():
        sub_dic[sub_tmp] = 1
    else:
        sub_dic[sub_tmp] += 1

ans = 0
for k, v in add_dic.items():
    if k in sub_dic.keys():
        ans += v * sub_dic[k]
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

n, a, b, c = map(int, input().split())
S = [input() for _ in range(n)]


abc = {"A": a, "B": b, "C": c}
ans = []
for i, s in enumerate(S):
    u, v = s[0], s[1]
    if abc[u] == abc[v] == 0:
        print("No")
        sys.exit()
    elif abc[u] > abc[v]:
        abc[u] -= 1
        abc[v] += 1
        ans.append(v)
    elif abc[u] < abc[v]:
        abc[u] += 1
        abc[v] -= 1
        ans.append(u)
    else:
        if u in S[i+1]:
            abc[u] += 1
            abc[v] -= 1
            ans.append(u)
        elif v in S[i+1]:
            abc[v] += 1
            abc[u] -= 1
            ans.append(v)
print("Yes")
for ans_ in ans: print(ans_)

Fixed submission:
import sys

n, a, b, c = map(int, input().split())
S = [input() for _ in range(n)]


abc = {"A": a, "B": b, "C": c}
ans = []
for i, s in enumerate(S):
    u, v = s[0], s[1]
    if abc[u] == abc[v] == 0:
        print("No")
        sys.exit()
    elif abc[u] > abc[v]:
        abc[u] -= 1
        abc[v] += 1
        ans.append(v)
    elif abc[u] < abc[v]:
        abc[u] += 1
        abc[v] -= 1
        ans.append(u)
    elif i == n-1:
        ans.append(u)
    else:
        if u in S[i+1]:
            abc[u] += 1
            abc[v] -= 1
            ans.append(u)
        elif v in S[i+1]:
            abc[v] += 1
            abc[u] -= 1
            ans.append(v)
print("Yes")
for ans_ in ans: print(ans_)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, n = map(int, input().split())
max_int = 0
if a != b:
    if n < b:
        max_int = int((a*n)/b) -a * int(n/b)
    else:
        #for i in range(n, n-max(int(b/a), int(a/b), int(a%b), int(b%a))-1, -1):
        for i in range(1, n):
            tmp = int((a*i)/b) -a * int(i/b)

            #print(i)
            #print(tmp)
            if max_int < tmp:
                max_int = tmp

print(max_int)

Fixed submission:
a, b, n = map(int, input().split())
i = min(b-1, n)
print(int((a*i)/b) -a * int(i/b))

Buggy python submission (verdict: Runtime Error):
a, b, n = map(int, input().split())
max_int = 0
if a != b:
    if n < b:
        max_int = int((a*n)/b) -a * int(n/b)
    else:
        #for i in range(n, n-max(int(b/a), int(a/b), int(a%b), int(b%a))-1, -1):
        for i in range(i, n):
            tmp = int((a*i)/b) -a * int(i/b)

            #print(i)
            #print(tmp)
            if max_int < tmp:
                max_int = tmp

print(max_int)

Fixed submission:
a, b, n = map(int, input().split())
i = min(b-1, n)
print(int((a*i)/b) -a * int(i/b))
Buggy python submission (verdict: Time Limit Exceeded):
# TLEになる愚直コードなはず

import itertools
 
n, k = map(int, input().split())
arr = [i for i in range(n+1)]
 
a = 0
for i in range((n+1)-(k-1)):
    tmp = set()
    for group in itertools.combinations(arr, i+k):
        tmp.add(sum(group))
    #print(tmp)
    a += len(tmp)
 
print(a)

Fixed submission:
import numpy as np

n, k = map(int, input().split())
ans = 0
mod = 10 ** 9 + 7
arr = np.arange(n+1)
a = np.cumsum(arr)
b = np.cumsum(arr[::-1])

for i in range(k, n+1+1):
    ans += b[i-1] - a[i-1] + 1
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
ans = 0
mod = 10 ** 9 + 7

for i in range((n+1)-(k-1)):
    mini = sum(range(0, i+k))
    maxi = sum(range(n, n-k-i, -1))
    ans += maxi - mini +1
print(ans%mod)

Fixed submission:
import numpy as np

n, k = map(int, input().split())
ans = 0
mod = 10 ** 9 + 7
arr = np.arange(n+1)
a = np.cumsum(arr)
b = np.cumsum(arr[::-1])

for i in range(k, n+1+1):
    ans += b[i-1] - a[i-1] + 1
print(ans%mod)
Buggy python submission (verdict: Time Limit Exceeded):
import math

k = int(input())

sum = 0
for a in range(1, k+1):
    for b in range(1, k+1):
        for c in range(1, k+1):
            ans = math.gcd(a, b)
            ans = math.gcd(ans, c)
            sum += ans
print(sum)
            

Fixed submission:

import math

k = int(input())
ans = 0
for a in range(1, k+1):
    for b in range(1, k+1):
        ab = math.gcd(a, b)
        if ab == 1:
            ans += k
            continue
        for c in range(1, k+1):
            ans += math.gcd(ab,c)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
pre = n

while(abs(n-k) <= abs(pre-k)):
    if n % k == 0:
        n = 0
        break
    pre = n
    n = abs(n-k)

print(n)

Fixed submission:
n, k = map(int, input().split())
rem = n % k

print(min(rem, abs(rem-k)))
Buggy python submission (verdict: Runtime Error):
from collections import deque

k = int(input())
a = deque(range(1, 10))
cnt = 0

for i in range(k):
    x = a.popleft()
    mod = x % 10
    if mod != 0:
        a.append(x*10 + mod -1)
    a.append(x * 10 + mod)
    if mod != 9:
        a.append(x*10 + mod + 1)
    print(a)

print(x)

Fixed submission:
from collections import deque

k = int(input())
a = deque(range(1, 10))

for i in range(k):
    x = a.popleft()
    mod = x % 10
    if mod != 0:
        a.append(x*10 + mod -1)
    a.append(x * 10 + mod)
    if mod != 9:
        a.append(x*10 + mod + 1)

print(x)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(input())

cnt = []
for i in range(n):
    cnt.append(0)
    for j in range(i):
        if s[j] == 'W':
            cnt[i] += 1
    for j in range(i+1, n):
        if s[j] == 'E':
            cnt[i] += 1
print(min(cnt))

Fixed submission:
n = int(input())
s = list(input())

l = [0]
r = [0]
l_cnt = 0
r_cnt = 0
for i in range(n-1):
    if s[i] == 'W':
        l_cnt += 1
    if s[n-i-1] == 'E':
        r_cnt += 1
    l.append(l_cnt)
    r.append(r_cnt)
print(min(l[i]+r[n-i-1] for i in range(n)))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(input())

cnt = []
for i in range(n):
    cnt.append(0)
    for j in range(n):
        if i < j:
            if s[j] == 'E':
                cnt[i] += 1
        elif i > j:
            if s[j] == 'W':
                cnt[i] += 1

print(min(cnt))

Fixed submission:
n = int(input())
s = list(input())

l = [0]
r = [0]
l_cnt = 0
r_cnt = 0
for i in range(n-1):
    if s[i] == 'W':
        l_cnt += 1
    if s[n-i-1] == 'E':
        r_cnt += 1
    l.append(l_cnt)
    r.append(r_cnt)
print(min(l[i]+r[n-i-1] for i in range(n)))
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):
            if 0 <= s-(x+y) < k+1:
                cnt +=1

print(cnt)
Buggy python submission (verdict: Runtime Error):
import collections
n = int(input())
v = list(map(int,input().split()))
odd = collections.Counter(v[0::2]).most_common()
even = collections.Counter(v[1::2]).most_common()
if odd[0][0] != even[0][0]:
    print(n - odd[0][1] - even[0][1])
elif len(odd) == 1:
    print(n - even[1][1])
elif len(even) == 1:
    print(n - odd[1][1])
else:
    print(n - max(odd[0][1] + even[1][1], odd[1][1] + even[0][1]))

Fixed submission:
import collections
n = int(input())
v = list(map(int,input().split()))
odd = collections.Counter(v[0::2]).most_common()
even = collections.Counter(v[1::2]).most_common()
odd.append((0, 0))
even.append((0, 0))
if odd[0][0] != even[0][0]:
    print(n - odd[0][1] - even[0][1])
else:
    print(n - max(odd[0][1] + even[1][1], odd[1][1] + even[0][1]))

Buggy python submission (verdict: Runtime Error):
import collections
n = int(input())
v = list(map(int,input().split()))
odd = collections.Counter(v[0::2]).most_common()
even= collections.Counter(v[1::2]).most_common()
if odd[0][0] != even[0][0]:
    print(n - odd[0][1] - even[0][1])
else:
    print(n - max(odd[0][1] + even[1][1], odd[1][1] + even[0][1]))

Fixed submission:
import collections
n = int(input())
v = list(map(int,input().split()))
odd = collections.Counter(v[0::2]).most_common()
even = collections.Counter(v[1::2]).most_common()
odd.append((0, 0))
even.append((0, 0))
if odd[0][0] != even[0][0]:
    print(n - odd[0][1] - even[0][1])
else:
    print(n - max(odd[0][1] + even[1][1], odd[1][1] + even[0][1]))

Buggy python submission (verdict: Runtime Error):
import collections
n = int(input())
v = list(map(int,input().split()))
odd = collections.Counter(v[0::2]).most_common()
even= collections.Counter(v[1::2]).most_common()
if odd[0][0] != even[0][0]:
    print(n - odd[0][1] - even[0][1])
else:
    print(n - max(odd[0][0] + even[1][0], odd[1][0] + even[0][0]))

Fixed submission:
import collections
n = int(input())
v = list(map(int,input().split()))
odd = collections.Counter(v[0::2]).most_common()
even = collections.Counter(v[1::2]).most_common()
odd.append((0, 0))
even.append((0, 0))
if odd[0][0] != even[0][0]:
    print(n - odd[0][1] - even[0][1])
else:
    print(n - max(odd[0][1] + even[1][1], odd[1][1] + even[0][1]))
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
count = 0
for i in range(k+1):
    if i > s:
        break
    for l in range(i+1):
        if i + l > s:
            break
        for j in range(l+1):
            if i + j + l == s:
                if i == j and j == l:
                    count += 1
                elif i != j and i != l and j!= l:
                    count += 6
                else:
                    count += 3 
print(count) 


Fixed submission:
k, s = map(int, input().split())
count = 0
for i in range(k+1):
    for l in range(k+1):
        z = s - i - l
        if 0 <= z <= k:
            count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
count = 0
for i in range(k+1):
    for l in range(i+1):
        for j in range(l+1):
            if i + j + l == s:
                if i == j and j == l:
                    count += 1
                elif i != j and i != l and j!= l:
                    count += 6
                else:
                    count += 3 
print(count) 


Fixed submission:
k, s = map(int, input().split())
count = 0
for i in range(k+1):
    for l in range(k+1):
        z = s - i - l
        if 0 <= z <= k:
            count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
count = 0
for i in range(k+1):
    if i > s:
        break
    for l in range(k+1):
        if i + l > s:
            break
        for j in range(k+1):
            if i + j + l == s:
                count += 1
                break
print(count) 


Fixed submission:
k, s = map(int, input().split())
count = 0
for i in range(k+1):
    for l in range(k+1):
        z = s - i - l
        if 0 <= z <= k:
            count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
count = 0
for i in range(k+1):
    for l in range(k+1):
        for j in range(k+1):
            if i + j + l == s:
                count += 1
print(count) 


Fixed submission:
k, s = map(int, input().split())
count = 0
for i in range(k+1):
    for l in range(k+1):
        z = s - i - l
        if 0 <= z <= k:
            count += 1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s =[]
for i in range(n):
  str = input()
  if not str in s: 
    s.append(str)
print(len(s))


Fixed submission:
n = int(input())
s =[]
for i in range(n):
    s.append(input())
print(len(set(s)))

Buggy python submission (verdict: Runtime Error):
n = int(input())
s =[]
for i in range(n):
  	str = input()
    if not str in s: 
    	s.append(str)
    
print(len(s))

Fixed submission:
n = int(input())
s =[]
for i in range(n):
    s.append(input())
print(len(set(s)))