Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int, input().split())
K2 = 2*K
inmap = [[0]*(K) for _ in range(K2)]
accmap = [[0]*(K+1) for _ in range(K2+1)]
inmapdeb = {}
for i in range(N):
    line = input().split()
    x, y, wb = int(line[0]), int(line[1]), line[2]
    if wb == 'W':
        x += K
    y %= K2
    if y >= K:
        y = y%K
        x = (x+K) %K2
    else:
        x = x % K2
    inmap[x][y] += 1
#     if not (x,y) in inmapdeb:
#         inmapdeb[(x,y)] = 1
#     else:
#         inmapdeb[(x,y)] += 1
# print(inmapdeb)

for i in range(K2):
    for j in range(K):
        accmap[i+1][j+1] = inmap[i][j] + accmap[i+1][j] + accmap[i][j+1] - accmap[i][j]

res = 0
for i in range(K):
    for j in range(K):
        # print(i,j)
        cand = 2*(accmap[i][j] - accmap[i+K][j]) + accmap[i+K][K] - accmap[i][K] + accmap[K2][j]
        # print("i{} j{} res:{}".format(i,j,cand))
        res = max(res, cand, N-cand)

print(res)


Fixed submission:
N,K=map(int, input().split())
K2 = 2*K
inmap = [[0]*(K) for _ in range(K2)]
accmap = [[0]*(K+1) for _ in range(K2+1)]
inmapdeb = {}
for i in range(N):
    line = input().split()
    x, y, wb = int(line[0]), int(line[1]), line[2]
    if wb == 'W':
        x += K
    y %= K2
    if y >= K:
        y = y%K
        x = (x+K) %K2
    else:
        x = x % K2
    inmap[x][y] += 1
#     if not (x,y) in inmapdeb:
#         inmapdeb[(x,y)] = 1
#     else:
#         inmapdeb[(x,y)] += 1
# print(inmapdeb)

def calc(x, y):
    return accmap[x][y] \
        + (accmap[x+K][K] - accmap[x][K] - accmap[x+K][y] + accmap[x][y]) \
        + (accmap[K2][y] - accmap[x+K][y])

for i in range(K2):
    for j in range(K):
        accmap[i+1][j+1] = inmap[i][j] + accmap[i+1][j] + accmap[i][j+1] - accmap[i][j]

res = 0
for i in range(K):
    for j in range(K):
        # print(i,j)
        cand = calc(i, j)
        # print("i{} j{} res:{}".format(i,j,cand))
        res = max(res, cand, N-cand)

print(res)
Buggy python submission (verdict: Runtime Error):
import heapq

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

inl = [tuple(map(int, input().split())) for i in range(N)]
inl.sort(reverse=True)

heap = []

res = 0


for i in range(1, 10001):
    nex = set([])
    rem = set([])

    con = 0
    while inl and inl[-1][0] == i:
        s,t,c = inl.pop()
        nex.add((s,c))
        heapq.heappush(heap, (t,c))

    while heap and heap[0][0] == i:
        t1,c1 = heapq.heappop(heap)
        rem.add((t1,c1))

    con = len(heap) + min(len(nex), len(rem))
    res = max(res, con)

print(res)


Fixed submission:
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
MOD = 1000000007
def POW(x, y): return pow(x, y, MOD)
def INV(x, m=MOD): return pow(x, m - 2, m)
def DIV(x, y, m=MOD): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()

N,A,B=LI()

print(min(N*A,B))
Buggy python submission (verdict: Runtime Error):
N,Z,W=map(int, input().split())
INL = list(map(int,input().split()))
INVL = {v:i for i, v in enumerate(INL)}

class BitMAX:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)
 
    def sum(self, i):
        s = 0
        while i > 0:
            s = max(self.tree[i],s)
            i -= i & -i
        return s
 
    def add(self, i, x):
        while i <= self.size:
            self.tree[i] = max(x, self.tree[i])
            i += i & -i
    
    def reset(self):
        t = self.tree
        for i in range(len(t)):
            t[i] = 0

