Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
h,w = map(int,input().split())
n = int(input())
l = list(map(int,input().split()))
ans = [[0]*w for i in range(h)]
x,y = 0,0
z = 1
num = 1
for i in range(n):
    count = 0
    while count < l[i]:
        ans[x][y] = i+1
        count += 1
        if z == 1:
            if y < w-1:
                y += 1
            else:
                x += 1
                z = 2
        elif z == -1:
            if y == 0:
                x += 1
                z = 2
            else:
                y -= 1
        elif z == 2:
            if y == 0:
                y += 1
                z = 1
            else:
                y -= 1
                z = -1
        
for i in ans:
    print(*i)
                



Fixed submission:
h,w = map(int,input().split())
n = int(input())
l = list(map(int,input().split()))
ans = [[0]*w for i in range(h)]
x,y = 0,0
z = 1
num = 1
for i in range(n):
    count = 0
    while count < l[i]:
        ans[x][y] = i+1
        count += 1
        if z == 1:
            if y == w-1:
                x += 1
                z = 2
                
            else:
                y += 1
        elif z == -1:
            if y == 0:
                x += 1
                z = 2
            else:
                y -= 1
        elif z == 2:
            if w != 1:
                if y == 0:
                    y += 1
                    z = 1
                else:
                    y -= 1
                    z = -1
            else:
                x += 1
        
for i in ans:
    print(*i)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 1
