Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import numpy as np

N = int(input())
A = list(map(int,input().split()))

boss=[0]*N

for x in A:
    boss[x-1] += 1
for i in boss:
    print(int(boss[i-1]))

Fixed submission:
import numpy as np

R = int(input())
print( 2 * np.pi * R )
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
staff = list(map(int, input().split()))
i=1
while i<N:
    count = sum(x==i for x in staff)
    print(count)
    i += 1
print(0)

Fixed submission:
import numpy as np

N = int(input())
A = list(map(int,input().split()))

boss=[0]*N

for x in A:
    boss[x-1] += 1
for i in boss:
    print(i)
Buggy python submission (verdict: Runtime Error):
import numpy as np


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

i =N
while i>0:
    i = i-K
    i_ = i #一時避難場所
print (i if i<np.abs(i_) else np.abs(i_))

Fixed submission:
import numpy as np


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

time = N // K
min_ = N- time*K
min = N- (time+1)*K
print (min_ if min_<np.abs(min) else np.abs(min))
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 ans:
    print(j)
Buggy python submission (verdict: Time Limit Exceeded):
import math
ans = 0
def gcd_list(a):
    tmp = math.gcd(a[0],a[1])
    return math.gcd(tmp,a[2])
k = int(input())
for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            a = [i,j,k]
            ans += gcd_list(a)
print(ans)

Fixed submission:
import math
 
K = int(input())
ans = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        tmp = math.gcd(i, j)
        for k in range(1, K+ 1):
            ans += math.gcd(k, tmp)
 
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce
k = int(input())
l = [a,b,c]
gcd = []
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
for l[0] in range(1,k+1):
    for l[1] in range(1,k+1):
        for l[2] in range(1,k+1):
            gcd.append(gcd_list(l))
print(sum(gcd))

Fixed submission:
import math
 
K = int(input())
ans = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        tmp = math.gcd(i, j)
        for k in range(1, K+ 1):
            ans += math.gcd(k, tmp)
 
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
a = [n]
i = 0
if n%k == 0:
    print(0)
else:
    while i >= 0:
        n = abs(n-k)
        a.append(n)
        i += 1
        if a[i] > a[i-1]:
            print(min(a))
            break

Fixed submission:
n,k = map(int, input().split())
a,b = divmod(n,k)
print(min(b,k-b))

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
a = []
for i in range(10**18):
    n = abs(n-k)
    a.append(n)
    if a[len(a)-2] < n:
        print(a[len(a)-2])
        break

Fixed submission:
n,k = map(int, input().split())
a,b = divmod(n,k)
print(min(b,k-b))
Buggy python submission (verdict: Runtime Error):
l = float(input())
print(math.pow((l/3), 3))