class BitMIN:
    def __init__(self, n):
        self.size = n
        self.tree = [10**9+1] * (n + 1)
 
    def sum(self, i):
        s = 0
        while i > 0:
            s = min(self.tree[i],s)
            i -= i & -i
        return s
 
    def add(self, i, x):
        while i <= self.size:
            self.tree[i] = min(x, self.tree[i])
            i += i & -i
    
    def reset(self):
        t = self.tree
        for i in range(len(t)):
            t[i] = 0

bit_max = BitMAX(3000)
bit_min = BitMIN(3000)

offset = 2500

for i, v in enumerate(INL):
    bit_max.add(offset-i, v)
    bit_min.add(offset-i, v)

pos = 0
while pos < len(INL):
    ma = bit_max.sum(offset-pos)
    mi = bit_min.sum(offset-pos)
    if abs(W-ma) > abs(W-mi):
        Z = ma
        pos = INVL[ma]+1
    else:
        Z = mi
        pos = INVL[mi]+1
    # print("A pos: {}".format(pos))

    if pos < len(INL):
        ma = bit_max.sum(offset-pos)
        mi = bit_min.sum(offset-pos)
        if abs(Z-ma) < abs(Z-mi):
            W = ma
            pos = INVL[ma]+1
        else:
            W = mi
            pos = INVL[mi]+1
        # print("B pos: {}".format(pos))

print(abs(Z-W))


Fixed submission:
N,Z,W=map(int, input().split())
INL = list(map(int,input().split()))

if N == 1:
    print(abs(INL[0]-W))
else:
    print(max(abs(W-INL[-1]), abs(INL[-2]-INL[-1])))
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
N,K=map(int,input().split())

xs = set()
ys = set()
inl = []

for i in range(N):
    x,y=map(int,input().split())
    inl.append((x,y))
    xs.add(x)
    ys.add(y)

xs = list(xs)
ys = list(ys)
xs.sort()
ys.sort()

res = 9223372036854775807
for xlow, xhi in combinations(xs,2):
    for ylow, yhi in combinations(ys,2):
        cnt = 0
        for x, y in inl:
            cnt += (x >= xlow and x <= xhi and y >= ylow and y <= yhi)
        if cnt == K:
            res = min(res,(xhi - xlow) * (yhi - ylow))
print(res)


Fixed submission:
from itertools import combinations
N,K=map(int,input().split())

xs = set()
ys = set()
inl = []

for i in range(N):
    x,y=map(int,input().split())
    inl.append((x,y))
    xs.add(x)
    ys.add(y)

xs = list(xs)
ys = list(ys)
xs.sort()
ys.sort()

res = 9223372036854775807
for xlow, xhi in combinations(xs,2):
    for ylow, yhi in combinations(ys,2):
        cnt = 0
        for x, y in inl:
            cnt += (x >= xlow and x <= xhi and y >= ylow and y <= yhi)
        if cnt == K:
            res = min(res,(xhi - xlow) * (yhi - ylow))
print(res)
Buggy python submission (verdict: Runtime Error):
N=int(input())
INL=list(map(int,input().split()))

swp = 0
for i in range(0, N):
    if i+1 == INL[i]:
        INL[i] = INL[i] ^ INL[i+1]
        INL[i+1] = INL[i] ^ INL[i+1]
        INL[i] = INL[i] ^ INL[i+1]
        swp += 1

print(swp)


Fixed submission:
N=int(input())
INL=list(map(int,input().split()))

swp = 0
for i in range(0, N-1):
    if i+1 == INL[i]:
        INL[i] = INL[i] ^ INL[i+1]
        INL[i+1] = INL[i] ^ INL[i+1]
        INL[i] = INL[i] ^ INL[i+1]
        swp += 1

if INL[N-1] == N:
    INL[N-1], INL[N-2] = INL[N-2], INL[N-1]
    swp += 1

print(swp)