for i in range(10):
  if ans < n:
    ans *= 2
  elif ans > n:
    print(ans //= 2)
    exit()
  else:
    print(ans)
    exit()

Fixed submission:
n = int(input())
ans = 1
for i in range(10):
  if ans < n:
    ans *= 2
  elif ans > n:
    print(ans // 2)
    exit()
  else:
    print(ans)
    exit()
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = [list(map(int,input().split())) for i in range(n)]
count = [0]*(m+1)
for i in a:
    count[i[0]] += 1
l = [0]*n
ans = max(count)
s = set()
for i in range(n-1):
    M = max(count)
    ind = count.index(M)
    s.add(ind)

    for j in range(n):
        if a[j][l[j]] == ind:

            count[ind] -= 1
            while a[j][l[j]] in s:
                l[j] += 1
            count[a[j][l[j]]] += 1
    ans = min(ans,max(count))

print(ans)

Fixed submission:
n,m = map(int,input().split())
a = [list(map(int,input().split())) for i in range(n)]
count = [0]*(m+1)
for i in a:
    count[i[0]] += 1
l = [0]*n
ans = max(count)
s = set()
for i in range(m-1):
    M = max(count)
    ind = count.index(M)
    s.add(ind)

    for j in range(n):
        if a[j][l[j]] == ind:

            count[ind] -= 1
            while a[j][l[j]] in s:
                l[j] += 1
            count[a[j][l[j]]] += 1
    ans = min(ans,max(count))

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import sys
    input = sys.stdin.readline

    n = int(input())
    l = list(map(int,input().split()))
    ans = []
    for i in l:
        ans.append(i)
        ans = ans[::-1]
    print(*ans)
if __name__ == "__main__":
    main()


Fixed submission:
n = int(input())
l = list(map(int,input().split()))
if n % 2 == 0:
    ans = [l[i] for i in range(n-1,-1,-2)] + [l[i] for i in range(0,n-1,2)]
    print(*ans)
else:
    ans = [l[i] for i in range(n-1,-1,-2)] + [l[i] for i in range(1,n-1,2)]
    print(*ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for i in range(n):
    x,y = map(int,input().split())
    l.append([x,y,i])

lx = sorted(l)
ly = sorted(l, key=lambda x: x[1])

e = []
for i in range(n-1):
    e.append([lx[i+1][0]-lx[i][0],lx[i+1][2],lx[i][2]])
    e.append([ly[i+1][1]-ly[i][1],ly[i+1][2],ly[i][2]])


class Unionfind:
    
    def __init__(self,n):
        self.uf = [-1]*n

    def find(self,x):
        if self.uf[x] < 0:
            return x
        else:
            self.uf[x] = self.find(self.uf[x])
            return self.uf[x]

    def same(self,x,y):
        return self.find(x) == self.find(y)

    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return 
        if self.uf[x] > self.uf[y]:
            x,y = y,x
        self.uf[x] += self.uf[y]
        self.uf[y] = x

    def size(self,x):
        x = self.find(x)
        return -self.uf[x]

u = Unionfind(n)
count = 0
e.sort()
for i in e:
    if u.find(i[1]) != u.find(i[2]):
        u.union(i[1],i[2])
        count += i[0]
print(count)

Fixed submission:
n = int(input())
l = []
for i in range(n):
    x,y = map(int,input().split())
    l.append([x,y,i])

lx = sorted(l)
ly = sorted(l, key=lambda x: x[1])

e = []
for i in range(n-1):
    e.append([lx[i+1][0]-lx[i][0],lx[i+1][2],lx[i][2]])
    e.append([ly[i+1][1]-ly[i][1],ly[i+1][2],ly[i][2]])


class Unionfind:
    
    def __init__(self,n):
        self.uf = [-1]*n

    def find(self,x):
        if self.uf[x] < 0:
            return x
        else:
            self.uf[x] = self.find(self.uf[x])
            return self.uf[x]

    def same(self,x,y):
        return self.find(x) == self.find(y)

    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return 
        if self.uf[x] > self.uf[y]:
            x,y = y,x
        self.uf[x] += self.uf[y]
        self.uf[y] = x

    def size(self,x):
        x = self.find(x)
        return -self.uf[x]
s = set()
u = Unionfind(n)
count = 0
e.sort()
for i in e:
    if not u.same(i[1],i[2]):
        u.union(i[1],i[2])
        s.add(i[1])
        s.add(i[2])
        count += i[0]
print(count)
Buggy python submission (verdict: Runtime Error):
s = list(input())
print("yes" is len(s) == len(set(s)) else "no")


Fixed submission:
s = list(input())
print("yes" if len(s) == len(set(s)) else "no")
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
l = [0]*n
for i in range(n):
  a,b = map(int,input().split())
  l[a-1] += 1
  l[b-1] += 1
for i in l:
  print(i)

Fixed submission:
n,m = map(int,input().split())
l = [0]*n
for i in range(m):
  a,b = map(int,input().split())
  l[a-1] += 1
  l[b-1] += 1
for i in l:
  print(i)
Buggy python submission (verdict: Runtime Error):
l = list(map(int,input().split()))
count = 0
while True:
    if l[0] == l[1] == l[2]:
        if l[1]%2 == 0:
            print(-1)
            exit(9)
    for i in range(3):
        if l[i]%2 == 1:
            print(count)
            exit()
    count += 1
    l[0],l[1],l[2] = (l[1]+l[2])//2,(l[0]+l[2])//2,(l[1]+l[0])//2
             
            


Fixed submission:
l = list(map(int,input().split()))
count = 0
while True:
    if l[0] == l[1] == l[2]:
        if l[1]%2 == 0:
            print(-1)
            exit()
    for i in range(3):
        if l[i]%2 == 1:
            print(count)
            exit()
    count += 1
    l[0],l[1],l[2] = (l[1]+l[2])//2,(l[0]+l[2])//2,(l[1]+l[0])//2
Buggy python submission (verdict: Time Limit Exceeded):
n,w = map(int,input().split())
l =[list(map(int,input().split())) for i in range(n)]

dp = [[[0]*(3*n+1) for i in range(n+1)] for j in range(n+1)]
s = l[0][0]

for i in range(n):
    dt = l[i][0]-s
    for j in range(n):
        for k in range(3*n+1):
            if k -dt >= 0:
                dp[i+1][j+1][k] = max(dp[i][j+1][k],dp[i][j][k-dt]+l[i][1])
            else:
                dp[i+1][j+1][k] = dp[i][j+1][k]

ans = 0
for i in range(1,n+1):
    for j in range(3*n+1):
        if i*s+j <= w:
            ans = max(ans,dp[-1][i][j])
print(ans)

Fixed submission:
n,w = map(int,input().split())
l =[list(map(int,input().split())) for i in range(n)]

dp = [[[0]*(3*n+1) for i in range(n+1)] for j in range(n+1)]
s = l[0][0]

for i in range(n):
    dt = l[i][0]-s
    for j in range(n):
        for k in range(3*n+1):
            if k -dt >= 0:
                dp[i+1][j+1][k] = max(dp[i][j+1][k],dp[i][j][k-dt]+l[i][1])
            else:
                dp[i+1][j+1][k] = dp[i][j+1][k]

ans = 0
for i in range(1,n+1):
    for j in range(3*n+1):
        if i*s+j <= w:
            ans = max(ans,dp[-1][i][j])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

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

l = deque([1])

while True:
    check = True
    for nex in e[l[-1]]:
        if nex in l:
            continue
        l.append(nex)
        check = False
        break
    if check:
        break
while True:
    check = True
    for nex in e[l[0]]:
        if nex in l:
            continue
        l.appendleft(nex)
        check = False
        break
    if check:
        print(len(l))
        print(*l)
        exit()

Fixed submission:
from collections import deque

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

l = deque([1])
s = set([1])
while True:
    check = True
    for nex in e[l[-1]]:
        if nex in s:
            continue
        l.append(nex)
        s.add(nex)
        check = False
        break
    if check:
        break
while True:
    check = True
    for nex in e[l[0]]:
        if nex in s:
            continue
        l.appendleft(nex)
        s.add(nex)
        check = False
        break
    if check:
        print(len(l))
        print(*l)
        exit()
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = [list(map(int,input().split())) for i in range(n)]
b = [list(map(int,input().split())) for i in range(n)]

ans = []

for i in a:
  count = 10**10
  check = 0
  for j in range(m):
    if count > abs(i[0]-b[j][0])+abs(i[1]-b[j][1]):
      check = j+1
      count = abs(i[0]-b[j][0])+abs(i[1]-b[j][1])
    
  ans.append(check)
for i in ans:
  print(i)

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

ans = []

for i in a:
  count = 10**10
  check = 0
  for j in range(m):
    if count > abs(i[0]-b[j][0])+abs(i[1]-b[j][1]):
      check = j+1
      count = abs(i[0]-b[j][0])+abs(i[1]-b[j][1])
    
  ans.append(check)
for i in ans:
  print(i)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(input())


check = [[1,1],[1,-1],[-1,1],[-1,-1]]
for j,k in check:
    ans = [0]*n
    ans[0] = j
    ans[1] = k
    
    for i in range(1,n):
        if ans[i] == 1:
            if l[i] == "o":
                ans[(i+1)%n] = ans[i-1]
            else:
                ans[(i+1)%n] = -ans[i-1]

        else:
            if l[i] == "o":
                ans[(i+1)%n] = -ans[i-1]
            else:
                ans[(i+1)%n] = ans[i-1]
        
    if j == ans[0]:  
        if l[0]=="o":
            if k == ans[-1]:
                for i in ans:
                    if i == 1:
                        print("S",end="")
                    else:
                        print("W",end="")
            exit()
        else:
            if k == -ans[-1]:
                for i in ans:
                    if i == 1:
                        print("S",end="")
                    else:
                        print("W",end="")

			exit()
        
        
        
            
print(-1)

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

def che(k):
    if l[k] == "o":
        if ans[k] == 1:
            if ans[k-1]*ans[(k+1)%n] == 1:
                return True
            else:
                return False
        else:
            if ans[k-1]*ans[(k+1)%n] == -1:
                return True
            else:
                return False

    else:
        if ans[k] == 1:
            if ans[k-1]*ans[(k+1)%n] == -1:
                return True
            else:
                return False
        else:
            if ans[k-1]*ans[(k+1)%n] == 1:
                return True
            else:
                return False


check = [[1,1],[1,-1],[-1,1],[-1,-1]]
for j,k in check:
    ans = [0]*n
    ans[0] = j
    ans[1] = k
    
    for i in range(1,n):
        if ans[i] == 1:
            if l[i] == "o":
                ans[(i+1)%n] = ans[i-1]
            else:
                ans[(i+1)%n] = -ans[i-1]

        else:
            if l[i] == "o":
                ans[(i+1)%n] = -ans[i-1]
            else:
                ans[(i+1)%n] = ans[i-1]
    d = True
    
    for m in range(n):
        if che(m) == False:
            d = False
            
    if d:
        for i in ans:
            if i == 1:
                print("S",end="")
            else:
                print("W",end="")
        exit()  
            
print(-1)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

from collections import deque
import copy
n,m = map(int,input().split())
r = [[] for i in range(n)]
for i in range(m):
    a,b,c = map(int,input().split())
    r[a-1].append((b-1,c,i+1))
    r[b-1].append((a-1,c,i+1))

def bfs(x,y):
    q = deque([])
    l = [-1]*n
    l[x] = 0
    check =[[] for i in range(n)]
    q.append((x,0,[]))
    while q:
        bef,pas,rec = q.popleft()
        if bef == y:
            break
            

        for nex,c,num in r[bef]:
            rec2 = copy.deepcopy(rec)
            rec2.append(num)
            
            if l[nex] == -1:
                l[nex] = pas+c
                check[nex] = rec2
                q.append((nex,pas+c,rec2))
            else:
                
                if pas+c < l[nex]:  
                    l[nex] = pas+c
                    check[nex] = rec2
                elif pas+c == l[nex]:
                    check[nex].append(rec2)
                else:
                    continue
    return check[y]

ans = set()
for i in range(n):
    for j in range(n):
        for k in bfs(i,j):
            ans.add(k)
        if len(ans) == m:
            print(0)
            exit()
print(m-len(ans))



            

Fixed submission:
import heapq
n,m, = map(int,input().split())
E = [[] for i in range(n)]
for i in range(m):
    a,b,c = map(int,input().split())
    a -= 1
    b -= 1
    E[a].append((c,b))
    E[b].append((c,a))


def dijkstra(x):
    dis = [float("inf")]*n
    dis[x] = 0
    q = []
    heapq.heappush(q,(0,x))
    
    while q:
        cost,bef = heapq.heappop(q)

        if dis[bef] < cost:
            continue

        for ncost,nex in E[bef]:
            dist = ncost+cost

            if dist < dis[nex]:
                dis[nex] = dist
                heapq.heappush(q,(dist,nex))
    return dis

short = []
for i in range(n):
    short.append(dijkstra(i))
count = 0
for i in range(n):
    for dist,nex in E[i]:
        if short[i][nex] < dist:
            count += 1
print(count//2)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int,input().split()))
mod = 10**9+7
if n % 2 == 1:
    for i in range(1,n//2+1):
        if l.count(2*i) != 2:
            print(0)
            exit()
    print(pow(2,n//2,mod))
else:
    for i in range(n//2):
        if l.count(2*i+1) != 2:
            print(0)
            exit()
    print(pow(2,n//2,mod))


Fixed submission:
n = int(input())
l = list(map(int,input().split()))
l.sort()
mod = 10**9+7
if n % 2 == 1:
    if l[0] != 0:
        print(0)
        exit()
    count = 2
    for i in range(1,n-1,2):
        
        if l[i] != count or l[i] != l[i+1]:
            print(0)
            exit()
        count += 2
    print(pow(2,n//2,mod))
else:
    count = 1
    for i in range(0,n-1,2):
        if l[i] != count or l[i] != l[i+1]:
            print(0)
            exit()
        count += 2
    print(pow(2,n//2,mod))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int,input().split()))
if n % 2 == 1:
    for i in range(1,n//2+1):
        if l.count(2*i) != 2:
            print(0)
            exit()
    print(pow(2,n//2))
else:
    for i in range(n//2):
        if l.count(2*i+1) != 2:
            print(0)
            exit()
    print(pow(2,n//2))


Fixed submission:
n = int(input())
l = list(map(int,input().split()))
l.sort()
mod = 10**9+7
if n % 2 == 1:
    if l[0] != 0:
        print(0)
        exit()
    count = 2
    for i in range(1,n-1,2):
        
        if l[i] != count or l[i] != l[i+1]:
            print(0)
            exit()
        count += 2
    print(pow(2,n//2,mod))
else:
    count = 1
    for i in range(0,n-1,2):
        if l[i] != count or l[i] != l[i+1]:
            print(0)
            exit()
        count += 2
    print(pow(2,n//2,mod))
Buggy python submission (verdict: Runtime Error):
print(len(set(list(map(int,input().split()))))


Fixed submission:
print(len(set(map(int,input().split()))))
Buggy python submission (verdict: Runtime Error):
s = input()
print(s[:4]+" "+s[4:]

Fixed submission:
s = input()
print(s[:4]+" "+s[4:])
Buggy python submission (verdict: Time Limit Exceeded):
import copy
n,x = map(int,input().split())
a = list(map(int,input().split()))
l = copy.deepcopy(a)
ans = float("INF")
for i in range(n):
    count = x*i
    for j in range(n):
        l[j] = min(l[j],a[(j-i)%n])
        count += l[j]
    ans = min(ans,count)
print(ans)

Fixed submission:
n,x = map(int,input().split())
a = list(map(int,input().split()))
l = [float("INF")]*n
ans = float("INF")
for i in range(n):
    count = x*i
    for j in range(n):
        l[j] = min(l[j],a[(j-i)%n])
        count += l[j]
    ans = min(ans,count)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,a = map(int,input().split())
l = list(map(int,input().split()))

dp = [[[0]*(2501) for i in range(n+1)] for j in range(n+1)]
dp[0][0][0] = 1

# i 個目までのj個選んで　和のmod aが k

for i in range(n):    
    for j in range(i+1):
        for k in range(2501):

            dp[i+1][j][k] += dp[i][j][k]
            if k+l[i] < 2501:
                dp[i+1][j+1][k+l[i]] += dp[i][j][k]


ans = 0
for j in range(1,n+1):
    ans += dp[-1][j][j*a]
print(ans)


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

dp = [[[0]*(2501) for i in range(n+1)] for j in range(n+1)]
dp[0][0][0] = 1



for i in range(n):    
    for j in range(i+1):
        for k in range(2501):

            dp[i+1][j][k] += dp[i][j][k]
            if k+l[i] < 2501:
                dp[i+1][j+1][k+l[i]] += dp[i][j][k]


ans = 0
for j in range(1,n+1):
    ans += dp[-1][j][j*a]
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
lis = [int(input()) for i in range(n)]+[0]

count = 0
m = -1
for i in range(n):
    if lis[i]%2 == 0:
        count += l[i]//2
    else:
        if lis[i+1] > 1:
            count += lis[i]//2+1
            lis[i+1] -= 1
        else:
            count += lis[i]//2
print(count)

Fixed submission:
n = int(input())
ans = 0
lis = [int(input()) for i in range(n)]+[0]

count = 0

for i in range(n):
    if lis[i]%2 == 0:
        count += lis[i]//2
    else:
        if lis[i+1] > 1:
            count += lis[i]//2+1
            lis[i+1] -= 1
        else:
            count += lis[i]//2
print(count)
Buggy python submission (verdict: Runtime Error):
print(sum[i for i in range(int(input())+1)])

Fixed submission:
print(sum([i+1 for i in range(int(input()))]))
Buggy python submission (verdict: Runtime Error):
nn = int(input())
x = 0
for i in range(n):
    d1, d2 = map(int, input().split())
    if x != 3:
        if d1 != d2:
            x = 0
        else:
            x += 1
print("Yes" if x == 3 else "No")

Fixed submission:
n = int(input())
x = 0
for i in range(n):
    d1, d2 = map(int, input().split())
    if x != 3:
        if d1 != d2:
            x = 0
        else:
            x += 1
print("Yes" if x == 3 else "No")
Buggy python submission (verdict: Runtime Error):
x = int(input())
if x >= 30:
    print("Yes")
else:
    print("No")

Fixed submission:
d, t, s = map(int, input().split())
print("Yes" if d <= t * s else "No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
z = 0
for j in range(n - 1):
    for i in range(j + 1):
        z += (a[i] * a[j + 1]) % 1000000007

a = z % 1000000007
print(a)

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

z = 0
for i in range(n):
    z += a[i]
e = z % 2

y = (z ** 2) % 2000000014

x = 0
for j in range(n):
    x += a[j] ** 2
    x = x % 2000000014

w = int(((y - x) / 2) % 1000000007)
print(w)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
i = 1
for j in range(n):
    i = i * a[j]
print(int(i) if i <= 10**18 else "-1")

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
i = 1
if 0 in a:
    i = 0
else:
    for j in range(n):
        if i >= 0:
            i = i * a[j]
        if i > 10 ** 18:
            i = -1
print(int(i))
Buggy python submission (verdict: Runtime Error):
import math
r = int(input())
print(float(r*2*(math.pi)))73

Fixed submission:
import math
r = int(input())
print(float(r*2*(math.pi)))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = sorted(map(int, input().split()))[::-1]
i = 0
for j in range(n):
    i = i + a[j]
x = i / (4 * m)
print("Yes" if a[m] >= x else "No")

Fixed submission:
n, m = map(int, input().split())
a = sorted(map(int, input().split()))[::-1]
i = 0
for j in range(n):
    i = i + a[j]
x = i / (4 * m)
print("Yes" if a[m - 1] >= x else "No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
x = 0
b = []
for i in range(n):
    y = a.count(i + 1)
    if y != 0:
        b.append(y)
    else:
        b.append(0)
    x += y * (y - 1) / 2

for j in range(n):
    print(int(x - b[a[j] - 1] + 1))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
x = 0
b = [0] * n
for i in range(n):
    b[a[i] - 1] += 1

x = 0
for j in range(n):
    x += ((b[j] - 1) * b[j] / 2)

for k in range(n):
    print(int(x - b[a[k] - 1] + 1))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
x = 0
for i in range(n):
    y = a.count(i + 1)
    x += y * (y - 1) / 2
for j in range(n):
    b = a.count(a[j])
    print(int(x - b + 1))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
x = 0
b = [0] * n
for i in range(n):
    b[a[i] - 1] += 1

x = 0
for j in range(n):
    x += ((b[j] - 1) * b[j] / 2)

for k in range(n):
    print(int(x - b[a[k] - 1] + 1))
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
x = int(n / (a + b))
y = n - ((a + b) / x)
if y >= a:
    z = a
else:
    z = y
print(int(a * x + z))

Fixed submission:
n, a, b = map(int, input().split())
x = int(n / (a + b))
y = n - ((a + b) * x)
if y >= a:
    z = a
else:
    z = y
print(int((a * x) + z))

Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
x = int(n / (a + b))
y = n - ((a + b) / x)
if y >= a:
    z = a
else:
    z = y
print(int(a * x + z))

Fixed submission:
n, a, b = map(int, input().split())
x = int(n / (a + b))
y = n - ((a + b) * x)
if y >= a:
    z = a
else:
    z = y
print(int((a * x) + z))
Buggy python submission (verdict: Runtime Error):
letter = ord(input())
print(chr(c+1))

Fixed submission:
letter = ord(input())
print(chr(letter+1))
Buggy python submission (verdict: Runtime Error):
n, k = map(int,input().split())
s = input()
l = s[k - 1]
if l == "A":
    x = s[:(k - 1)] + "a" + s[(k + 1):]
elif l == "B":
    x = s[:(k - 1)] + "b" + s[(k + 1):]
print(x)

Fixed submission:
n, k = map(int,input().split())
s = input()
l = s[k - 1]
if l == "A":
    x = s[:(k - 1)] + "a" + s[k:]
elif l == "B":
    x = s[:(k - 1)] + "b" + s[k:]
else:
    x = s[:(k - 1)] + "c" + s[k:]
print(x)
Buggy python submission (verdict: Runtime Error):
n=int(input())
m=int(input())
print(n*m)

Fixed submission:
n,m=map(int,input().split())
print(n*m)