Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readlin

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

Fixed submission:
import sys,heapq
#これを加える！！！！
def _heappush_max(heap, item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappop_max(heap):
    """Maxheap version of a heappop."""
    lastelt = heap.pop()    # raises appropriate IndexError if heap is empty
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        heapq._siftup_max(heap, 0)
        return returnitem
    return lastelt

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

res = [0]*(n+1)
head = a[:n:]
heapq.heapify(head)
p = sum(head)
for i in range(n+1):
    res[i] = p
    p += a[n+i]
    heapq.heappush(head,a[n+i])
    p -= heapq.heappop(head)
end = a[2*n::]
heapq._heapify_max(end)
q = sum(end)
for i in range(n+1):
    res[n-i] -= q
    q += a[2*n-1-i]
    _heappush_max(end,a[2*n-1-i])
    q -= _heappop_max(end)
print(max(res))

Buggy python submission (verdict: Runtime Error):
ef d_3n_numbers(N, A):
    import heapq
 
    def _heappush_max(heap, item):
        heap.append(item)
        heapq._siftdown_max(heap, 0, len(heap) - 1)
    def _heappop_max(heap):
    """Maxheap version of a heappop."""
    　　lastelt = heap.pop()    # raises appropriate IndexError if heap is empty
    　　if heap:
        　　returnitem = heap[0]
        　　heap[0] = lastelt
        　　heapq._siftup_max(heap, 0)
        　　return returnitem
    　　return lastelt
    setattr(heapq, '_heappush_max', _heappush_max)
 
    left = A[:N]
    heapq.heapify(left)
    right = A[2 * N:]
    heapq._heapify_max(right)
    left_sum, right_sum = [sum(left)], [sum(right)]
 
    # 同じ要素をleftとrightで取り合っても、相殺されるので問題ない
    for k in range(N, 2 * N):
        heapq.heappush(left, A[k])
        v = heapq.heappop(left)
        left_sum.append(left_sum[-1] + A[k] - v)
    for k in range(2 * N - 1, N - 1, -1):
        heapq._heappush_max(right, A[k])
        v = heapq._heappop_max(right)
        right_sum.append(right_sum[-1] + A[k] - v)
    right_sum = right_sum[::-1]
 
    ans_candidate = [a - b for a, b in zip(left_sum, right_sum)]
    return max(ans_candidate)
 
N = int(input())
A = [int(i) for i in input().split()]
print(d_3n_numbers(N, A))

Fixed submission:
import sys,heapq
#これを加える！！！！
def _heappush_max(heap, item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappop_max(heap):
    """Maxheap version of a heappop."""
    lastelt = heap.pop()    # raises appropriate IndexError if heap is empty
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        heapq._siftup_max(heap, 0)
        return returnitem
    return lastelt

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

res = [0]*(n+1)
head = a[:n:]
heapq.heapify(head)
p = sum(head)
for i in range(n+1):
    res[i] = p
    p += a[n+i]
    heapq.heappush(head,a[n+i])
    p -= heapq.heappop(head)
end = a[2*n::]
heapq._heapify_max(end)
q = sum(end)
for i in range(n+1):
    res[n-i] -= q
    q += a[2*n-1-i]
    _heappush_max(end,a[2*n-1-i])
    q -= _heappop_max(end)
print(max(res))
Buggy python submission (verdict: Time Limit Exceeded):
s,c = map(int,input().split())

ass = 0
while True:
    if s > 0 and c > 1:
        ass += 1
        s -= 1
        c -=2
    elif s == 0 and c >= 4:
        ass += 1
        c -= 4
    else:
        break
print(ass)

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

ass = 0
if s >= c//2:
    print(c//2)
else:
    ass += s
    c -= s*2
    
    ass += c//4
    print(ass)
Buggy python submission (verdict: Runtime Error):
dreameraser

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

c=0
k=0
while c==0:
    if k ==n:
        c = 1
    else:
        
        if k + 7 <= n-1 and s[k]=='d' and s[k+1] == 'r' and s[k+2] == 'e' and s[k+3] == 'a' and s[k+4] == 'm' and s[k+5] == 'e' and s[k+6] == 'r' and s[k+7] == 'a':
            k += 5
        elif k + 6 <= n-1 and s[k]=='d' and s[k+1] == 'r' and s[k+2] == 'e' and s[k+3] == 'a' and s[k+4] == 'm' and s[k+5] == 'e' and s[k+6] == 'r':
            k += 7
        elif k + 4 <= n-1 and s[k]=='d' and s[k+1] == 'r' and s[k+2] == 'e' and s[k+3] == 'a' and s[k+4] == 'm':
            k += 5
        elif k+6 <= n-1 and s[k] == 'e' and s[k+1] == 'r' and s[k+2] == 'a' and s[k+3] == 's' and s[k+4] == 'e' and  s[k+5] == 'r' and s[k+6] == 'a':
            k+= 5
        elif k+5 <= n-1 and s[k] == 'e' and s[k+1] == 'r' and s[k+2] == 'a' and s[k+3] == 's' and s[k+4] == 'e' and  s[k+5] == 'r':
            k += 6
        elif k+4 <= n-1 and s[k] == 'e' and s[k+1] == 'r' and s[k+2] == 'a' and s[k+3] == 's' and s[k+4] == 'e':
            k += 5
        else:
            c = 1

if k == n:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
def dijkstra(s):
    #始点sから各頂点への最短距離
    #n:頂点数,　w:辺の数, cost[u][v] : 辺uvのコスト(存在しないときはinf)
    d = [float("inf")] * n
    used = [False] * n
    d[s] = 0
    
    while True:
        v = -1
        #まだ使われてない頂点の中から最小の距離のものを探す
        for i in range(n):
            if (not used[i]) and (v == -1):
               v = i
            elif (not used[i]) and d[i] < d[v]:
                v = i
        if v == -1:
               break
        used[v] = True
               
        for j in range(n):
               d[j] = min(d[j],d[v]+cost[v][j])
    return d

Xs,Ys,Xt,Yt = map(int,input().split())
n = int(input())
p = [[Xs,Ys,0],[Xt,Yt,0]]
for i in range(2,n+2):
    p.append(list(map(int,input().split())))
cost = [[0]*(n+2)for i in range(n+2)]

for i in range(n+2):
    for j in range(i,n+2):
        cost[i][j] = cost[j][i] =  max(((p[i][0]-p[j][0])**2+(p[i][1]-p[j][1])**2)**0.5 - p[i][2] - p[j][2],0)

n += 2

res = dijkstra(0)
print(res[1])


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

res = 0
for i in range(1,n):
    if a[i]+a[i-1]>= x:
        res += (a[i]+a[i-1]-x)
        if a[i-1]>= x:
            a[i]=0
        else:
            a[i] = x-a[i-1]
    
print(res)
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))

a = [0] * n
b = [0] * n
c = []

for i in range(n):
    a[i] = 30000*i
    b[i] = 30000*(n-i)

for i in range(n):
    k = p[i]
    b[k] += i

res = ''
ans = ''
for i in range(n):
    res += str(a[i]) + ' '
    ans += str(b[i]) + ' '
print(res)
print(ans)

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

a = [0] * n
b = [0] * n
c = []

for i in range(n):
    a[i] = 30000*(i+1)+5
    b[i] = 30000*(n-i-1)+5

for i in range(n):
    k = p[i]
    b[k-1] += i

res = ''
ans = ''
for i in range(n):
    if i == n-1:
        res += str(a[i])
        ans += str(b[i])
    else:
        res += str(a[i]) + ' '
        ans += str(b[i]) + ' '

print(res)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a,m):
    x = extgcd(a,m)[0]
    return (m+x%m)%m

