Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
r = int(input())
if n < 1200:
    print('ABC')
elif n < 2800:
    print('ARC')
else:
    print('AGC')

Fixed submission:
r = int(input())
if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int, input().split())
if a*n >= b:
    print(b)
else:
    print(

Fixed submission:
n,a,b = map(int, input().split())
if a*n >= b:
    print(b)
else:
    print(a*n)
Buggy python submission (verdict: Runtime Error):
r = int(input())
g = int(input())
print(2g-r)

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

Buggy python submission (verdict: Runtime Error):
r = int(input())
g = int(input())
pri

Fixed submission:
r = int(input())
g = int(input())
print(2*g-r)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
towns = list(map(int, input().split()))
towns.insert(0, -1)
p = 1
tmp_move, first_move, roop_move = [1], [], []
res = -1

while True:
    if towns[p] in tmp_move:
        roop_move = tmp_move[tmp_move.index(towns[p]):]
        first_move = tmp_move[:tmp_move.index(towns[p])]
        break
    else:
        tmp_move.append(towns[p])
        p = towns[p]

if K < len(first_move):
    res = first_move[K]
else:
    index = (K - len(first_move)) % len(roop_move)
    res = roop_move[index]

print(res)

Fixed submission:
N, K = map(int, input().split())
towns = list(map(int, input().split()))
towns.insert(0, -1)
p = 1
tmp_move, first_move, roop_move = [1], [], []
visited = [False for _ in range(N + 1)]
res = -1

while not visited[p]:
    visited[p] = True
    tmp_move.append(towns[p])
    p = towns[p]

index = tmp_move.index(p)
roop_move = tmp_move[index:-1]
first_move = tmp_move[:index]

if K < len(first_move):
    res = first_move[K]
else:
    index = (K - len(first_move)) % len(roop_move)
    res = roop_move[index]

print(res)
Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))
sum = [i + 1 + x for i, x in enumerate(p)]
dif = [i + 1 - x for i, x in enumerate(p)]
ans = 0

for i in range(N):
    ans += sum.count(dif[i])

print(ans)

Fixed submission:
S = input()
if S == "ABC":
    print("ARC")
else:
    print("ABC")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
p = list(map(int, input().split()))
sum = [i + 1 + x for i, x in enumerate(p)]
dif = [i + 1 - x for i, x in enumerate(p)]
ans = 0

for i in range(N):
    ans += sum.count(dif[i])

print(ans)

Fixed submission:
from collections import defaultdict

N = int(input())
p = list(map(int, input().split()))
d = defaultdict(int)
ans = 0

for i in range(N):
    ans += d[i + 1 - p[i]]
    d[i + 1 + p[i]] += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
p = list(map(int, input().split()))
sum = [i + 1 + x for i, x in enumerate(p)]
dif = [i + 1 - x for i, x in enumerate(p)]
ans = 0

for i in range(N):
    for j in range(i + 1, N):
        if dif[j] == sum[i]:
            ans += 1
print(ans)

Fixed submission:
from collections import defaultdict

N = int(input())
p = list(map(int, input().split()))
d = defaultdict(int)
ans = 0

for i in range(N):
    ans += d[i + 1 - p[i]]
    d[i + 1 + p[i]] += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
items = []

for i in range(N):
    item = input()
    if item not in items:
        items.append(item)

print(len(items))

Fixed submission:
N = int(input())
items = set()

for i in range(N):
    items.add(input())

print(len(items))
Buggy python submission (verdict: Time Limit Exceeded):
S = input()[::-1]
ans = 0
mods = [0] * 2019
mods[0] = 1
current = 0
x = 1

for s in S:
    current = (current + x * int(s)) % 2019
    ans += mods[current]
    mods[current] += 1
    x = x * 10

print(ans)



Fixed submission:
S = input()[::-1]
ans = 0
mods = [0] * 2019
mods[0] = 1
current = 0
x = 1

for s in S:
    current = (current + x * int(s)) % 2019
    ans += mods[current % 2019]
    mods[current % 2019] += 1
    x = x * 10 % 2019