Buggy python submission (verdict: Runtime Error):
N=int(input())
INL=list(map(int,input().split()))

swp = 0
for i in range(0, N):
    if i+1 == INL[i]:
        INL[i], INL[i+1] = INL[i+1], INL[i]
        swp += 1

print(swp)


Fixed submission:
N=int(input())
INL=list(map(int,input().split()))

swp = 0
for i in range(0, N-1):
    if i+1 == INL[i]:
        INL[i] = INL[i] ^ INL[i+1]
        INL[i+1] = INL[i] ^ INL[i+1]
        INL[i] = INL[i] ^ INL[i+1]
        swp += 1

if INL[N-1] == N:
    INL[N-1], INL[N-2] = INL[N-2], INL[N-1]
    swp += 1

print(swp)

Buggy python submission (verdict: Runtime Error):
N=int(input())
INL=list(map(int,input().split()))

swp = 0
for i in range(0, N):
    if i+1 == INL[i]:
        INL[i], INL[i+1] = INL[i+1], INL[i]
        swp += 1

print(swp)


Fixed submission:
N=int(input())
INL=list(map(int,input().split()))

swp = 0
for i in range(0, N-1):
    if i+1 == INL[i]:
        INL[i] = INL[i] ^ INL[i+1]
        INL[i+1] = INL[i] ^ INL[i+1]
        INL[i] = INL[i] ^ INL[i+1]
        swp += 1

if INL[N-1] == N:
    INL[N-1], INL[N-2] = INL[N-2], INL[N-1]
    swp += 1

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

NODES={}
for i in range(N-1):
    a,b,c=map(int,input().split())
    if not a in NODES:
        NODES[a] = []
    if not b in NODES:
        NODES[b] = []
    NODES[a].append((b, c))
    NODES[b].append((a, c))

Q,K=map(int,input().split())
MP=[-1]*(N+1)
MP[K]=0
def dfs(k):
    for i, c in NODES[k]:
        if MP[i] == -1:
            MP[i] = MP[k] + c
            dfs(i)

dfs(K)
# print(MP)
for l,r in [tuple(map(int,input().split())) for _ in range(Q)]:
    print(MP[l]+MP[r])


Fixed submission:
import sys
sys.setrecursionlimit(10**7)
N=int(input())

NODES={}
for i in range(N-1):
    a,b,c=map(int,input().split())
    if not a in NODES: NODES[a] = []
    if not b in NODES: NODES[b] = []
    NODES[a].append((b, c))
    NODES[b].append((a, c))

Q,K=map(int,input().split())
MP=[-1]*(N+1)
MP[K]=0
def dfs(k):
    for i, c in NODES[k]:
        if MP[i] == -1:
            MP[i] = MP[k] + c
            dfs(i)

dfs(K)
# print(MP)
for l,r in [tuple(map(int,input().split())) for _ in range(Q)]:
    print(MP[l]+MP[r])
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(sys.stdin.readline())
li = list(map(int, sys.stdin.readline().split()))
res = 1
for i in range(n):
    res *= li[i]
print(res) if res <= 10**18 else print(-1)

Fixed submission:
import sys
n = int(sys.stdin.readline())
li = list(map(int, sys.stdin.readline().split()))
if 0 in li:
    print(0)
    exit()
res = 1
for i in range(n):
    res *= li[i]
    if res > 1000000000000000000:
        print(-1)
        exit(0)
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int, input().split()))
res = 1
for i in li:
    res *= i
print(res) if res <= 10**18 else print(-1)

Fixed submission:
import sys
n = int(sys.stdin.readline())
li = list(map(int, sys.stdin.readline().split()))
if 0 in li:
    print(0)
    exit()
res = 1
for i in range(n):
    res *= li[i]
    if res > 1000000000000000000:
        print(-1)
        exit(0)
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int, input().split()))
res = 1
for i in li:
    res *= i
print(res) if res <= 10**18 else print(-1)