#n! = a p^eとしたときのeを求める (O(logp n)
def mod_e(n,p):
    res = 0
    while n >= p:
        res += n//p
        n = n//p
    return res

#n! = a p^eとしたときのa mod pを求める  (O(logp n)
def mod_fact(n,p):
    if n==0:
        return 1
    
    
    res = mod_fact(n//p,p)
    
    if n//p %2 != 0:
        return res*(p-fact[n%p])%p
    return res*fact[n%p]%p
    
######################################################

#nCk mod p
def mod_comb(n,k):
    if n < 0 or k < 0 or n<k:
        return 0
    e1 = mod_e(n,p)
    e2 = mod_e(k,p)
    e3 = mod_e(n-k,p)
    #pで割り切れる場合
    if e1 > e2 + e3:
        return 0

    #pで割り切れない場合
    a1 = mod_fact(n,p)
    a2 = mod_fact(k,p)
    a3 = mod_fact(n-k,p)
    return a1 * mod_inv(a2*a3%p,p) %p
######################################################

h,w,a,b = map(int,input().split())
#pは素数とする
p = 10**9+7
#fact[i] : i! modp (0<= i <p) O(p)
fact = [1]
k = 1
for i in range(1,10**6+100):
    k = k*i%p
    fact.append(k)

res = 0
for i in range(h-a):
    res += mod_comb(i+b-1,b-1)*mod_comb(h-i-1+w-b-1,w-b-1)
    res = res%p
print(res)

Fixed submission:
#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a,m):
    x = extgcd(a,m)[0]
    return (m+x%m)%m

#n! = a p^eとしたときのeを求める (O(logp n)
def mod_e(n,p):
    res = 0
    while n >= p:
        res += n//p
        n = n//p
    return res

#n! = a p^eとしたときのa mod pを求める  (O(logp n)
def mod_fact(n,p):
    if n==0:
        return 1
    
    
    res = mod_fact(n//p,p)
    
    if n//p %2 != 0:
        return res*(p-fact[n%p])%p
    return res*fact[n%p]%p
    
######################################################

#nCk mod p
def mod_comb(n,k):
    if n < 0 or k < 0 or n<k:
        return 0
    e1 = mod_e(n,p)
    e2 = mod_e(k,p)
    e3 = mod_e(n-k,p)
    #pで割り切れる場合
    if e1 > e2 + e3:
        return 0

    #pで割り切れない場合
    a1 = mod_fact(n,p)
    a2 = mod_fact(k,p)
    a3 = mod_fact(n-k,p)
    return a1 * mod_inv(a2*a3%p,p) %p
######################################################

h,w,a,b = map(int,input().split())
#pは素数とする
p = 10**9+7
#fact[i] : i! modp (0<= i <p) O(p)
fact = [1]
k = 1
for i in range(1,10**6+10):
    k = k*i%p
    fact.append(k)

res = 0
for i in range(h-a):
    res += mod_comb(i+b-1,b-1)*mod_comb(h-i-1+w-b-1,w-b-1)
    res = res%p
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n,x,y,z = map(int,input().split())
mod = 10**9+7
ma = max(x,y,z)

def f(a):
    s = 0
    for e in a:
        s += int(e)
    ind = 0
    while s >= x+y+z:
        s -= int(a[ind])
        ind += 1
    
    ind2 = -1
    for i in range(len(a)-1,ind-1,-1):
        if int(a[i]) > ma:
            ind2 = i
            break
    return a[max(ind,ind2):]

def judge(s):
    sx = 0
    px = -1
    for i in range(len(s)-1,-1,-1):
        sx += int(s[i])
        if sx == x:
            px = i
            break
    if px == -1:
        return True
    
    sy = 0
    py = -1
    for i in range(px-1,-1,-1):
        sy += int(s[i])
        if sy == y:
            py = i
            break
    if py == -1:
        return True
    
    sz = 0
    for i in range(py-1,-1,-1):
        sz += int(s[i])
        if sz == z:
            return False
    return True

d = [{},{'':1}]
sample = ('1','2','3','4','5','6','7','8')

for i in range(n):
    d[i%2] = {}
    for plus in sample:
        for e in d[(i+1)%2]:
            if judge(e+plus):
                new = f(e+plus)
                pl = d[(i+1)%2][e]
                if plus == '8':
                    pl = pl*3%mod
                if new in d[i%2]:
                    d[i%2][new] = (d[i%2][new]+pl)%mod
                else:
                    d[i%2][new] = pl
res = 0
for e in d[(n+1)%2].values():
    res = (res+e)%mod
print((pow(10,n,mod)-res)%mod)



Fixed submission:
mod = 10**9+7
n, x, y, z = map(int,input().split())
xyz = 2**(x+y+z-1) + 2**(y+z-1) + 2**(z-1)
w = 2**(x+y+z-1)
dp = [[0]*w for _ in range(n+1)]
dp[0][0] = 1

for i in range(n):
    for j in range(w):
        for k in range(1,11):
            nj = ((j+j+1)<<(k-1))
            if nj&xyz != xyz:
                dp[i+1][nj%w] = (dp[i+1][nj%w]+dp[i][j])%mod

print((pow(10,n,mod)-sum(dp[-1])%mod)%mod)
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())
ans = -1
keep = 0

for i in range(K):
    keep = (keep + 7 * 10 ** i) % K
    if keep == 0:
        ans = i + 1
        break
print(ans)

Fixed submission:
K = int(input())
ans = -1
keep = 0
check = 7
for i in range(K):
    keep = (keep + check) % K
    if keep == 0:
        ans = i + 1
        break
    check = (check * 10) % K
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
A = list(map(int, input().split()))
keep = 1

for i in range(k):
    keep *= A[i]


for j in range(n - k):
    if A[k + j] > A[j]:
        print("Yes")
    else:
        print("No")
    keep = keep * A[k + j] / A[j]


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

for j in range(n - k):
    if A[k + j] > A[j]:
        print("Yes")
    else:
        print("No")

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

for i in range(k):
    keep *= A[i]


for j in range(n - k):
    if keep * A[k + j] > keep*A[j]:
        print("Yes")
    else:
        print("No")
    keep = keep * A[k + j] / A[j]


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

for j in range(n - k):
    if A[k + j] > A[j]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
s = input()
if 65<=ord(s)<=90:
  print(A)
else:
  print(a)

Fixed submission:
s = input()
if 65<=ord(s)<=90:
  print("A")
else:
  print("a")
Buggy python submission (verdict: Runtime Error):
import sys
x, n = map(int, input().split())
if n == 0:
    print(x)
    exit(1)
p = [int(x) for x in input().split()]
k = 0
while x in p:
    if not x - k in p:
        print(x - k)
        exit(1)
    elif not x + k in p:
        print(x + k)
        exit(1)
    else:
        k += 1
        continue
print(x)

Fixed submission:
x, n = map(int, input().split())
if n == 0:
    print(x)
else:
    p = [int(x) for x in input().split()]
    for i in range(n + 1):
        if not x - i in p:
            print(x - i)
            break
        elif not x + i in p:
            print(x + i)
            break
        else:
            continue

Buggy python submission (verdict: Runtime Error):
import sys
x, n = map(int, input().split())
if n == 0:
    print(x)
    exit(1)
p = [int(x) for x in input().split()]
k = 0
while x in p:
    if not x - k in p:
        print(x - k)
        exit(1)
    elif not x + k in p:
        print(x + k)
        exit(1)
    else:
        k += 1
        continue
print(x)


Fixed submission:
x, n = map(int, input().split())
if n == 0:
    print(x)
else:
    p = [int(x) for x in input().split()]
    for i in range(n + 1):
        if not x - i in p:
            print(x - i)
            break
        elif not x + i in p:
            print(x + i)
            break
        else:
            continue
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(k):
    b = [0] * n
    for j in range(n):
        b[max(0, j - a[j]):min(n, j + a[j] + 1)] = map(lambda x: x + 1, b[max(0, j - a[j]):min(n, j + a[j] + 1)])
    a = b
print(' '.join([str(_) for _ in a]))


Fixed submission:
s=input()
print(s[:3])
Buggy python submission (verdict: Runtime Error):
n=int(input())
ans=1
check=0
a=sorted(list(map(int,input().split())))
for i in range(n):
  if ans>=10**18:
    check=1
    break
  else:
    ans*=a[i]
print([ans,-1][check])

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

Buggy python submission (verdict: Runtime Error):
n=int(input())
ans=1
a=list(map(int,input().split()))
for i in range(n):
  ans*=a[i]
if ans>=10**18:
  print(-1)
else:
  print(ans)


Fixed submission:
a,b=map(int,input().split())
print(a*b)
Buggy python submission (verdict: Runtime Error):
n=int(input())
ans=1
a=list(map(int,inpiut().split()))
for i in range(n):
  ans*=a[i]
if ans>=10**18:
  print(-1)
else:
  print(ans)

Fixed submission:
n=int(input())
ans=1
check=0
a=sorted(list(map(int,input().split())))
for i in range(n):
  if ans>10**18:
    check=1
    break
  else:
    ans*=a[i]
if ans>10**18:
    check=1
print([ans,-1][check])
Buggy python submission (verdict: Runtime Error):
from collections import deque

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


def check(x):
    return A[x - 1]


x = 1
lis = deque([])
for i in range(n + 2):
    if check(x) in lis:
        break
    else:
        lis.appendleft(check(x))
        x = check(x)

num = lis.index(check(x)) + 1
k = (k - (i - num)) % num
print(lis[- k - (i - num)])


Fixed submission:
s=input()
t=input()
if t[:-1]==s:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n, m, x = map(int, input().split())
keep = []
ans = 10**10
for i in range(n):
    c = list(map(int, input().split()))
    keep.append(c)

for j in range(2**n):
    bag = [0] * n
    total = 0
    check = 1
    for k in range(n):
        if ((j >> k) & 1):
            for l in range(m):
                bag[l] += keep[k][l + 1]
            total += keep[k][0]
    for a in range(m):
        if bag[a] < x:
            check *= 0
    if ans * check > total:
        ans = total
if ans == 10**10:
    print(-1)
else:
    print(ans)


Fixed submission:
s=input()
t=input()
if t[:-1]==s:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n, m, x = map(int, input().split())
keep = []
ans = 10**10
for i in range(n):
    c = list(map(int, input().split()))
    keep.append(c)

for j in range(2**n):
    bag = [0] * n
    total = 0
    check = 1
    for k in range(n):
        if ((j >> k) & 1):
            for l in range(m):
                bag[l] += keep[k][l + 1]
            total += keep[k][0]
    for a in range(m):
        if bag[a] < x:
            check *= 0
    if ans * check > total:
        ans = total
if ans == 10**10:
    print(-1)
else:
    print(ans)


Fixed submission:
n, m, x = map(int, input().split())
keep = []
ans = 10**10
for i in range(n):
    c = list(map(int, input().split()))
    keep.append(c)
for j in range(2**n):
    bag = [0] * m
    total = 0
    check = 1
    for k in range(n):
        if ((j >> k) & 1):
            for l in range(m):
                bag[l] += keep[k][l + 1]
            total += keep[k][0]
    for a in range(m):
        if bag[a] < x:
            check *= 0
    if ans * check > total:
        ans = total
if ans == 10**10:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Runtime Error):
n, m, x = map(int, input().split())
keep = []
ans = 10**10
for i in range(n):
    c = list(map(int, input().split()))
    keep.append(c)