Fixed submission:
l = float(input())
print((l/3)**3)
Buggy python submission (verdict: Runtime Error):
N = (int,input())
if N % 2 == 0:
    print(N // 2);
else:
    print(N // 2 + 1)

Fixed submission:
N = int(input())
if N % 2 == 0:
    print(N // 2);
else:
    print(N // 2 + 1)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
import math
print(int(math.log(n,k))+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):
 weeks = {'MON': '1', 'TUE': '2',
          'WED': '3', 'THU': '4',
          'FRI': '5', 'SAT': '6',
          'SUN': '0'
         }
  s = input()
  print(7-int(weeks.get(s)))

Fixed submission:
weeks = {'MON': '1', 'TUE': '2', 'WED': '3', 'THU': '4', 'FRI': '5', 'SAT': '6', 'SUN': '0'}
s = input()
print(7-int(weeks.get(s)))

Buggy python submission (verdict: Runtime Error):
weeks = {'MON': '1', 'TUE': '2',
    ...: 'WED': '3', 'THU': '4',
    ...: 'FRI': '5', 'SAT': '6',
    ...: 'SUN': '0'^M
    ...: }
    ...: S = input('')
    ...: print(7-int(weeks.get(S)))

Fixed submission:
weeks = {'MON': '1', 'TUE': '2', 'WED': '3', 'THU': '4', 'FRI': '5', 'SAT': '6', 'SUN': '0'}
s = input()
print(7-int(weeks.get(s)))

Buggy python submission (verdict: Runtime Error):
 weeks = {'MON': '1', 'TUE': '2',
    ...:  'WED': '3', 'THU': '4',
    ...:  'FRI': '5', 'SAT': '6',
    ...:  'SUN': '0'
    ...:  }
    ...: S = input('today:')
    ...: print(7-int(weeks.get(S)))

Fixed submission:
weeks = {'MON': '1', 'TUE': '2', 'WED': '3', 'THU': '4', 'FRI': '5', 'SAT': '6', 'SUN': '0'}
s = input()
print(7-int(weeks.get(s)))
Buggy python submission (verdict: Runtime Error):
Z,X,Y =int(input().split())
print(X,Y,Z)

Fixed submission:
Y, Z, X =map(int, input().split())
print(X,Y,Z)
Buggy python submission (verdict: Runtime Error):
N = int(input())
line = list(map(int,input().split()))
a = 0
p = []
for i in line:
    p.append(i)
    m = min(p)
    if m >= i:
       a += 1

print(a)

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

if n == m :
    print("Yes")
else :
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
line = list(map(int,input().split()))
a = 0
p = []
for i in line:
    p.append(i)
    m = min(p)
    if m >= i:
       a += 1

print(a)

Fixed submission:
N = int(input())
line = list(map(int,input().split()))
a = 1
m = line[0]
for i in range(N-1):
    if m >= line[i]:
        m = line[i]

    if m >= line[i+1]:
       a += 1

print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
line = list(map(int,input().split()))
a = 0
p = []
for i in line:
    p.append(i)
    if  min(p) >= i:
       a += 1

print(a)

Fixed submission:
N = int(input())
line = list(map(int,input().split()))
a = 1
m = line[0]
for i in range(N-1):
    if m >= line[i]:
        m = line[i]

    if m >= line[i+1]:
       a += 1

print(a)

Buggy python submission (verdict: Runtime Error):
N = int(input())
line = list(map(int,input().split()))
a = 0
p = []
for i in N:
    p.append(N)
    if  min(p) >= N:
       a += 1

print(a)

Fixed submission:
N = int(input())
line = list(map(int,input().split()))
a = 1
m = line[0]
for i in range(N-1):
    if m >= line[i]:
        m = line[i]

    if m >= line[i+1]:
       a += 1

print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
line = list(map(int,input().split()))
a = 0
p = []
for i in range(N):
    p.append(line[i])
    if  min(p) >= line[i]:
       a += 1

print(a)

Fixed submission:
N = int(input())
line = list(map(int,input().split()))
a = 1
m = line[0]
for i in range(N-1):
    if m >= line[i]:
        m = line[i]

    if m >= line[i+1]:
       a += 1

print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
line = list(map(int,input().split()))
a = 0
p = []
for i in range(N):
    p.append(line[i])
    if  min(p) >= line[i]:
       a += 1

print(a)

Fixed submission:
N = int(input())
line = list(map(int,input().split()))
a = 1
m = line[0]
for i in range(N-1):
    if m >= line[i]:
        m = line[i]

    if m >= line[i+1]:
       a += 1

print(a)
Buggy python submission (verdict: Runtime Error):
N = input()

if '7'in N:
  print('Yes')
 else:
  print('No')

Fixed submission:
N = input()
 
if '7'in N:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
List =[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

i = int(input())

print(List[i])

Fixed submission:
List =[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
 
i = int(input())
 
print(List[i-1])
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
l = sum(map(int, input().split()))
print(n-s if s <= n else -1)

Fixed submission:
n, m = map(int, input().split())
s = sum(map(int, input().split()))
print(n-s if s <= n else -1)
Buggy python submission (verdict: Runtime Error):
h = input()
score = 0
fak = 1
while h>1:
	score += fak
	h = int(h/2)
	fak *= 2
print(score+1)

Fixed submission:
h = int(input())
score = 0
fak = 1
while h>1:
	score += fak
	h = int(h/2)
	fak *= 2
print(score+fak)

Buggy python submission (verdict: Runtime Error):
h = input()
score = 0
fak = 1
while h>1:
	score += fak
	h //= 2
	fak *= 2
print(score+1)

Fixed submission:
h = int(input())
score = 0
fak = 1
while h>1:
	score += fak
	h = int(h/2)
	fak *= 2
print(score+fak)
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <map>
typedef int64_t int64;
using namespace std;



int main() {
	int64 n, d, a;
	cin >> n;
	cin >> d;
	cin >> a;
	map<int64, pair<int64, int64>> m;
	for (int64 i=0; i<n; i++) {
		int64 b, c;
		cin >> b;
		cin >> c;
		m[b] = {c, 0};
	}
	int64 destroy = 0;
	int64 bombs = 0;

	for (auto [x, values]: m) {
		auto [health, update] = values;
		health -= destroy;
		if (health > 0) {
			int64 times = (health-1) / a + 1;
			bombs += times;
			if (d==0) continue;
			destroy += times*a;
			if (m.count(x+2*d)) m[x+2*d] = {m[x+2*d].first, times};
			else m[x+2*d] = {0, times};	
		}
		destroy -= update*a;
	}
	cout << bombs;
	return 0;
			
}	


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

D = True

pos = []
pos1 = []

for i in range(n):
	x, h = map(int, input().split())
	pos.append((x, h))

pos.sort(key=lambda x: x[0])

bombs = 0
damage = 0
y, z = 0, 0


while y < n:
	x0 = pos[y][0]
	try:
		x1 = pos1[z][0]
	except IndexError:
		x1 = 1e16
	if x0 <= x1:
		health = pos[y][1]
		health -= damage
		number = max(0, (health-1) // a + 1)
		bombs += number
		damage += number*a
		pos1.append((x0+2*d, number*a))
		y+=1
	else:
		damage -= pos1[z][1]
		z += 1
	

print(bombs)
Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
  	l = list(map(int, input().split()))
   
print(min(n, max(0, min(l)-1)))

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
           
score = 0
m = 1e17
for i in l:
	if i<m:
		m = i
		score += 1
	
print(score)
Buggy python submission (verdict: Runtime Error):
import time

# success
# https://atcoder.jp/contests/abc151/tasks/abc151_e
# https://blogarithms.github.io/articles/2019-01/fermats-theorem


MOD =  1000000007
MOD2 = 1000000005
MAX = 100001

# facs = [1 for _ in range(MAX)]



"""for i in range(1, MAX):
	facs[i] = (facs[i-1] * i) % MOD"""


def get_facs(n, k):
	if k<n-k:
		k = n-k
	r = 1
	for i in range(k+1, n+1):
		r *= i
	for i in range(2, n-k+1):
		r /= i
	return r

def choose(n, k):

	if k==0 or n==k:
		return 1
	if n==0:
		return 0
	if k>n:
		return 0
	return get_facs(n, k)



def main():
	N, K = map(int, input().split())
	numbers = sorted(map(int, input().split()))
	if K==1:
		return 0
	if K==N:
		return abs(numbers[0] - numbers[-1])

	score = 0
	for i, x in enumerate(numbers):
		score += ((choose(i, K-1) - choose(N-1-i, K-1)) * x)

	return int(score%MOD)
	
	
print(main())


Fixed submission:
print(chr(1+ord(input())))

Buggy python submission (verdict: Runtime Error):
print(chr(ord(input())+1)

Fixed submission:
print(chr(1+ord(input())))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
score = [(False, 0) for i in range(n)]
for i in range(m):
	problem, s = input().split()
	p = int(problem)-1
	if not score[p][0]:
		if s=="AC":
			score[p][0] = True
		else:
			score[p][1] += 1
	

print(sum(i[0] for i in score), sum(j if i else 0 for i, j in score))

Fixed submission:
n, m = map(int, input().split())
yes = [False for i in range(n)]
negative = [0 for i in range(n)]
score = [0 for i in range(n)]
for i in range(m):
	problem, s = input().split()
	p = int(problem)
	if s=="AC" and not yes[p-1]:
		yes[p-1] = True
		score[p-1] = negative[p-1]
	else:
		negative[p-1] += 1
	

print(sum(yes), sum(score))
Buggy python submission (verdict: Runtime Error):
def main():
	maximum = 0
	global h, w
	h, w = map(int, input().split())
	street = [[None for i in range(w)] for j in range(h)]
	for y in range(h):
		line = input()
		for x, z in enumerate(line):
			street[y][x] = True if z=="." else False
	for y in range(h):
		for x in range(w):
			if get(x, y, street):
				r = bfs(x, y, [i[::] for i in street])
				print(f"x: {x} and y: {y} and r: {r} and max: {maximum}")
				print(street)
				maximum = max(maximum, r)
	print(maximum)
	return		

def get(x, y, l):
	return l[y][x]

def setter(x, y, z, l):
	l[y][x] = z

def bfs(x, y, visited):
	queue = [(x, y, 0)]
	maximum = 0
	for x, y, d in queue:
		if x>0 and get(x-1, y, visited):
			queue.append((x-1, y, d+1))
			setter(x-1, y, False, visited)
		if x<w-1 and get(x+1, y, visited):
			queue.append((x+1, y, d+1))
			setter(x+1, y, False, visited)
		if y>0 and get(x, y-1, visited):
			queue.append((x, y-1, d+1))
			setter(x, y-1, False, visited)
		if y<h-1 and get(x, y+1, visited):
			queue.append((x, y+1, d+1))
			setter(x, y+1, False, visited)
		maximum = max(maximum, d)
	return maximum



main()

Fixed submission:
def main():
	maximum = 0
	global h, w
	h, w = map(int, input().split())
	street = [[None for i in range(w)] for j in range(h)]
	for y in range(h):
		line = input()
		for x, z in enumerate(line):
			street[y][x] = True if z=="." else False
	for y in range(h):
		for x in range(w):
			if get(x, y, street):
				r = bfs(x, y, [i[::] for i in street])
				# print(f"x: {x} and y: {y} and r: {r} and max: {maximum}")
				# print(street)
				maximum = max(maximum, r)
	print(maximum)
	return		

def get(x, y, l):
	return l[y][x]

def setter(x, y, z, l):
	l[y][x] = z

def bfs(x, y, visited):
	queue = [(x, y, 0)]
	maximum = 0
	setter(x, y, False, visited)
	for x, y, d in queue:
		if x>0 and get(x-1, y, visited):
			queue.append((x-1, y, d+1))
			setter(x-1, y, False, visited)
		if x<w-1 and get(x+1, y, visited):
			queue.append((x+1, y, d+1))
			setter(x+1, y, False, visited)
		if y>0 and get(x, y-1, visited):
			queue.append((x, y-1, d+1))
			setter(x, y-1, False, visited)
		if y<h-1 and get(x, y+1, visited):
			queue.append((x, y+1, d+1))
			setter(x, y+1, False, visited)
		maximum = max(maximum, d)
	return maximum



main()
Buggy python submission (verdict: Runtime Error):
x = int(input())


while True:
	for i in range(2, x**0.5+1):
		if x%i==0:
			x += 1
			break

	print(x)
	break

	

Fixed submission:
x = int(input())


while True:
	for i in range(2, int(x**0.5)+1):
		if x%i==0:
			x += 1
			break
	else:
		print(x)
		break

Buggy python submission (verdict: Runtime Error):
x = int(input())


while True:
	for i in range(2, x**0.5+1):
		if x%i==0:
			continue
	else:
		print(x)
		break
	x += 1
	

Fixed submission:
x = int(input())


while True:
	for i in range(2, int(x**0.5)+1):
		if x%i==0:
			x += 1
			break
	else:
		print(x)
		break
Buggy python submission (verdict: Runtime Error):

import math
a = int(input())
print(2*math.py:a)






Fixed submission:
import math
a = int(input())
print(2*math.pi*a)

Buggy python submission (verdict: Runtime Error):
print(int(input()) * 6.28

Fixed submission:
print(int(input()) * 6.28)

Buggy python submission (verdict: Runtime Error):
2 * R * (3 + 1/10 + 4/100)

Fixed submission:
print(int(input()) * 6.28)

Buggy python submission (verdict: Runtime Error):
import math
2 * R * math.pi

Fixed submission:
print(int(input()) * 6.28)
Buggy python submission (verdict: Time Limit Exceeded):
社員数 = int(input())

上司 = list(map(int, input().split(' ')))

for 社員番号 in range(1, 社員数+1):
    print(上司.count(社員番号))


Fixed submission:
num_employee = int(input())
num_subordinate = [0] * num_employee

for boss in map(int, input().split(' ')):
    num_subordinate[boss-1] += 1

print('\n'.join(map(str, num_subordinate)))

Buggy python submission (verdict: Runtime Error):
社員数 = int(input())

上司 = list(map(int, input.split(' ')))

for 社員番号 in range(1, 社員数+1):
    print(上司.count(社員番号))


Fixed submission:
num_employee = int(input())
num_subordinate = [0] * num_employee

for boss in map(int, input().split(' ')):
    num_subordinate[boss-1] += 1

print('\n'.join(map(str, num_subordinate)))
Buggy python submission (verdict: Runtime Error):
input_str = input().strip()

def main():
  N = len(input_str)
  input_str_part1 = input_str[:int((N-1)/2)]
  input_str_part2 = input_str[int((N+3)/2)-1:]
  flag0 = input_str == input_str[::-1]
  flag1 = input_str_part1 == input_str_part1[::-1]
  flag2 = input_str_part2 == input_str_part2[::-1]
  if flag0 * flag1 * flag2:
    print("Yes")
  else:
	print("No")
  return

if __name__ == "__main__":
  main()

Fixed submission:
input_str = input().strip()

def main():
  N = len(input_str)
  input_str_part1 = input_str[:int((N-1)/2)]
  input_str_part2 = input_str[int((N+3)/2)-1:]
  flag0 = input_str == input_str[::-1]
  flag1 = input_str_part1 == input_str_part1[::-1]
  flag2 = input_str_part2 == input_str_part2[::-1]
  if flag0 * flag1 * flag2:
    print("Yes")
  else:
      print("No")
  return

if __name__ == "__main__":
  main()
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 i in range(N):
  print(ans[i])

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 i in range(N):
  print(ans[i])
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N[0] == 7 or N[1] == 7 or N[2] == 7:
  print("Yes")
else:
  print("No")


Fixed submission:
N = input()
ans = "No"
if N[0] == "7" or N[1] == "7" or N[2] == "7":
  ans = "Yes"
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
while N>0:
  N -= K
print(min(abs(N),N+K))
  

Fixed submission:
N,K = map(int,input().split())
a = N//K
print(min(N-a*K,abs(N-(a+1)*K)))
Buggy python submission (verdict: Runtime Error):
X,Y,A,B,C = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
L = p + r
L.sort(reverse = True)
ans = 0
for i in range(X):
  ans += int(L[i])
for i in range(X):  
  L.remove(L[i])
set(L) = set(L)-set(p)  
M = q + list(L)
M.sort(reverse = True)
abc = 0  
for i in range(Y):
  abc += int(M[i])
print(ans + abc)  

Fixed submission:
X,Y,A,B,C = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort(reverse = True)
q.sort(reverse = True)
a = p[:X] + q[:Y] + r
a.sort(reverse = True)
print(sum(a[:X+Y]))
Buggy python submission (verdict: Time Limit Exceeded):
N,A,B = map(int,input().split())
ans = 0
while N >= A+B:
  N = N -A-B
  ans += 1
if N >= A:
  print(A*(ans+1))
else:
  print(A*ans+N)

Fixed submission:
N,A,B = map(int,input().split())
a = N // (A+B)
b = N - a*(A+B)
if b >= A:
  print(A*(a+1))
else:
  print(A*a+b)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
BS = 1
for i in range(N):
  if a[i] == i:
    BS += 1
if a[i] == 1:
  print(-1)
else:
  print(N+1-BS)

Fixed submission:
A = int(input())
B = int(input())
print(6-A-B)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N % 2 ==0:
  print(1/2)
elif N == 1:
  print(1)
else:
  print((N-N//2)/N)N = int(input())
if N % 2 ==0:
  print(1/2)
elif N == 1:
  print(1)
else:
  print((N-N//2)/N)

Fixed submission:
N = int(input())
if N % 2 ==0:
  print(1/2)
elif N == 1:
  print(1)
else:
  print((N//2+1)/N)
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.index(i)+1,end=" ")

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
D = {}
for i in range(N):
  D[A[i]] = str(i+1)
print(" ".join(D.values()))
Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q = map(int,input().split())
A = []
for i in range(Q):
  A.append(int(input()))
for i in range(1,N+1):
  if K > Q - A.count(i):
    print("Yes")
  else:
    print("No")

Fixed submission:
N,K,Q = map(int,input().split())
A = [K-Q for i in range(N)]
for i in range(Q):
  A[int(input())-1] += 1
for i in range(N):
  print("Yes" if A[i]>0 else "No")
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A+B >= A-B and A+B >= A*B:
  print(A+B)
elif A-B >= A+B and A-B >= A*B:
  print(A-B)
else:
  print(A*B)

Fixed submission:
A,B = map(int,input().split())
print(max(A+B,A-B,A*B))
Buggy python submission (verdict: Runtime Error):
N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=0
a=V[i]-C[i]
for i in range(N):
  if a>0:
    ans+=a
print(ans)    

Fixed submission:
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0
for i in range(N):
  if V[i]-C[i] > 0:
    ans += V[i]-C[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse = True)
if A[M-1] < sum(A)/4/M:
  print("No")
else:
  print("Yes")

Fixed submission:
A,B,K = map(int,input().split())
L = []
for i in range(1,101):
  if A % i == 0 and B % i == 0:
    L.append(i)
S = sorted(L, reverse = True)
print(S[K-1])
Buggy python submission (verdict: Runtime Error):
T,K = map(int,input().split())
print(T/X)

Fixed submission:
T,X = map(int,input().split());print(T/X)
Buggy python submission (verdict: Runtime Error):
S = int(input())
L = []
for i in range(len(S)-2):
  x = int(S[i:i+3])
  y = abs(753-x)
  L.append(y)
print(min(L))

Fixed submission:
S = input()
L = []
for i in range(len(S)-2):
  x = int(S[i:i+3])
  y = abs(753-x)
  L.append(y)
print(min(L))
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
if B >= A and B >= C:
  print(B*10+C+A)
if C >= A and C >= B:
  print(C*10+A+B)
if A >= B and A >= C:
  print(A:10+B+C)

Fixed submission:
L = list(map(int,input().split()))
L.sort(reverse = True)
print(L[0]*10+L[1]+L[2])
Buggy python submission (verdict: Runtime Error):
import math.pi as pi
r  = input()
print(r*r*pi)

Fixed submission:
R = int(input())
print(2*R*3.14159265)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n,k = map(int, input().split())
n = n + 1
mod = 10**9+7
bag = []
ans = 0
for i in range(n):
	bag.append(i)
reverse =  bag[::-1]
for j in range(k, n+1):
	max = np.sum(reverse[:j])
	min = np.sum(bag[:j])
	ans = max-min+1 + ans
ans = ans % mod
print(ans)

Fixed submission:
n,k = map(int, input().split())
AR = n + 1
mod = 10**9+7
ans = 0

def calc_ans(AR,i):
	max = AR*(AR-1)/2 - (AR-i)*(AR-i-1)/2
	min = i*(i-1)/2
	return max - min +1

for i in range(k, AR+1):
	ans += calc_ans(AR,i)

print(int(ans % mod))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
b = [len(i for i in a if i == j) for j in range(n+1)]
print(b[1:])

Fixed submission:
import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
b = np.zeros(n)
for i in a: b[i-1] += 1
for i in b: print(int(i))
Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = (int(i) for i in input().split())


patterns = 0
for i in range(0,N+1,R):
    numredballs = i
    numothers = N - numredballs
    
    for j in range(0,numothers+1,G):
        numgreenballs = j
        numblueballs = numothers - numgreenballs
        
        if numblueballs % B != 0:
            continue
        else:
            numgreenboxes = numgreenballs % G
            numblueboxes = numblueballs % B
            patterns += 1

print(patterns)

Fixed submission:
R,G,B,N = (int(i) for i in input().split())

patterns = 0
for i in range(0,N+1,R):
    numredballs = i
    numothers = N - numredballs
    
    for j in range(0,numothers+1,G):
        numgreenballs = j
        numblueballs = numothers - numgreenballs
        
        if numblueballs % B != 0:
            continue
        else:
            patterns += 1

print(patterns)