Fixed submission:
import sys
n = int(sys.stdin.readline())
li = list(map(int, sys.stdin.readline().split()))
if 0 in li:
    print(0)
    exit()
res = 1
for i in range(n):
    res *= li[i]
    if res > 1000000000000000000:
        print(-1)
        exit(0)
print(res)

Buggy python submission (verdict: Runtime Error):
/*
  -> Do Good Die Great
*/
#include <bits/stdc++.h>
#define int long long int
#define pii pair<int, int>
#define rep(s, e) for (int i = s; i < e; i++)
#define reep(s, e) for (int i = s; i <= e; i++)
#define ff first
#define ss second
#define eb emplace_back
#define pb push_back
#define MOD 1000000007
#define Hiraishin                     \
    ios_base::sync_with_stdio(false); \
    cin.tie(nullptr);                 \
    cout.tie(nullptr);
#define tests \
    int t;    \
    cin >> t; \
    while (t--)
using namespace std;

// global
const int mx = 1ull * pow(10, 18);

void solve()
{
    int n;
    cin >> n;
    int res = 1ull;
    while (n--) {
        int t;
        cin >> t;
        res *= t;
    }
    cout << (res <= mx ? res : -1);
}

signed main()
{
    Hiraishin
    //tests
    solve();
    return 0;
}

Fixed submission:
import sys
n = int(sys.stdin.readline())
li = list(map(int, sys.stdin.readline().split()))
if 0 in li:
    print(0)
    exit()
res = 1
for i in range(n):
    res *= li[i]
    if res > 1000000000000000000:
        print(-1)
        exit(0)
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c = map(int, input().split())
while c:
  if c > a:
    c -= a
    a = 0
    b -= c
  else:
    a -= c
    c = 0
print(a, b)

Fixed submission:
a, b, c = map(int, input().split())
if c > a:
	c -= a
	a = 0
	b = max(0, b-c)
else:
	a -= c
print(a, b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n % 615 == 0:
	print(1)
else:
	if n%100 == 0 or n%101==0 or n%102 == 0 or n%103==0 or n%104==0 or n%105==0:
		print(1)
	elif n%209==0 or n%206==0 or n%207==0 or n%208==0 or n%201 ==0 or n%202 == 0 or n%203==0 or n%204 == 0 or n%205 == 0:
		print(1)
	else:
		print(0)

Fixed submission:
#ossan
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())
if d2 == 1:
	print(1)
else:
	print(0)

Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(1, 100001):
	if i*(615) == n:
		c = i
		break
try:
	if c > 0:
		print(1)
except:
	print(0)

Fixed submission:
#ossan
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())
if d2 == 1:
	print(1)
else:
	print(0)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n % 615 == 0:
	print(1)
else:
	if n%100 == 0 or n%101==0 or n%102 == 0 or n%103==0 or n%104==0 or n%105==0:
		print(1)
	elif n% 209 == 0 n%206==0 or n%207==0 or n%208==0 or n%201 ==0 or n%202 == 0 or n%203==0 or n%204 == 0 or n%205 == 0:
		print(1)
	elif n%303 == 0 or n% n%304 ==0 or n%305 == 0 or n%306 == 0 or n%307==0 or n%308==0 or n%309==0 or n%310 == 0 or n%311==0 or n%312==0:
		print(1)
	elif n%406==0 or n%407==0 or n%408==0 or n%409==0 or n%410==0 or n%411==0 or n%412==0 or n%413==0 or n%414==0:
		print(1)
	elif n%510==0 or n%511==0 or n%512==0 or n%513==0 or n%514==0 or n%515==0:
		print(1)
	else:
		print(0)

Fixed submission:
coin = [100, 101, 102, 103, 104, 105]
X = int(input())
dp = [0]*(X+5)
dp[0]=1
for i in coin:
	for j in range(X+5):
		if i<=j:
			if dp[j-i]:
				dp[j]=1
print(1) if dp[X] else print(0)

Buggy python submission (verdict: Runtime Error):
n = int(input())
if n % 615 == 0:
	print(1)