for j in range(2**n):
    bag = [0] * n
    total = 0
    check = 1
    for k in range(n):
        if ((j >> k) & 1):
            for l in range(m):
                bag[l] += keep[k][l + 1]
            total += keep[k][0]
    for a in range(m):
        if bag[a] < x:
            check *= 0
    if ans * check > total:
        ans = total
if ans == 10**10:
    print(-1)
else:
    print(ans)


Fixed submission:
n, m, x = map(int, input().split())
keep = []
ans = 10**10
for i in range(n):
    c = list(map(int, input().split()))
    keep.append(c)
for j in range(2**n):
    bag = [0] * m
    total = 0
    check = 1
    for k in range(n):
        if ((j >> k) & 1):
            for l in range(m):
                bag[l] += keep[k][l + 1]
            total += keep[k][0]
    for a in range(m):
        if bag[a] < x:
            check *= 0
    if ans * check > total:
        ans = total
if ans == 10**10:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
x = int(input())


i = 0

while i**5 < x:
    i += 1
for k in range(i):
    for j in range(-i, i + 1):
        if k**5 - j**5 == x:
            a, b = k, j
print(a, b)


Fixed submission:
x = int(input())


i = 0
a, b = 0, 0
while i**5 < x:
    i += 1
mx = i
for k in range(2 * (mx + 1)):
    for j in range(-k, k + 1):
        if k**5 - j**5 == x:
            a, b = k, j