print(ans)
Buggy python submission (verdict: Runtime Error):
def main():
    d = {}
    N = int(input())
    for i in range(N):
        s = input()
        d.setdefault(s, 1)
        d[s] += 1
    
    d = sorted(d.items())
    d = sorted(d, key=lambda x:x[1], reverse=True)
    n = d[0][1]
    for i in range(N):
        if d[i][1] != n:
            break
        print(d[i][0])

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    d = {}
    N = int(input())
    for i in range(N):
        s = input()
        d.setdefault(s, 1)
        d[s] += 1
    
    d = sorted(d.items())
    d = sorted(d, key=lambda x:x[1], reverse=True)
    n = d[0][1]
    for i in range(len(d)):
        if d[i][1] != n:
            break
        print(d[i][0])

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    d = {}
    N = int(input())
    for i in range(N):
        s = input()
        d.setdefault(s, 1)
        d[s] += 1
    
    d = sorted(d.items())
    d = sorted(d, key=lambda x:x[1], reverse=True)
    for i in range(N):
        print(d[i][0])

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    d = {}
    N = int(input())
    for i in range(N):
        s = input()
        d.setdefault(s, 1)
        d[s] += 1
    
    d = sorted(d.items())
    d = sorted(d, key=lambda x:x[1], reverse=True)
    n = d[0][1]
    for i in range(len(d)):
        if d[i][1] != n:
            break
        print(d[i][0])

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    a = list(map(int, input().split()))
    m = 10 ** 9 + 7
    ans = 0

    for i in range(N - 1):
        for j in range(i + 1, N):
            tmp = a[i] ^ a[j]
            ans += tmp % m
            ans %= m

    print(ans)

if __name__ == '__main__':
    main()
    

Fixed submission:
def main():
    N = int(input())
    l = list(map(int, input().split()))
    ans = 0
    m = 10**9 + 7
    
    for i in range(60):
        x = 0
        for j in l:
            x += 1 & j >> i
        
        tmp = x * (N - x) % m
        tmp *= 2 ** i % m
        ans += tmp
        ans %= m

    print(ans)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
A,B,K = int(input()).split()
 
if A >= K:
  A = A-K
else:
  if B >= (K-A):
    A = 0
    B = B - (K-A)
  else:
    A = 0
    B = 0
    
print(A,B)

Fixed submission:
A,B,K = map(int, input().split())
 
if A >= K:
  A = A-K
else:
  if B >= (K-A):
    B = B - (K-A)
    A = 0
  else:
    A = 0
    B = 0
    
print(A,B)

Buggy python submission (verdict: Runtime Error):
A,B,K = int(input()).split()

if(A>K):
  A = A-K
else:
  if(B>K):
    A = 0
    B = B - K
  else:
    A = 0
    B = 0
    
print(A,B)

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

if N == 1:
  print("Hello World")
elif N == 2:
  print(A+B)

Fixed submission:
N = int(input())

if N == 1:
  print("Hello World")
elif N ==2:
  A = int(input())
  B = int(input())
  print(A+B)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(str(input()))

min = 3*10**5
cont = 0


for i in range(1,N):
  cont = 0
  left = S[:i-1]
  right = S[i+1:]
  cont = left.count("W") + right.count("E")
  if min >= cont:
    min = cont

print(min)

Fixed submission:
N = int(input())
S = list(str(input()))

min = 3*10**5
cnt = 0

cnt = S.count("E")
min = cnt

for i in S:
  if i == "E":
    cnt -= 1
  elif i == "W":
    cnt += 1
  if min >= cnt:
    min = cnt

print(min)
Buggy python submission (verdict: Runtime Error):
X = int(input())

beki = []

for i in range(2,14):
  for j in range(2,10):
    if i**j <= 1000:
      beki.append(i**j)

new_beki=[e for e in beki if e <= X]
print(max(new_beki))

Fixed submission:
X = int(input())

beki = []

for i in range(1,33):
  for j in range(2,10):
    if i**j <= X:
      beki.append(i**j)

print(max(beki))
Buggy python submission (verdict: Runtime Error):
[a, b, h] = [int(input()) for i in range(3)]


result = (a + b) * h // 2
print(result)


Fixed submission:
import re

a = input()
b = input()

if re.match(f'^{a}.$', b):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a = input("羊の数")
b = input("狼の数")

S = int(a)
W = int(b)

if S <= W:
  print("unsafe")
else:
  print("safe")
  

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

if s <= w:
	print("unsafe")
else:
	print("safe")
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int, input().split())

t = []
if n <= a+b:
    print(a)
else:
    for i in range(1,n+1):
        t += "b"*a +"r"*b
        i += 1
    s = t[:n]
    print(s.count("b"))

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

t = n%(a+b)

if n < a:
    print(n)