else:
	if n%100 == 0 or n%101==0 or n%102 == 0 or n%103==0 or n%104==0 or n%105==0:
		print(1)
	elif n%206==0 or n%207==0 or n%208==0 or n%201 ==0 or n%202 == 0 or n%203==0 or n%204 == 0 or n%205 == 0:
		print(1)
	elif n%303 == 0 or n% n%304 ==0 or n%305 == 0 or n%306 == 0 or n%307==0 or n%308==0 or n%309==0 or n%310 == 0 or n%311==0 or n%312==0:
		print(1)
	elif n%406==0 or n%407==0 or n%408==0 or n%409==0 or n%410==0 or n%411==0or n%412==0 or n%413==0 or n%414==0:
		print(1)
	elif n%510==0or n%511==0 or n%512==0 or n%513==0 or n%514==0 or n%515==0:
		print(1)
	else:
		print(0)

Fixed submission:
coin = [100, 101, 102, 103, 104, 105]
X = int(input())
dp = [0]*(X+5)
dp[0]=1
for i in coin:
	for j in range(X+5):
		if i<=j:
			if dp[j-i]:
				dp[j]=1
print(1) if dp[X] else print(0)
Buggy python submission (verdict: Runtime Error):
def bin_search(l, r, x):
	if x > 1e9:
		return 1e9
	mid = (l+r)//2
	if r-l == 1:
		if a*r+ b*len(str(r)) <= x:
			return int(r)
		elif a*l+ b*len(str(l)) <= x:
			return int(l)
		else:
			return 0
	elif a*mid+b*len(str(mid)) > x:
		return bin_search(l, mid-1, x)
	else:
		return bin_search(mid+1, r, x)


a, b, x = map(int, input().split())
if a+b > x:
	print(0)
else:
	print(bin_search(1, 1e9, x))

Fixed submission:
s = input()
if s == 'MON':
	print(6)
elif s == 'TUE':
	print(5)
elif s == 'WED':
	print(4)
elif s == 'THU':
	print(3)
elif s == 'FRI':
	print(2)
elif s == 'SAT':
	print(1)
else:
	print(7)
Buggy python submission (verdict: Runtime Error):
def factors(n):    
    return set(reduce(list.__add__, 
                ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))

def prime(n1):
	for i in range(2, int(math.sqrt(n1))+1):
		if n1%i == 0:
			return False
	return True

n = int(input())
if prime(n):
	print(n - 1)