print(a, b)
Buggy python submission (verdict: Time Limit Exceeded):
N, M, Q = map(int, input().split())
lis = []
for i in range(Q):
    a = list(map(int, input().split()))
    lis.append(a)


big_lis = []


def dfs(string, n, m):
    if n == (N - 1):
        for i in range(m, M + 1):
            big_lis.append(string + [i])
    else:
        for i in range(m, M + 1):
            dfs(string + [i], n + 1, i)


dfs([], 0, 1)

MAX_A = 0
for small_lis in big_lis:
    D = 0
    for j in range(Q):
        if small_lis[int(lis[j][1]) - 1] - small_lis[int(lis[j][0]) - 1] == int(lis[j][2]):
            D += int(lis[j][3])
    MAX_A = max(MAX_A, D)
print(MAX_A)


Fixed submission:
N, M, Q = map(int, input().split())
lis = []
for i in range(Q):
    a = list(map(int, input().split()))
    lis.append(a)


big_lis = []


def dfs(string, n, m):
    if n == (N - 1):
        for i in range(m, M + 1):
            big_lis.append(string + [i])
    else:
        for i in range(m, M + 1):
            dfs(string + [i], n + 1, i)


dfs([], 0, 1)

MAX_A = 0
for small_lis in big_lis:
    D = 0
    for j in range(Q):
        if small_lis[int(lis[j][1]) - 1] - small_lis[int(lis[j][0]) - 1] == int(lis[j][2]):
            D += int(lis[j][3])
    MAX_A = max(MAX_A, D)