else:
    if a > t > 0:
        print(n//(a+b)*a+t)
    elif t >= a:
        print(n//(a+b)*a+a)
    else:
        print(n//(a+b)*a)
Buggy python submission (verdict: Runtime Error):
n,k = map(int, input().split())
t=0

while n  >= k: 
    n = n // k
    t += 1
    
print(t+1)

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

if n>=10:
    print(r)
else:
    print(r+(100*(10-n)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()

ans = 0

for i in range(n):
    if s[i] == 'A':
        if s[i+1] == 'B':
            if s[i+2] == 'C':
                ans += 1
print(ans)

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

ans = 0

for i in range(n-2):
    if s[i] == 'A':
        if s[i+1] == 'B':
            if s[i+2] == 'C':
                ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
s = a+b
t = a-b
u = a*b

if s >= t:
    if t >= u:
        print(s)
    elif s <= u:
        print(u)
else:
    if s >= u:
        print(t)
    elif:
        t <= u:
        print(u)

Fixed submission:
a, b = map(int, input().split())
s = a+b
t = a-b
u = a*b

if s >= t:
    if s >= u:
        print(s)
    else:
        print(u)
elif t >= u:
    if t >= s:
        print(t)
    else:
        print(s)
elif u >= s:
    if u >= t:
        print(u)
    else:
        print(t)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]

m = max(a)

for i in range(n):
    if m >= a[i]:
        print(m)
    else:
        b = a[i]
        a.remove(b)
        print(max(a))
        a.insert(i,b)

Fixed submission:
r = int(input())

print(3*(r**2))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]

b = sorted(a)

for i in a:
    if i = b[-1]:
        print(b[-2])
    else:
        print(b[-1])


Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]

b = sorted(a)

for i in a:
    if i == b[-1]:
        print(b[-2])
    else:
        print(b[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]

m = max(a)

for i in range(n):
    if m > a[i]:
        print(m)
    else:
        b = a[i]
        a.remove(b)
        print(max(a))
        a.insert(i,b)


Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]

b = sorted(a)

for i in a:
    if i == b[-1]:
        print(b[-2])
    else:
        print(b[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]

for i in range(n):
    b = a[i]
    a.remove(b)
    print(max(a))
    a.insert(i,b)


Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]

b = sorted(a)

for i in a:
    if i == b[-1]:
        print(b[-2])
    else:
        print(b[-1])
Buggy python submission (verdict: Runtime Error):
l,r = map(int, input().split())

t = []

if r-l >= 2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(l+1,r+1):
            t.append((i*j)%2019)

print(min(t))

Fixed submission:
l,r = map(int, input().split())

t = []

if r-l >= 2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(l+1,r+1):
            t.append((i*j)%2019)
    print(min(t))

Buggy python submission (verdict: Runtime Error):
l,r = map(int, input().split())

t = []

if r-l >= 2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(l+1,r+1):
            t.append((i*j)%2019)

print(min(t))

Fixed submission:
l,r = map(int, input().split())

t = []

if r-l >= 2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(l+1,r+1):
            t.append((i*j)%2019)
    print(min(t))

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

t = []

for i in range(l,r):
    for j in range(l+1,r+1):
        t.append((i*j)%2019)

print(min(t))

Fixed submission:
l,r = map(int, input().split())

t = []

if r-l >= 2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(l+1,r+1):
            t.append((i*j)%2019)
    print(min(t))

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

t = []

for i in range(l,r):
    for j in range(l+1,r+1):
        t.append((i*j)%2019)

u = sorted(t)
print(u[0])

Fixed submission:
l,r = map(int, input().split())

t = []

if r-l >= 2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(l+1,r+1):
            t.append((i*j)%2019)
    print(min(t))
Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
if (K=<A):
  print(K)
elif (K=<A+B):
  print(A)
else:
  print(2*A+B-K)

Fixed submission:
A, B, C, K = map(int, input().split())
if K <= A:
  print(K)
elif K <= A+B:
  print(A)
else:
  print(2*A+B-K)

Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
if (K=<A):
  print(K)
elif (K=<A+B):
  print(A)
else:
  print(2*A+B-K)

Fixed submission:
A, B, C, K = map(int, input().split())
if K <= A:
  print(K)
elif K <= A+B:
  print(A)
else:
  print(2*A+B-K)

Buggy python submission (verdict: Runtime Error):
A=input() B=input() C=input() K=input()
if (K<=A):
  print(K)
elif (A<K<=A+B):
  print(A)
else:
  print(2A+B-K)

Fixed submission:
A, B, C, K = map(int, input().split())
if K <= A:
  print(K)
elif K <= A+B:
  print(A)
else:
  print(2*A+B-K)

Buggy python submission (verdict: Runtime Error):
A=input() B=input() C=input() K=input()
if (K<=A):
  print(K)
elif (A<K<=A+B):
  print(A)
else:
  print(2A+B-k)

Fixed submission:
A, B, C, K = map(int, input().split())
if K <= A:
  print(K)
elif K <= A+B:
  print(A)
else:
  print(2*A+B-K)
Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
result = 0

if A >= K:
    print(A)
elif (A + B) >= K:
    print(A)
elif (A + B + C) > K:
    print(A - (K - (A + B)))
else:
    print(A - C)

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

if t.startswith(s) and str.isalpha(t):
    if len(t) == (len(s) + 1):
        print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
result = 0

if A >= K:
    print(K)
elif (A + B) >= K:
    print(K)
else:
    for i in range(K):
        if A > (i + 1):
            result += 1
            continue
        elif A == (i + 1):
            result += 1
            continue

        if B > (i + 1 - A):
            result += 0
            continue
        elif B == (i + 1 - A):
            result += 0
            continue

        if C > (i + 1 - A - B):
            result -= 1
            continue
        elif C == (i + 1 - A - B):
            result -= 1
            break
        else:
            break
    print(result)


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

if t.startswith(s) and str.isalpha(t):
    if len(t) == (len(s) + 1):
        print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
result = 0

if A >= K:
    print(K)
else:
    for i in range(K):
        if A > (i + 1):
            result += 1
            continue
        elif A == (i + 1):
            result += 1
            continue

        if B > (i + 1 - A):
            result += 0
            continue
        elif B == (i + 1 - A):
            result += 0
            continue

        if C > (i + 1 - A - B):
            result -= 1
            continue
        elif C == (i + 1 - A - B):
            result -= 1
            break
        else:
            break
    print(result)

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

if t.startswith(s) and str.isalpha(t):
    if len(t) == (len(s) + 1):
        print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
result = 0

if A > K:
    print(K)
    exit

for i in range(K):
    if A > (i + 1):
        result += 1
        continue
    elif A == (i + 1):
        result += 1
        continue

    if B > (i + 1 - A):
        result += 0
        continue
    elif B == (i + 1 - A):
        result += 0
        continue

    if C > (i + 1 - A - B):
        result -= 1
        continue
    elif C == (i + 1 - A - B):
        result -= 1
        break
    else:
        break

print(result)


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

if t.startswith(s) and str.isalpha(t):
    if len(t) == (len(s) + 1):
        print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

if T.startswith(S):
    if len(T) == (len(S) + 1):
        print('YES')
else:
    print('No')1


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

if t.startswith(s) and str.isalpha(t):
    if len(t) == (len(s) + 1):
        print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
x = int(input())

for a in range(100):
    for b in range(100):
        if a**5 + b**5 == x:
            print(a, b)
            exit()

Fixed submission:
s = input()

if s == 'ABC':
    print('ARC')
else:
    print('ABC')
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
h = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(m)]   
result = 0

for i in range(n):
    cnt = 0
    j = i + 1
    x = []
    for a, b in ab:
        if j == a:
            x.append(b)
        elif j == b:
            x.append(a)
    for y in x:
        if h[i] > h[y-1]:
            cnt += 1
        elif h[i] <= h[y-1]:
            break
    if cnt == len(x):
        result += 1

print(result)

Fixed submission:
n, m = map(int, input().split())
h = list(map(int, input().split()))
cnt = [1] * n
for i in range(m):
    a, b = map(int,input().split())
    if h[a-1] > h[b-1]:
        cnt[b-1] = 0
    elif h[a-1] == h[b-1]:
        cnt[a-1] = 0
        cnt[b-1] = 0
    else:
        cnt[a-1] = 0
print(sum(cnt))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
h = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(m)]   
result = 0

