Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
k = int(input())
sub = set()
for i in range(0,len(s)):
    j = 1
    while i+j<=len(s):
        sub.add(s[i:i+j])
        j = j + 1
ans = list(sub)
ans.sort()
print(ans[k-1])

Fixed submission:
s = input()
k = int(input())
sub = set()
for i in range(0,len(s)):
    j = 1
    while i+j<=len(s) and j<=5:
        sub.add(s[i:i+j])
        j = j + 1
ans = list(sub)
ans.sort()
print(ans[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
k = int(input())
sub = set()
for i in range(0,len(s)):
    j = 1
    while i+j<=len(s):
        sub.add(s[i:i+j])
        j = j + 1
ans = list(sub)
ans.sort()
print(ans[k-1])

Fixed submission:
s = input()
k = int(input())
sub = set()
for i in range(0,len(s)):
    j = 1
    while i+j<=len(s) and j<=5:
        sub.add(s[i:i+j])
        j = j + 1
ans = list(sub)
ans.sort()
print(ans[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
k = int(input())
sub = []
for i in range(0,len(s)):
    j = 1
    while i+j<=len(s):
        if not s[i:i+j] in sub:
            sub.append(s[i:i+j])
        j = j + 1
sub.sort()
print(sub[k-1])

Fixed submission:
s = input()
k = int(input())
sub = set()
for i in range(0,len(s)):
    j = 1
    while i+j<=len(s) and j<=5:
        sub.add(s[i:i+j])
        j = j + 1
ans = list(sub)
ans.sort()
print(ans[k-1])
Buggy python submission (verdict: Runtime Error):
from statistics import median
n = int(input())
x = list(map(int,input().split()))
i1 = x.index(max(x))
i2 = x.index(min(x))
m1 = median(x[0:i1]+x[i1+1:n])
m2 = median(x[0:i2]+x[i2+1:n])
for i in range(n):
    if m2 == m1:
        print(m1)
    else:
        if x[i]<m2:
            print(m2)
        if x[i]>m1:
            print(m1)

Fixed submission:
import copy
n = int(input())
x = list(map(int,input().split()))
y = copy.copy(x)
y.sort()
m1 = y[n//2-1]
m2 = y[n//2]
for i in range(n):
    if m2 == m1:
        print(m1)
    else:
        if x[i]<m2:
            print(m2)
        if x[i]>m1:
            print(m1)
Buggy python submission (verdict: Runtime Error):
n, y = map(int,input().split())

ans = [-1,-1,-1]
for i in range(n,-1,-1):
    if i*10000 > y:
        continue
    else:
        yt = y-i*10000
        nt = n-i
        for j in range(min(yt//5000+1,nt+1)):
            yn = yt - j*5000
            nn = nt - j
            if nn*1000 == yn:
                ans = [i,j,nn]
                break
        if ans != [-1,-1,-1]:
            break
print(" ".join(ans))

Fixed submission:
n, y = map(int,input().split())

ans = [-1,-1,-1]
for i in range(n,-1,-1):
    if i*10000 > y:
        continue
    else:
        yt = y-i*10000
        nt = n-i
        for j in range(min(yt//5000+1,nt+1)):
            yn = yt - j*5000
            nn = nt - j
            if nn*1000 == yn:
                ans = [i,j,nn]
                break
        if ans != [-1,-1,-1]:
            break
ans = map(str,ans)
a = " ".join(ans)
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

ans = 0
c19 = 0
for i in range(1,100001):
    ca = a.count(i)
    if ca >= i:
        ans += ca - i
    else:
        ans += ca
    c19 += ca
print(ans + n-c19)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
d = {}
count = 0
for i in range(n):
    if not a[i] in d.keys() and (n-count)>=a[i]:
        ac = a.count(a[i])
        d.update({a[i]:ac})
        count += ac
ans = 0
for i in sorted(d.keys()):
    if i <= d[i]:
        ans += d[i]-i
    else:
        ans += d[i]

print(ans + n-count)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int,input().split())
a = list(map(int,input().split()))
d = []
c = []
for i in range(n):
    if not a[i] in d:
        d.append(a[i])
        c.append(a.count(a[i]))
c.sort(reverse=True)
print(n-sum(c[0:k]))


Fixed submission:
n, k = map(int,input().split())
a = list(map(int,input().split()))
d = {}
for i in a:
    if i in d:
        d[i] += 1
    else:
        d[i] = 1
c = sorted(d.items(),key = lambda x:x[1], reverse=True)
ans = 0
for i in range(min(k,len(c))):
    ans += c[i][1]

print(n-ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int,input().split())
a = list(map(int,input().split()))
d = []
c = []
for i in range(n):
    if not a[i] in d:
        d.append(a[i])
        c.append(a.count(a[i]))
c.sort()
print(sum(c[0:len(d)-k]))

Fixed submission:
n, k = map(int,input().split())
a = list(map(int,input().split()))
d = {}
for i in a:
    if i in d:
        d[i] += 1
    else:
        d[i] = 1
c = sorted(d.items(),key = lambda x:x[1], reverse=True)
ans = 0
for i in range(min(k,len(c))):
    ans += c[i][1]

print(n-ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = list(map(int,input().split()))
m = int(input())
t = list(map(int,input().split()))

ans = "YES"
for i in t:
    if d.count(i) < t.count(i):
        ans = "NO"
print(ans)


Fixed submission:
n = int(input())
d = list(map(int,input().split()))
m = int(input())
t = list(map(int,input().split()))

dd = {}
for i in range(n):
    if d[i] in dd:
        dd[d[i]] += 1
    else:
        dd[d[i]] = 1


ans = "YES"
for i in t:
    try:
        if dd[i] >= 1:
            dd[i] -= 1
        else:
            ans = "NO"
    except:
        ans="NO"
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = list(map(int,input().split()))
m = int(input())
t = list(map(int,input().split()))
s = set(t)
ans = "YES"
for i in s:
    if d.count(i) < t.count(i):
        ans = "NO"
print(ans)


Fixed submission:
n = int(input())
d = list(map(int,input().split()))
m = int(input())
t = list(map(int,input().split()))

dd = {}
for i in range(n):
    if d[i] in dd:
        dd[d[i]] += 1
    else:
        dd[d[i]] = 1


ans = "YES"
for i in t:
    try:
        if dd[i] >= 1:
            dd[i] -= 1
        else:
            ans = "NO"
    except:
        ans="NO"
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
d = {}
ans = []
for i in range(n):
    if a[i] in d.keys():
        d[a[i]] += 1
    else:
        d[a[i]] = 1
    if d[a[i]]==4:
      ans.append(a[i])
    elif d[a[i]]==2:
      ans.append(a[i])
    if len(ans)> 1:
      break
ans.append(0)
ans.append(0)
print(ans[0]*ans[1])

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
d = 0
ans = []
ap = 0
for i in range(n):
    if ap == a[i]:
        d += 1
        if d == 2:
            ans.append(a[i])
        elif d == 4:
            ans.append(a[i])
    else:
        d = 1
        ap = a[i]    
    if len(ans)> 1:
      break
ans.append(0)
ans.append(0)
print(ans[0]*ans[1])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
minxy = 1000000000000000000
for i in range(1,n):
    s1 = sum(a[0:i])
    s2 = sum(a[i:n])
    minxy = min(minxy,abs(s1-s2))
print(minxy)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
d = []
for i in range(1,n):
    if i == 1:
        d.append(sum(a[0:i])-sum(a[i:n]))
    else:
        d.append(d[-1]+2*a[i-1])
for i in range(len(d)):
    d[i] = abs(d[i])
print(min(d))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
b = []
for i in range(n):
    if i%2 == 0:
        b.append(a[i])
    else:
        b.insert(0,a[i])
if n%2 == 0:
    print(" ".join(list(map(str,b))))
else:
    c = []
    for i in range(n-1,-1,-1):
        c.append(b[i])
    print(" ".join(list(map(str,c))))


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
9753102468
na = n-1
if na%2 == 0:
    nl = na-1
    nr = na
else:
    nl = na
    nr = na-1

b = []
for i in range(nl,0,-2):
    b.append(i)
for i in range(0,nr+1,2):
    b.append(i)

ans = [0 for i in range(n)]
for i,k in enumerate(b):
    if n%2 == 0:
        ans[i] = a[k]
    else:
        ans[n-1-i] = a[k]
print(" ".join(list(map(str,ans))))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
s = []
for i in range(n):
    s.append(sum(a[0:i+1]))

count = 0
ans1 = 0
for i in range(n):
    if i%2 == 0:
        if s[i]+count > 0:
            continue
        else:
            ans1 += 1-(s[i]+count)
            count += 1-(s[i]+count)
    else:
        if s[i]+count < 0:
            continue
        else:
            ans1 += (s[i]+count) + 1
            count -= (s[i]+count) + 1
            
count1 = 0
ans2 = 0
for i in range(n):
    if i%2 == 1:
        if s[i]+count1 > 0:
            continue
        else:
            ans2 += 1-(s[i]+count1)
            count1 += 1-(s[i]+count1)
    else:
        if s[i]+count1 < 0:
            continue
        else:
            ans2 += (s[i]+count1) + 1
            count1 -= (s[i]+count1) + 1
            
print(min(ans1,ans2))
            

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

count = 0
ans1 = 0
for i in range(n):
    if i%2 == 0:
        if s[i]+count > 0:
            continue
        else:
            ans1 += 1-(s[i]+count)
            count += 1-(s[i]+count)
    else:
        if s[i]+count < 0:
            continue
        else:
            ans1 += (s[i]+count) + 1
            count -= (s[i]+count) + 1
            
count1 = 0
ans2 = 0
for i in range(n):
    if i%2 == 1:
        if s[i]+count1 > 0:
            continue
        else:
            ans2 += 1-(s[i]+count1)
            count1 += 1-(s[i]+count1)
    else:
        if s[i]+count1 < 0:
            continue
        else:
            ans2 += (s[i]+count1) + 1
            count1 -= (s[i]+count1) + 1
            
print(min(ans1,ans2))
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = []
for i in range(n):
    a.append(input())
b = []
for i in range(m):
    b.append(input())

ans = "No"
for x in range(0,n-m):
    for y in range(0,n-m):
        bina = True
        for i in range(m):
            for j in range(m):
                if a[i][j] != b[x+i][y+j]:
                    bina = False
        if bina:
            ans = "Yes"

print(ans)

Fixed submission:
n,m = map(int,input().split())
a = []
for i in range(n):
    a.append(input())
b = []
for i in range(m):
    b.append(input())

ans = "No"
for x in range(0,n-m+1):
    for y in range(0,n-m+1):
        bina = True
        for i in range(m):
            for j in range(m):
                if a[x+i][y+j] != b[i][j]:
                    bina = False
        if bina:
            ans = "Yes"

print(ans)
Buggy python submission (verdict: Runtime Error):
n, m = map(int,input().split())
ab = [[0 for i in range(n)] for j in range(n)]
for i in range(m):
    ai,bi = map(int,input().split())
    ab[ai-1][bi-1] = 1
    ab[bi-1][ai-1] = 1

count = 0

def dfs(x,v):
    l = v.copy()
    l.append(x)
    if len(l)==n:
        global count
        count += 1
    for i in range(n):
        if ab[x][i] == 1 and not i in l:
            dfs(i,l)
    
dfs(0,[])
print(count)

Fixed submission:
from copy import copy
n, m = map(int,input().split())
ab = [[0 for i in range(n)] for j in range(n)]
for i in range(m):
    ai,bi = map(int,input().split())
    ab[ai-1][bi-1] = 1
    ab[bi-1][ai-1] = 1

count = 0

def dfs(x,v):
    l = copy(v)
    l.append(x)
    if len(l)==n:
        global count
        count += 1
    for i in range(n):
        if ab[x][i] == 1 and not i in l:
            dfs(i,l)
    
dfs(0,[])
print(count)
Buggy python submission (verdict: Runtime Error):
s = input()
start = len(s)
end = 0

for i in range(s):
    if s[i] == "A":
        start = min(start,i)
    if s[len(s)-1-i] == "Z":
        end = max(end,i)

print(len(s)-start-end)

Fixed submission:
s = input()
start = len(s)
end = len(s)

for i in range(len(s)):
    if s[i] == "A":
        start = min(start,i)
    if s[len(s)-1-i] == "Z":
        end = min(end,i)

print(len(s)-start-end)
Buggy python submission (verdict: Runtime Error):
s = input()
print(s[0:5]+" "+s[5:12]+" "s[12:19])

Fixed submission:
s = input()
print(s.replace(","," "))
Buggy python submission (verdict: Runtime Error):
k,s = map(int,input().split())

count = 0
for i in range(k+1):
    for j in range(k+1):
        z = s-x-y
        if z>=0 and z<=k:
            count += 1

print(count)

Fixed submission:
k,s = map(int,input().split())

count = 0
for i in range(k+1):
    for j in range(k+1):
        z = s-i-j
        if z>=0 and z<=k:
            count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
x = input()
n = len(x)
ans = "NO"

def f(i):
    if n==i:
        global ans
        ans = "YES"
    else:
        if x[i:i+5] == "dream":
            f(i+5)
        if x[i:i+7] == "dreamer":
            f(i+7)
        if x[i:i+5] == "erase":
            f(i+5)
        if x[i:i+6] == "eraser":
            f(i+6)
f(0)
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(10000000)
x = input()
n = len(x)
ans = "NO"

def f(i):
    if n==i:
        global ans
        ans = "YES"
    else:
        if x[i:i+5] == "dream":
            f(i+5)
        if x[i:i+7] == "dreamer":
            f(i+7)
        if x[i:i+5] == "erase":
            f(i+5)
        if x[i:i+6] == "eraser":
            f(i+6)
f(0)
print(ans)

Buggy python submission (verdict: Runtime Error):
x = input()
n = len(x)
ans = "NO"

def f(i):
    if n==i:
        global ans
        ans = "YES"
    else:
        if x[i:i+5] == "dream":
            f(i+5)
        if x[i:i+7] == "dreamer":
            f(i+7)
        if x[i:i+5] == "erase":
            f(i+5)
        if x[i:i+6] == "eraser":
            f(i+6)
f(0)
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(10000000)
x = input()
n = len(x)
ans = "NO"

def f(i):
    if n==i:
        global ans
        ans = "YES"
    else:
        if x[i:i+5] == "dream":
            f(i+5)
        if x[i:i+7] == "dreamer":
            f(i+7)
        if x[i:i+5] == "erase":
            f(i+5)
        if x[i:i+6] == "eraser":
            f(i+6)
f(0)
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
t=input()
count=0
for i in range(n):
  if s[n-1-i:n]==t[0:i+1]:
    count+=i+1
    break
print(2×n-count)

Fixed submission:
n=int(input())
s=input()
t=input()
count=0
for i in range(n):
  if s[n-1-i:n]==t[0:i+1]:
    count=i+1
print(n+n-count)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
t=input()
count=0
for i in range(n):
  if s[n-1-i]==t[i]:
    count+=1
  else:
    break
print(2×n-count)

Fixed submission:
n=int(input())
s=input()
t=input()
count=0
for i in range(n):
  if s[n-1-i:n]==t[0:i+1]:
    count=i+1
print(n+n-count)
Buggy python submission (verdict: Time Limit Exceeded):
x = input()
while "ST" in x:
    x = x.replace("ST","")
print(len(x))

Fixed submission:
x = input()
ans = 0

count = 0
for i in range(len(x)):
    if x[i] == "S":
        count += 1
    else:
        count -= 1
    if count < 0:
        ans+=1
        count = 0
count = 0
for i in range(len(x)-1,-1,-1):
    if x[i] == "T":
        count += 1
    else:
        count -= 1
    if count <0 :
        ans+=1
        count = 0
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
x = input()
y = len(x) +1
while len(x)<y:
    y = len(x)
    x = x.replace("ST","")
print(len(x))

Fixed submission:
x = input()
ans = 0

count = 0
for i in range(len(x)):
    if x[i] == "S":
        count += 1
    else:
        count -= 1
    if count < 0:
        ans+=1
        count = 0
count = 0
for i in range(len(x)-1,-1,-1):
    if x[i] == "T":
        count += 1
    else:
        count -= 1
    if count <0 :
        ans+=1
        count = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()

if S == ABC:
    print('ARC')
else:
    print('ABC')

Fixed submission:
s = input()
print('ARC' if s == 'ABC' else 'ABC')

Buggy python submission (verdict: Runtime Error):
if S = 'ABC':
    print('ARC')
else:
    print('ABC')

Fixed submission:
s = input()
print('ARC' if s == 'ABC' else 'ABC')
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split(''))
if A - B * 2 > 0:
    print(A - B * 2)
else:
    print(0)

Fixed submission:
a, b = map(int, input().split())  
if a - b * 2 > 0:
    print(a - b * 2)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split)
if A - B * 2 > 0:
    print(A - B * 2)
else:
    print(0)

Fixed submission:
a, b = map(int, input().split())  
if a - b * 2 > 0:
    print(a - b * 2)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
b = int(input())
print("A" if b == "T" else "T" if b == "A" else
      "C" if b == "G" else "G")


Fixed submission:
b = input()
print("A" if b == "T" else "T" if b == "A" else
      "C" if b == "G" else "G")

Buggy python submission (verdict: Runtime Error):
b = int(input())
print("A" if b == "T" else "T" if b == "A" else
      "C" if b == "G" else "T")


Fixed submission:
b = input()
print("A" if b == "T" else "T" if b == "A" else
      "C" if b == "G" else "G")

Buggy python submission (verdict: Runtime Error):
b = int(input())
print("A" if b == T else "T" if b == A else
      "C" if b == G else "T")

Fixed submission:
b = input()
print("A" if b == "T" else "T" if b == "A" else
      "C" if b == "G" else "G")
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int,input(),split())
print(A if B == C else B if A == C else C)

Fixed submission:
A, B, C = map(int, input().split())
print(A if B == C else B if A == C else C)
Buggy python submission (verdict: Runtime Error):
rmap = {
  "AC": 0,
  "WA": 0,
  "TLE": 0,
  "RE": 0,
}

output_order = ["AC", "WA", "TLE", "RE"]

N - int(input())
for _ in range(N):
  rmap[input()] += 1

for k in output_order:
  print("{} x {}".format(k, rmap[k]))

Fixed submission:
rmap = {
  "AC": 0,
  "WA": 0,
  "TLE": 0,
  "RE": 0,
}

output_order = ["AC", "WA", "TLE", "RE"]

N = int(input())
for _ in range(N):
  rmap[input()] += 1

for k in output_order:
  print("{} x {}".format(k, rmap[k]))
Buggy python submission (verdict: Runtime Error):
N = input()
N = N%1000
ans = 1000 - N if not N else 0
print(ans)

Fixed submission:
N = int(input())
N = N % 1000
ans = 1000 - N if N else 0
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
i = 0
songs = []
result = 0

while N-i:
  songs.append(input().split())
  i+=1
X = input()
point = len(songs)

for i in range(N):
  if songs[0]==X:
    point = i+1
    break

for i in range(point:N):
  result += songs[1]

print(result)

Fixed submission:
N = int(input())

songs = []
result = 0

for i in range(N):
    songs.append(input().split())

X = input()
point = len(songs)

for j in range(N):
    if songs[j][0] == X:
        point = j+1
        break

for i in range(point, N):
    result += int(songs[i][1])


print(result)
Buggy python submission (verdict: Runtime Error):
N = input()
dict = {}

for i in range(1: 10):
    for j in range(i+1: 10):
        dict[i*j] = True

return dict.get(N)

Fixed submission:
N = int(input())
dict = {}

for i in range(1, 10):
    for j in range(i, 10):
        dict[i*j] = True
print('Yes' if dict.get(N) else 'No')
Buggy python submission (verdict: Runtime Error):
N = int(input())

allList = []
days = 0

while len(allList) < N:
    allList.append(list(map(int, input().split())))

sum = 100

while sum > 0:
    toBePopped = []
    for i in range(N):
        if allList[i] and i+1 == allList[allList[i][0]-1][0]:
            toBePopped.append(i)
            toBePopped.append(allList[i][0]-1)
    if len(toBePopped) == 0:
        days = -1
        break
    days += 1
    for i in set(toBePopped):
        allList[i].pop(0)

    sum = 0
    for i in range(N):
        sum += len(allList[i])

print(days)


Fixed submission:
S = list(input())
T = list(input())
count = 0
for i in range(3):
    if S[i] == T[i]:
        count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
max = 0

for i in range(N):
    max += i

print(max)


Fixed submission:
N = int(input())
max = 0


print((N-1)*N//2)

Buggy python submission (verdict: Runtime Error):
N = int(input())
max = 0

init = list(range(1, N+1))
all = []
hashtable = {}
tempSum = 0


def helper(input):
    global tempSum, max
    if len(input) == N:
        # print(input)
        if tempSum > max:
            max = tempSum
        return

    for i in range(1, N+1):
        if i not in input:
            input.append(i)
            tempSum += len(input) % i
            # print(tempSum, len(input), i)
            helper(input)
            input.pop()
            tempSum -= len(input) % i


list = []
helper(list)

print(max)


Fixed submission:
N = int(input())
max = 0


print((N-1)*N//2)

Buggy python submission (verdict: Runtime Error):
N = int(input())
max = 0

init = list(range(1, N+1))
all = []


def helper(input):
    if len(input) == N:
        all.append([i for i in list])
        return

    for i in range(1, N+1):
        if i not in input:
            input.append(i)
            helper(input)
            input.pop()


list = []
helper(list)

for i in all:
    sum = 0
    for j in range(N):
        sum += i[j] % (j+1)
    if sum > max:
        max = sum

print(max)


Fixed submission:
N = int(input())
max = 0


print((N-1)*N//2)
Buggy python submission (verdict: Runtime Error):
import math

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

n = math.factorial(N) / math.factorial(N-2) / 2
m = math.factorial(M) / math.factorial(M-2) / 2

print(int(n + m))

Fixed submission:
import math

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

def f(a):
    if a > 1:
        return int(math.factorial(a) / math.factorial(a-2) / 2)
    else:
        return 0

print(f(N) + f(M))
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())

ans = N // (A + B) * A
temp = N % (A + B)
if temp < A:
    ans += temp
else:
    ans += A
print(ans)

Fixed submission:
S = input()

if len(set(S)) == 2:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s = input()

weather = ["Sunny", "Cloudy", "Rainy"]
print(weather[weather.index(s) + 1])


Fixed submission:
s = input()

weather = ["Sunny", "Cloudy", "Rainy"]
print(weather[(weather.index(s) + 1) % 3])
Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = map(int, input().split())

x = 0
cnt = 0
for l in L:
    x += l
    if x > X:
        break
    else:
        cnt += 1

print(cnt+1)

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

if x < a:
    print(0)
else:
    print(10)
Buggy python submission (verdict: Runtime Error):
import re

S = input()

m = re.search(r"[ACGT]+", S)
print(len(m.group()))

Fixed submission:
import re

S = input()

m = re.findall(r"[ACGT]+", S)
if m:
    print(max(map(len, m)))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
N, T = map(int, input().split())

c_min = 1001
t_ = None
for _ in range(N):
    c, t = map(int, input().split())
    if T >= t and c_min > c:
        c_min = c
        t_ = t
if t_ == None:
    print("TLE")
else:
    print(c_min)

Fixed submission:
n = int(input())

if n == 1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a + b)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

print(((b-a)+1)*(b-a)//2-b)


Fixed submission:
n = int(input())

if n <= 999:
    print("ABC")
else:
    print("ABD")
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0
a = 0
b = 0

for i in range(min(C, int(X/500)) + 1):
    a = X - 500 * i
    for j in range(min(B, int(a/100)) + 1):
        b = a - 100 * j
        if int(b/50) <= C:
            count += 1
        else:
            pass

print(count)


Fixed submission:
x = int(input())
a = int(input())
b = int(input())

x -= a
x %= b
print(x)
Buggy python submission (verdict: Runtime Error):
r, g = map(int, input().split())
x = g * 2 - r

print(x)


Fixed submission:
r = int(input())
g = int(input())
x = g * 2 - r

print(x)