print(MAX_A)
Buggy python submission (verdict: Time Limit Exceeded):
import math
ans=0
a,b,n=map(int,input().split())

for i in range(n+1):
    keep=math.floor(a*i/b)-a*math.floor(i/b)
    if ans<keep:
        ans=keep
print(ans)

Fixed submission:
import math
ans=-100000000
a,b,n=map(int,input().split())
i=min(n,b-1)
keep=math.floor(a*i/b)-a*math.floor(i/b)

print(keep)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
lis=[]
ans=0
for i in range(N):
    s=input()
    if not s in lis:
        ans+=1
        lis.append(s)
print(ans)

Fixed submission:
import collections

N=int(input())
lis=[]
for i in range(N):
    s=input()
    lis.append(s)
c = collections.Counter(lis)
print(len(c))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
lis=[]
ans=0
for i in range(N):
    s=input()
    if not s in lis:
        ans+=1
        lis.append(s)
print(ans)

Fixed submission:
import collections

N=int(input())
lis=[]
for i in range(N):
    s=input()
    lis.append(s)
c = collections.Counter(lis)
print(len(c))
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
for i in range(1,N+1):
    ans=A.count(i)
    print(ans)


Fixed submission:
A=int(input())
print(A*2*3.141)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
for i in range(1, N + 1):
    print(A.count(i))


Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans=[0]*N
for i in A:
  ans[i-1]+=1
for j in range(N):
  print(ans[j])

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
for i in range(1,N+1):
    ans=A.count(i)
    print(ans)


Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans=[0]*N
for i in A:
  ans[i-1]+=1
for j in range(N):
  print(ans[j])

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
for i in range(1,N+1):
    ans=A.count(i)
    print(ans)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans=[0]*N
for i in A:
  ans[i-1]+=1
for j in range(N):
  print(ans[j])
Buggy python submission (verdict: Runtime Error):
def main():
    N=int(input())
    S=input()
    ans=0
    for i in range(N-2):
        for j in range(i+1,N-1):
            lis=["R","G","B"]
            if S[i]!=S[j]:
                lis=["R","G","B"]
                lis.remove(S[i])
                lis.remove(S[j])
                k=S[j+1:].count(lis[0])
                ans=ans+k
            if j+(j-i)<N and S[i]!=S[j]:
                if S[j+(j-i)]!=S[i] and S[j+(j-i)]!=S[j]:
                    ans-=1
    print(ans)

main()


Fixed submission:
S=input()
if "7" in S:
    print("Yes")
else:
    print("No")