for i in range(n):
    cnt = 0
    j = i + 1
    x = []
    for a, b in ab:
        if j == a:
            x.append(b)
        elif j == b:
            x.append(a)
    for y in x:
        if h[i] > h[y-1]:
            cnt += 1
    if cnt == len(x):
        result += 1

print(result)

Fixed submission:
n, m = map(int, input().split())
h = list(map(int, input().split()))
cnt = [1] * n
for i in range(m):
    a, b = map(int,input().split())
    if h[a-1] > h[b-1]:
        cnt[b-1] = 0
    elif h[a-1] == h[b-1]:
        cnt[a-1] = 0
        cnt[b-1] = 0
    else:
        cnt[a-1] = 0
print(sum(cnt))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
cnt = 0

B = [i + a for i, a in enumerate(A)]

C = [j - a for j, a in enumerate(A)]

for i, b in enumerate(B):
    for j, c in enumerate(C):
        if i >= j:
            continue
        elif b == c:
            cnt += 1
print(cnt)

Fixed submission:
from collections import Counter
n = int(input())
A = list(map(int, input().split()))
cnt = 0

B = Counter(i + a for i, a in enumerate(A))
C = Counter(j - a for j, a in enumerate(A))
#print(B)
#print(C)
for k, v in B.items():
    cnt += C[k] * v