else:
	k = sorted(list(factors(n)))
	#print(k)
	if len(k) %2 != 0:
		if k[len(k)//2]*k[len(k)//2] == n:
			print(2*k[len(k)//2] - 2)
		#else:

	else:
		s = k[len(k)//2 - 1] + k[len(k)//2]
		print(s - 2)


Fixed submission:
import math
from functools import reduce

def factors(n):    
    return set(reduce(list.__add__, 
                ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))

def prime(n1):
	for i in range(2, int(math.sqrt(n1))+1):
		if n1%i == 0:
			return False
	return True

n = int(input())
if prime(n):
	print(n - 1)
else:
	k = sorted(list(factors(n)))
	#print(k)
	if len(k) % 2 != 0:
		if k[len(k)//2]*k[len(k)//2] == n:
			print(2*k[len(k)//2] - 2)
		#else:

	else:
		s = k[len(k)//2 - 1] + k[len(k)//2]
		print(s - 2)

Buggy python submission (verdict: Runtime Error):
def factors(n):    
    return set(reduce(list.__add__, 
                ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))

def prime(n1):
	for i in range(2, n1//2):
		if n1%i == 0:
			return False
	return True

n = int(input())
if prime(n):
	print(n - 1)
else:
	k = sorted(list(factors(n)))
	#print(k)
	s = k[len(k)//2 - 1] + k[len(k)//2]
	print(s - 2)


Fixed submission:
import math
from functools import reduce

def factors(n):    
    return set(reduce(list.__add__, 
                ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))

def prime(n1):
	for i in range(2, int(math.sqrt(n1))+1):
		if n1%i == 0:
			return False
	return True

n = int(input())
if prime(n):
	print(n - 1)
else:
	k = sorted(list(factors(n)))
	#print(k)
	if len(k) % 2 != 0:
		if k[len(k)//2]*k[len(k)//2] == n:
			print(2*k[len(k)//2] - 2)
		#else:

	else:
		s = k[len(k)//2 - 1] + k[len(k)//2]
		print(s - 2)
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
n = int(input())
l = [int(x) for x in input().split()]
l1 = list(combinations(l, 3))
c = 0
for i in l1:
	if i[0] < i[1] + i[2] and i[1] < i[0] + i[2] and i[2] < i[0] + i[1]:
		c += 1
print(c)

Fixed submission:
def findnumberofTriangles(arr): 
  
    # Sort array and initialize count as 0 
    n = len(arr) 
    arr.sort() 
    count = 0
  
    # Fix the first element. We need to run till n-3 as 
    # the other two elements are selected from arr[i+1...n-1] 
    for i in range(0,n-2): 
  
        # Initialize index of the rightmost third element 
        k = i + 2
  
        # Fix the second element 
        for j in range(i+1,n): 
  
            # Find the rightmost element which is smaller 
            # than the sum of two fixed elements 
            # The important thing to note here is, we use 
            # the previous value of k. If value of arr[i] + 
            # arr[j-1] was greater than arr[k], then arr[i] + 
            # arr[j] must be greater than k, because the array 
            # is sorted. 
            while (k < n and arr[i] + arr[j] > arr[k]): 
                k += 1
  
            # Total number of possible triangles that can be 
            # formed with the two fixed elements is k - j - 1. 
            # The two fixed elements are arr[i] and arr[j]. All 
            # elements between arr[j+1] to arr[k-1] can form a 
            # triangle with arr[i] and arr[j]. One is subtracted 
            # from k because k is incremented one extra in above 
            # while loop. k will always be greater than j. If j 
            # becomes equal to k, then above loop will increment k, 
            # because arr[k] + arr[i] is always greater than arr[k] 
            if(k>j): 
                count += k - j - 1
  
    return count
n = int(input())
l = [int(x) for x in input().split()]
print(findnumberofTriangles(l))
Buggy python submission (verdict: Runtime Error):
from functools import reduce


def factors(n):
    return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))


a1, b1 = map(int, input().split())
temp = factors(a1).intersection(factors(b1))
s = set(range(2, max(temp)))
li = []
while s:
    m = min(s)
    li.append(m)
    s -= set(range(m, max(temp) + 1, m))
c = 0
for i in temp:
    if i == 1:
        c += 1
    if i in li:
        c += 1
print(c)


Fixed submission:
n = int(input())
if n % 2 == 0:
    print(str.format('{0:.9f}', (n//2)/n))
else:
    print(str.format('{0:.9f}', ((n//2)+1)/n))
Buggy python submission (verdict: Runtime Error):
n = int(input())
height = list(map(int, input().split()))
li = []
max_height = max(height)
for i in range(n - 1):
    sl = height[i + 1:]
    if sl == sorted(sl,reverse=True):
        count = len(sl)-1
        break
    else:
        pass
print(count)


Fixed submission:
n = int(input())
c = 0
l = []
li = list(map(int, input().split()))
for i in range(1, n):
	if li[i-1] >= li[i]:
		c += 1
		#print('k', li[i])
	else:
		#print(li[i])
		l.append(c) 
		c = 0
l.append(c)
print(max(l))
Buggy python submission (verdict: Runtime Error):
n = int(input())
arr = list(map(int,input()))
total = 0
for i in range(n):
  total += (1/arr[i])
 print(1/total)
  

Fixed submission:
n = int(input())
arr = list(map(int,input().split()))
total = 0
for i in range(n):
    total += (1/arr[i])
print(1/total)
Buggy python submission (verdict: Runtime Error):
li = list(map(int,input().split()))
li1 = []
for i in range(len(list)):
  li1.append(li[i]+li[i+1])
  li1.append(li[i]*li[i+1])
  li1.append(li[i]-li[i+1])
print(max(li1))


Fixed submission:
li = list(map(int,input().split()))
li1 = [li[0] + li[1], li[0] * li[1], li[0] - li[1]]
print(max(li1))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
string = [input() for i in range(n)]
string2 = [''.join(sorted(x)) for x in string]
count = 0
for i in range(n-1):
    for j in range(i+1, n):
        if string2[i] == string2[j]:
            count += 1

print(count)
#print(string2)


Fixed submission:
import math
def combo(a):
    return (math.factorial(a))/(math.factorial(a-2)*2)

from collections import Counter
n = int(input())
count = 0
string = [input() for i in range(n)]
string2 = [''.join(sorted(x)) for x in string]

'''for i in range(n-1):
    for j in range(i+1, n):
        if string2[i] == string2[j]:
            count += 1'''
li = Counter(string2)
li1=[[key,value] for key, value in li.items()]
for i in range(len(li1)):
    if li1[i][1] == 1:
        li1[i][1] = 0
for i in range(len(li1)):
    if li1[i][1] != 0:
        li1[i][1] = combo(li1[i][1])
for i in range(len(li1)):
    count += li1[i][1]
print(int(count))
Buggy python submission (verdict: Runtime Error):
a=int(input())
input(a+a*a+a**3)

Fixed submission:
a=int(input())
print(a+a*a+a*a*a)
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().rstrip().split(" ")
print(A*B)

Fixed submission:
A,B=map(int,input().rstrip().split(" "))
print(A*B)

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().rstop().split(" ")
print(A*B)

Fixed submission:
A,B=map(int,input().rstrip().split(" "))
print(A*B)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
A = list(map(int,input().split()))

ans = [1] * (N-K+1)

for i in range(K):
    ans[0] *= A[i]

for j in range(1,N-K+1):
    ans[j] = ans[j-1] * A[j+K-1] / A[j-1] 
    if ans[j] > ans[j-1]:
        print('Yes')
    else:
        print('No')


Fixed submission:
N,K = map(int,input().split())
A = list(map(int,input().split()))

for i in range(N-K):
    if A[i] < A[i+K]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())

result = [input() for _ in range(N)]

C_AC,C_TLE,C_WA,C_RE = [0,0,0,0]

for i in result:
  if i == "AC":
    C_AC += 1
  elif i == "WA":
    C_WA += 1
  elif i == "TLE":
    C_TLE += 1
  elif i == "RE":
    C_RE += 1

print("AC x " + str(C_AC))
print("WA x " + str(C_WA))
print("TLE x " + str(C_TLE))
print("RE x " + str(C_RE))

Fixed submission:
N = input()
Num = int(N)

while Num > 0:
    OTURI = 1000 - Num
    Num -= 1000
  
print(OTURI)

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

while N > 0:
  OTURI = 1000 - N
  N -= 1000
  
print(OTURI)

Fixed submission:
N = input()
Num = int(N)

while Num > 0:
    OTURI = 1000 - Num
    Num -= 1000
  
print(OTURI)

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

While N > 0:
  OTURI = 1000 - N
  N -= 1000
  
print(OTURI)

Fixed submission:
N = input()
Num = int(N)

while Num > 0:
    OTURI = 1000 - Num
    Num -= 1000
  
print(OTURI)
Buggy python submission (verdict: Runtime Error):
X,Y = map(int,input().split())

for i in range(X+1):
    if 2*i + 4*(X-i) == Y:
        print('YES')
    if i == X:
        prinnt('NO')

Fixed submission:
import sys
X,Y = map(int,input().split())


for i in range(X+1):
    if 2*i + 4*(X-i) == Y:
        print('Yes')
        sys.exit()
print('No')