print(cnt)

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

for i, a in enumerate(A):
    for j in range(n):
        if i >= j:
            continue
        if abs((i+1) - (j+1)) == (a + A[j]):
            cnt += 1
print(cnt)

Fixed submission:
from collections import Counter
n = int(input())
A = list(map(int, input().split()))
cnt = 0

B = Counter(i + a for i, a in enumerate(A))
C = Counter(j - a for j, a in enumerate(A))
#print(B)
#print(C)
for k, v in B.items():
    cnt += C[k] * v
print(cnt)

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

for i in range(n):
    for j in range(n):
        if i >= j:
            continue
        if abs((i+1) - (j+1)) == (a[i] + a[j]):
            cnt += 1
print(cnt)

Fixed submission:
from collections import Counter
n = int(input())
A = list(map(int, input().split()))
cnt = 0

B = Counter(i + a for i, a in enumerate(A))
C = Counter(j - a for j, a in enumerate(A))
#print(B)
#print(C)
for k, v in B.items():
    cnt += C[k] * v
print(cnt)

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

for i in range(n):
    for j in range(n):
        if i == j:
            continue
        if abs((i+1) - (j+1)) == (a[i] + a[j]):
            cnt += 1
print(cnt//2)

Fixed submission:
from collections import Counter
n = int(input())
A = list(map(int, input().split()))
cnt = 0

B = Counter(i + a for i, a in enumerate(A))
C = Counter(j - a for j, a in enumerate(A))
#print(B)
#print(C)
for k, v in B.items():
    cnt += C[k] * v
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, k = map(int, input().split())
s = 0
for i in range(k):
  if a != 0:
    s += 1
    a -= 1
  elif b != 0:
    b -= 1
  elif c != 0:
    s -= 1
    c -= 1
print(s)

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

if k >= a:
    r = k - a
    if r >= b:
        r = r - b
        print(a-r)
    else:
        print(a)
else:
    print(k)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,n = map(int, input().split())
com = 0
if n < b:
    x = n
else:
    x = b-1
while x >= 0:
    val = (a*x)//b-a*(x//b)
    if val < com:
        pass
    else:
        com = val
    x -= 1
print(com)

Fixed submission:
a,b,n = map(int, input().split())
com = 0
if n < b:
    x = n
else:
    x = b-1
val = (a*x)//b
print(val)

Buggy python submission (verdict: Runtime Error):
a,b,n = map(int, input().split())
if n < b:
    x = n
else:
    x = b-1
while x >= 0:
    val = (a*x)//b-a*(x//b)
    if val < com:
        pass
    else:
        com = val
    x -= 1
print(com)

Fixed submission:
a,b,n = map(int, input().split())
com = 0
if n < b:
    x = n
else:
    x = b-1
val = (a*x)//b
print(val)

Buggy python submission (verdict: Time Limit Exceeded):
from math import floor
a,b,n = map(int, input().split())
x = n
com = 0
while x >= 0:
    val = (a*x)//b-a*(x//b)
    if val < com:
        pass
    else:
        com = val
    x-=1
print(com)

Fixed submission:
a,b,n = map(int, input().split())
com = 0
if n < b:
    x = n
else:
    x = b-1
val = (a*x)//b
print(val)

Buggy python submission (verdict: Time Limit Exceeded):
from math import floor
a,b,n = map(int, input().split())
x = n
com = 0
while x >= 0:
    val = floor((a*x)/b)-a*floor(x/b)
    if val < com:
        pass
    else:
        com = val
    x-=1
print(com)

Fixed submission:
a,b,n = map(int, input().split())
com = 0
if n < b:
    x = n
else:
    x = b-1
val = (a*x)//b
print(val)
Buggy python submission (verdict: Runtime Error):
n = input()
if n[3] == n[4] and n[5] == n[6]:
  print("Yes")
else:
  print("No")

Fixed submission:
n = input()
if n[2] == n[3] and n[4] == n[5]:
  print("Yes")
else:
  print("No")