Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
if sum(a) % (n * (n + 1) // 2) != 0:
	print("NO")
else:
	k = sum(a) // (n * (n + 1) // 2)
	ok = True
	for i in range(n - 1):
		if (a[i] + k) % n != a[i + 1] % n or a[i] + k < a[i + 1]:
			ok = False
			break
	if (a[-1] + k) % n != a[0] % n or a[-1] + k < a[i + 1]:
		ok = False

	if ok:
		print("YES")
	else:
		print("NO")

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
if sum(a) % (n * (n + 1) // 2) != 0:
	print("NO")
else:
	k = sum(a) // (n * (n + 1) // 2)
	ok = True
	for i in range(n - 1):
		if (a[i] + k) % n != a[i + 1] % n or a[i] + k < a[i + 1]:
			ok = False
			break
	if (a[-1] + k) % n != a[0] % n or a[-1] + k < a[0]:
		ok = False

	if ok:
		print("YES")
	else:
		print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
import sys
def input():
	return sys.stdin.readline()[:-1]

class BIT():#1-indexed
	def __init__(self, size):
		self.table = [0 for _ in range(size+2)]
		self.size = size

	def Sum(self, i):#1からiまでの和
		s = 0
		while i > 0:
			s += self.table[i]
			i -= (i & -i)
		return s

	def PointAdd(self, i, x):#
		while i <= self.size:
			self.table[i] += x
			i += (i & -i)
		return

	def SegAdd(self, l, r, x):#lからrにxを足す
		self.PointAdd(l, x)
		self.PointAdd(r+1, -x)
		return

n, m = map(int, input().split())
s = [list(map(int, input().split())) for _ in range(n)]
s.sort(key=lambda x: x[1]-x[0])
b = BIT(m)

too_long = n #r-l+1よりも大きい区間（必ず訪れる）
cur = 0
for i in range(1, m+1):
	while cur < n and s[cur][1]-s[cur][0]+1 < i:
		too_long -= 1
		b.SegAdd(s[cur][0], s[cur][1], 1)
		cur += 1
	ans = too_long
	for j in range(i, m+1, i):
		ans += b.Sum(j)
	print(ans)

Fixed submission:
import sys
def input():
	return sys.stdin.readline()[:-1]

class BIT():#1-indexed
	def __init__(self, size):
		self.table = [0 for _ in range(size+2)]
		self.size = size

	def Sum(self, i):#1からiまでの和
		s = 0
		while i > 0:
			s += self.table[i]
			i -= (i & -i)
		return s

	def PointAdd(self, i, x):#
		while i <= self.size:
			self.table[i] += x
			i += (i & -i)
		return

	def SegAdd(self, l, r, x):#lからrにxを足す
		self.PointAdd(l, x)
		self.PointAdd(r+1, -x)
		return

n, m = map(int, input().split())
s = [list(map(int, input().split())) for _ in range(n)]
s.sort(key=lambda x: x[1]-x[0])
b = BIT(m)

too_long = n #r-l+1よりも大きい区間（必ず訪れる）
cur = 0
for i in range(1, m+1):
	while cur < n and s[cur][1]-s[cur][0]+1 < i:
		too_long -= 1
		b.SegAdd(s[cur][0], s[cur][1], 1)
		cur += 1
	ans = too_long
	for j in range(i, m+1, i):
		ans += b.Sum(j)
	print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

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

def beki(n):
    ans = 1
    for _ in range(int(n)):
        ans = (ans * 2) % (10 ** 9 + 7)
    return int(ans)

if n % 2 == 0:
    i = 1
    while True:
        if i in a:
            a.remove(i)
        else:
            print(0)
            sys.exit()
        if i in a:
            a.remove(i)
        else:
            print(0)
            sys.exit()
        i += 2
        if a == []:
            break       
    print(beki(n / 2))

elif n == 1:
    if a == [0]:
        print("1")
    else:
        print("0")
else:
    i = 2
    while True:
        if i in a:
            a.remove(i)
        else:
            print(0)
            sys.exit()
        if i in a:
            a.remove(i)
        else:
            print(0)
            sys.exit()
        i += 2
        if a == [0]:
            break
    print(beki((n - 1) / 2))

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

def beki(n):
    ans = 1
    for _ in range(int(n)):
        ans = (ans * 2) % (10 ** 9 + 7)
    return int(ans)

if n % 2 == 0:
    hikaku = []
    for i in range(1, n, 2):
        hikaku += [i, i]
    if sorted(a) == hikaku:
        print(beki(n / 2))
    else:
        print(0)

elif n == 1:
    if a == [0]:
        print(1)
    else:
        print(0)
else:
    hikaku = [0]
    for i in range(2, n, 2):
        hikaku += [i, i]
    if sorted(a) == hikaku:
        print(beki((n - 1) / 2))
    else:
        print(0)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict

n, k, l = map(int, input().split())

class UnionFind():
	def __init__(self, size):
		self.table = [-1 for _ in range(size)]

#	def find(self, x):
#		while self.table[x] >= 0:
#			x = self.table[x]
#		return x

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


	def union(self, x, y):
		s1 = self.find(x)
		s2 = self.find(y)
		if s1 != s2:
			if self.table[s1] > self.table[s2]:
				self.table[s2] = s1
			elif self.table[s1] < self.table[s2]:
				self.table[s1] = s2
			else:
				self.table[s1] = s2
				self.table[s2] -= 1
		return

road = UnionFind(n)
train = UnionFind(n)

for _ in range(k):
	a, b = map(int, input().split())
	road.union(a - 1, b - 1)

for _ in range(l):
	a, b = map(int, input().split())
	train.union(a - 1, b - 1)

road_root = []
for i in range(n):
	num = road.find(i)
	road_root.append(num)

train_root = []
for i in range(n):
	num = train.find(i)
	train_root.append(num)

count = defaultdict(int)
for i in range(n):
	count[road_root[i] * (10 ** 6) +  train_root[i]] += 1

ans = []
for i in range(n):
	ans.append(count[road_root[i] * (10 ** 6) +  train_root[i]])

print(*ans)


Fixed submission:
from collections import defaultdict

n, k, l = map(int, input().split())

class UnionFind():
	def __init__(self, size):
		self.table = [-1 for _ in range(size)]

#	def find(self, x):
#		while self.table[x] >= 0:
#			x = self.table[x]
#		return x

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


	def union(self, x, y):
		s1 = self.find(x)
		s2 = self.find(y)
		if s1 != s2:
			if self.table[s1] > self.table[s2]:
				self.table[s2] = s1
			elif self.table[s1] < self.table[s2]:
				self.table[s1] = s2
			else:
				self.table[s1] = s2
				self.table[s2] -= 1
		return

road = UnionFind(n)
train = UnionFind(n)

for _ in range(k):
	a, b = map(int, input().split())
	road.union(a - 1, b - 1)

for _ in range(l):
	a, b = map(int, input().split())
	train.union(a - 1, b - 1)

road_root = []
for i in range(n):
	num = road.find(i)
	road_root.append(num)

train_root = []
for i in range(n):
	num = train.find(i)
	train_root.append(num)

count = defaultdict(int)
for i in range(n):
	count[road_root[i] * (10 ** 6) +  train_root[i]] += 1

ans = []
for i in range(n):
	ans.append(count[road_root[i] * (10 ** 6) +  train_root[i]])

print(*ans)
Buggy python submission (verdict: Runtime Error):
a, b, x = list(map(int, input().split()))

ans = 0
for i in range(a, b + 1):
    if i % x == 0:
        ans += 1
        
print(ans)


Fixed submission:
print("A" + list(input().split()[1])[0] + "C")
Buggy python submission (verdict: Runtime Error):
a, b, x = list(map(int, input().split()))

ans = 0
for i in range(a, b + 1):
	if i % x == 0:
    	ans += 1
        
print(ans)

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

if a == 0:
    print(b // x + 1)
else:
    print(b // x - (a - 1) // x)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from math import sqrt
def input():
	return sys.stdin.readline()[:-1]

import heapq
class DijkstraMatrix():
	#隣接行列版
	#同一頂点の複数回探索を防ぐため訪問した頂点数を変数cntで持つ
	def __init__(self, matrix, start):
		self.matrix = matrix
		self.start = start
		self.size = len(matrix)

	def solve(self):
		self.dist = [float("inf") for _ in range(self.size)]
		self.dist[self.start] = 0
		self.prev = [-1 for _ in range(self.size)]
		self.q = []
		self.cnt = 0

		heapq.heappush(self.q, (0, self.start))

		while self.q and self.cnt < self.size:
			u_dist, u = heapq.heappop(self.q)
			if self.dist[u] < u_dist:
				continue
				#これいる？
			for v in range(self.size):
				w = self.matrix[u][v]
				if self.dist[v] > u_dist + w:
					self.dist[v] = u_dist + w
					self.prev[v] = u
					heapq.heappush(self.q, (self.dist[v], v))

			self.cnt += 1

		return

	def distance(self, goal):
		return self.dist[goal]

	def path(self, goal):
		self.path = [goal]
		while self.path[-1] != self.start:
			self.path.append(self.prev[self.path[-1]])
		return self.path[::-1]

xs, ys, xt, yt = map(int, input().split())
n = int(input())
b = [[xs, ys, 0], [xt, yt, 0]] + [list(map(int, input().split())) for _ in range(n)]
d = [[float("inf") for _ in range(n+2)] for _ in range(n+2)]

for i in range(n+2):
	for j in range(n+2):
		if i != j:
			d[i][j] = max(sqrt((b[i][0] - b[j][0])**2 + (b[i][1] - b[j][1])**2) - b[i][2] - b[j][2], 0)

dijkstra = DijkstraMatrix(d, 0)
dijkstra.solve()
print(dijkstra.distance(1))

Fixed submission:
import sys
from math import sqrt
def input():
	return sys.stdin.readline()[:-1]

import heapq
class DijkstraMatrix():
	#隣接行列版
	#同一頂点の複数回探索を防ぐため訪問した頂点数を変数cntで持つ
	def __init__(self, matrix, start):
		self.matrix = matrix
		self.start = start
		self.size = len(matrix)

	def solve(self):
		self.dist = [float("inf") for _ in range(self.size)]
		self.dist[self.start] = 0
		self.prev = [-1 for _ in range(self.size)]
		self.q = []
		self.cnt = 0

		heapq.heappush(self.q, (0, self.start))

		while self.q and self.cnt < self.size:
			u_dist, u = heapq.heappop(self.q)
			if self.dist[u] < u_dist:
				continue
				#これいる？
			for v in range(self.size):
				w = self.matrix[u][v]
				if self.dist[v] > u_dist + w:
					self.dist[v] = u_dist + w
					self.prev[v] = u
					heapq.heappush(self.q, (self.dist[v], v))

			self.cnt += 1

		return

	def distance(self, goal):
		return self.dist[goal]

	def path(self, goal):
		self.path = [goal]
		while self.path[-1] != self.start:
			self.path.append(self.prev[self.path[-1]])
		return self.path[::-1]

xs, ys, xt, yt = map(int, input().split())
n = int(input())
b = [[xs, ys, 0], [xt, yt, 0]] + [list(map(int, input().split())) for _ in range(n)]
d = [[float("inf") for _ in range(n+2)] for _ in range(n+2)]

for i in range(n+2):
	for j in range(n+2):
		if i != j:
			d[i][j] = max(sqrt((b[i][0] - b[j][0])**2 + (b[i][1] - b[j][1])**2) - b[i][2] - b[j][2], 0)

dijkstra = DijkstraMatrix(d, 0)
dijkstra.solve()
print(dijkstra.distance(1))
Buggy python submission (verdict: Time Limit Exceeded):
n, t = list(map(int, input().split()))
a = list(map(int, input().split()))

max_benefit = 0
ans = 0
for i in range(n - 1):
    benefit = (max(a[i + 1:]) - a[i])
    if  benefit == max_benefit:
        ans += 1
    elif benefit > max_benefit:
        ans = 1
        max_benefit = benefit

print(ans)

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

max_benefit = 0
a_min = a[0]
ans = 0
for i in range(1, n):
    if a[i] < a_min:
        a_min = a[i]
    benefit = (a[i] - a_min)
    if  benefit == max_benefit:
        ans += 1
    elif benefit > max_benefit:
        ans = 1
        max_benefit = benefit

print(ans)

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

benefits = [max(a[i + 1:]) - a[i] for i in range(n - 1)]

# for i in range(n)
#     if a[i] > a[i + 1]:
#         continue
#     else:
#         benefits.append(max([a[j] - a[i]]))
# 

print(benefits.count(max(benefits)))

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

max_benefit = 0
a_min = a[0]
ans = 0
for i in range(1, n):
    if a[i] < a_min:
        a_min = a[i]
    benefit = (a[i] - a_min)
    if  benefit == max_benefit:
        ans += 1
    elif benefit > max_benefit:
        ans = 1
        max_benefit = benefit

print(ans)

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

benefits = [max([a[j] - a[i] for j in range(i, n)]) for i in range(n)]

print(benefits.count(max(benefits)))

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

max_benefit = 0
a_min = a[0]
ans = 0
for i in range(1, n):
    if a[i] < a_min:
        a_min = a[i]
    benefit = (a[i] - a_min)
    if  benefit == max_benefit:
        ans += 1
    elif benefit > max_benefit:
        ans = 1
        max_benefit = benefit

print(ans)
Buggy python submission (verdict: Runtime Error):
print(len(set(input.split())))

Fixed submission:
print(len(set(input().split())))
Buggy python submission (verdict: Time Limit Exceeded):
n, x = map(int, input().split())
a = list(map(int, input().split()))

min_list = [[a[i] for i in range(n)] for _ in range(n)]
for i in range(1, n):
	for j in range(n):
		min_list[i][j] = min(min_list[i-1][j], a[(j-i) % n])

ans = float("inf")
for i in range(n):
	ans = min(ans, x * i + sum(min_list[i]))

print(ans)

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

min_list = [[a[i] for i in range(n)] for _ in range(n)]
for i in range(1, n):
	for j in range(n):
		min_list[i][j] = min(min_list[i-1][j], a[(j-i) % n])

ans = float("inf")
for i in range(n):
	ans = min(ans, x * i + sum(min_list[i]))

print(ans)
Buggy python submission (verdict: Runtime Error):
from math import sqrt
import sys
sys.setrecursionlimit(10**6)
def f(b, n):
	if n < b:
		return n
	else:
		return f(b, n // b) + n % b

n = int(input())
s = int(input())

if n < s:
	print(-1)
divs = []
for i in range(1, int(sqrt(n-s))+1):
	if (n-s)%i == 0:
		if i>2:
			divs.append(i)
		if i != (n-s)//i:
			divs.append((n-s)//i)
divs.sort()
for d in divs:
	if f(d+1, n) == s:
		print(d+1)
		break
else:
	print(-1)

Fixed submission:
from math import sqrt
import sys
sys.setrecursionlimit(10**6)
def f(b, n):
	if n < b:
		return n
	else:
		return f(b, n // b) + n % b

n = int(input())
s = int(input())

if n < s:
	print(-1)
elif n == s:
	print(n+1)
else:
	divs = []
	for i in range(1, int(sqrt(n-s))+1):
		if (n-s)%i == 0:
			divs.append(i)
			if i != (n-s)//i:
				divs.append((n-s)//i)
	divs.sort()
	for d in divs:
		if f(d+1, n) == s:
			print(d+1)
			break
	else:
		print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
MOD = 10**9+7
n, c = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

sig = [[0 for _ in range(max(b)+1)] for _ in range(c+1)]
for i in range(c+1):
	for j in range(1, max(b)+1):
		sig[i][j] = sig[i][j-1] + pow(j, i, MOD)
		sig[i][j] %= MOD

def sigma(C, A, B):
	return (sig[C][B] - sig[C][A-1]) % MOD

dp = [[0 for _ in range(c+1)] for _ in range(n)]
for j in range(c+1):
	dp[0][j] = sigma(j, a[0], b[0])

for i in range(1, n):
	for j in range(c+1):
		for k in range(j+1):
			dp[i][j] += dp[i-1][k] * sigma(j-k, a[i], b[i])
			dp[i][j] %= MOD

print(dp[n-1][c])

Fixed submission:
MOD = 10**9+7
n, c = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

sig = [[0 for _ in range(max(b)+1)] for _ in range(c+1)]
for i in range(c+1):
	for j in range(1, max(b)+1):
		sig[i][j] = sig[i][j-1] + pow(j, i, MOD)
		sig[i][j] %= MOD

def sigma(C, A, B):
	return (sig[C][B] - sig[C][A-1]) % MOD

dp = [[0 for _ in range(c+1)] for _ in range(n)]
for j in range(c+1):
	dp[0][j] = sigma(j, a[0], b[0])

for i in range(1, n):
	for j in range(c+1):
		for k in range(j+1):
			dp[i][j] += dp[i-1][k] * sigma(j-k, a[i], b[i])
			dp[i][j] %= MOD

print(dp[n-1][c])
Buggy python submission (verdict: Runtime Error):
MOD = (10 ** 9) + 7

N = int(input())
s = list(input())

dp = [[0 for i in range(N + 1)] for j in range(N + 1)]


for i in range(N + 1):
	dp[i][i] = 1
for i in range(N):
	dp[i][i + 1] = 1

for n in range(1, N + 1):
	dp[n][0] = (dp[n - 1][0] + 2 * dp[n - 1][1]) % MOD
	for l in range(1, n):
		dp[n][l] = (dp[n - 1][l - 1] + 2 * dp[n - 1][l + 1]) % MOD

print(dp[N - 1][len(s)])

Fixed submission:
MOD = (10 ** 9) + 7

N = int(input())
s = list(input())

dp = [[0] * (N + 2) for i in range(N + 1)]

for n in range(N + 1):
	for l in range(n + 1):
		if n == 1:
			dp[n][l] = 1
		elif l == 0:
			dp[n][l] = (dp[n - 1][0] + 2 * dp[n - 1][1]) % MOD
		else:
			dp[n][l] = (dp[n - 1][l - 1] + 2 * dp[n - 1][l + 1]) % MOD

print(dp[N][len(s)])

Buggy python submission (verdict: Time Limit Exceeded):
MOD = (10 ** 9) + 7

N = int(input())
s = list(input())

dp = [[0 for i in range(N + 1)] for j in range(N + 1)]


for i in range(N + 1):
	dp[i][i] = 1
for i in range(N):
	dp[i][i + 1] = 1

for n in range(1, N + 1):
	dp[n][0] = (dp[n - 1][0] + 2 * dp[n - 1][1]) % MOD
	for l in range(1, n):
		dp[n][l] = (dp[n - 1][l - 1] + 2 * dp[n - 1][l + 1]) % MOD

print(dp[N - 1][len(s)])

Fixed submission:
MOD = (10 ** 9) + 7

N = int(input())
s = list(input())

dp = [[0] * (N + 2) for i in range(N + 1)]

for n in range(N + 1):
	for l in range(n + 1):
		if n == 1:
			dp[n][l] = 1
		elif l == 0:
			dp[n][l] = (dp[n - 1][0] + 2 * dp[n - 1][1]) % MOD
		else:
			dp[n][l] = (dp[n - 1][l - 1] + 2 * dp[n - 1][l + 1]) % MOD

print(dp[N][len(s)])

Buggy python submission (verdict: Runtime Error):
MOD = (10 ** 9) + 7

N = int(input())
s = list(input())

dp = [[0 for i in range(N)] for j in range(N)]


for i in range(N):
	dp[i][i] = 1
for i in range(N - 1):
	dp[i][i + 1] = 1

for n in range(1, N):
	dp[n][0] = (dp[n - 1][0] + 2 * dp[n - 1][1]) % MOD
	for l in range(1, n):
		dp[n][l] = (dp[n - 1][l - 1] + 2 * dp[n - 1][l + 1]) % MOD

print(dp[N - 1][len(s)])

Fixed submission:
MOD = (10 ** 9) + 7

N = int(input())
s = list(input())

dp = [[0] * (N + 2) for i in range(N + 1)]

for n in range(N + 1):
	for l in range(n + 1):
		if n == 1:
			dp[n][l] = 1
		elif l == 0:
			dp[n][l] = (dp[n - 1][0] + 2 * dp[n - 1][1]) % MOD
		else:
			dp[n][l] = (dp[n - 1][l - 1] + 2 * dp[n - 1][l + 1]) % MOD

print(dp[N][len(s)])
Buggy python submission (verdict: Time Limit Exceeded):
BIG = (10 ** 9) + 7

f_list = [1] * 200000
f_r_list = [1] * 200000

for i in range(199999):
	f_list[i + 1] = int((f_list[i] * (i + 2)) % BIG)

def power(n, x):
	if x == 1:
		return n
	elif x % 2 == 0:
		return power(int((n * n) % BIG), int(x / 2))
	else:
		return int((n * power(n, x - 1)) % BIG)

for i in range(200000):
	f_r_list[i] = power(f_list[i], BIG - 2)

def comb(n, r):
	if n == 0 or r == 0 or n == r:
		return 1
	else:
		return (((f_list[n - 1] * f_r_list[n - r - 1]) % BIG) * f_r_list[r - 1]) % BIG 

h, w, a, b = map(int, input().split())

ans = 0

for i in range(h - a):
	ans = int((ans + int((comb(b + i - 1, b - 1) * comb(h + w - b - i - 2, w - b - 1)) % BIG)) % BIG)

print(int(ans))

Fixed submission:
BIG = (10 ** 9) + 7

f_list = [1] * 200000
f_r_list = [1] * 200000

for i in range(199999):
	f_list[i + 1] = int((f_list[i] * (i + 2)) % BIG)

def power(n, x):
	if x == 1:
		return n
	elif x % 2 == 0:
		return power(int((n * n) % BIG), int(x / 2))
	else:
		return int((n * power(n, x - 1)) % BIG)

f_r_list[-1] = power(f_list[-1], BIG - 2)

for i in range(2, 200001):
	f_r_list[-i] = int((f_r_list[-i + 1] * (200002 - i)) % BIG)

def comb(n, r):
	if n == 0 or r == 0 or n == r:
		return 1
	else:
		return (((f_list[n - 1] * f_r_list[n - r - 1]) % BIG) * f_r_list[r - 1]) % BIG 

h, w, a, b = map(int, input().split())

ans = 0

for i in range(h - a):
	ans = int((ans + int((comb(b + i - 1, b - 1) * comb(h + w - b - i - 2, w - b - 1)) % BIG)) % BIG)

print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
p = list(map(int, input().split()))

for i in range(N-1):
  p[i+1] = p[i] * p[i+1]
if p[i+1] > 10**18:
  print('-1')
else:
  print(p[i+1])

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

if 0 in p:
  print(0)
  exit()

for i in range(N-1):
  p[i+1] = p[i] * p[i+1]
  if p[i+1] > 10**18:
    print('-1')
    exit()
print(p[i+1])
Buggy python submission (verdict: Runtime Error):
import math
A, B = map(float, input().split())
a=int(A)
x = a*B 
y = math.round(x)
print(int(y))

Fixed submission:
import math

A, B = map(float, input().split())
a=int(A)
b = round(B * 100)
x =  a*b //100

print(math.floor(x))
Buggy python submission (verdict: Runtime Error):
L, R = map(int, input().split())
a=[]

if R-L>=2019:
  ans=0
else:
  l, r = L%2019, R%2019
  for i in range(l,r):
    for j in range(l+1,r+1):
        k = (i*j) % 2019
        ans = min(ans,k)
print(ans)

Fixed submission:
L, R = map(int, input().split())
a=[]

if R-L>=2019:
  ans=0
else:
  l, r = L%2019, R%2019
  ans=2018**2
  for i in range(l,r):
    for j in range(l+1,r+1):
        k = (i*j) % 2019
        ans = min(ans,k)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
a=[]
for i in range(L,R+1):
  for j in range(L,R+1):
    if L<=i<j<=R:
      ans = (i*j) % 2019
      a.append(ans)
print(min(a))

Fixed submission:
L, R = map(int, input().split())
a=[]

if R-L>=2019:
  ans=0
else:
  l, r = L%2019, R%2019
  ans=2018**2
  for i in range(l,r):
    for j in range(l+1,r+1):
        k = (i*j) % 2019
        ans = min(ans,k)
print(ans)
Buggy python submission (verdict: Runtime Error):
w, h, x, y = map(int, input().split())
print(w*h/2, int(h/w==y/x))

Fixed submission:
w, h, x, y = map(int, input().split())
print(w*h/2, int(h==2*y and w==2*x))

Buggy python submission (verdict: Runtime Error):
w, h, x, y = map(int, input().split())
an=[]
if y>=h/2:
  a=w*(h-y)
  an.append(a)
if y<=h/2:
  b=w*y
  an.append(b)
if x>=w/2:
  c=h*(w-x)
  an.append(c)
if x<=w/2:
  d=h*x
  an.append(d)
if y/x==h/w:
  e=(w*h)/2
  an.append(e)

g = set(an)
l=len(g)
i=len(an)
an.sort()
if l>1:
  T=0
else:
  T=1

print('{} {}'.format(an[-1], T))

Fixed submission:
w, h, x, y = map(int, input().split())
print(w*h/2, int(h==2*y and w==2*x))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
K = int(input())

for i in range(N):
  if S[i]!=S[K]:
    S = S.replace(S[i], "*")
  
print(S)

Fixed submission:
N = int(input())
S = input()
K = int(input())

for i in range(N):
  if S[i]!=S[K-1]:
    S = S.replace(S[i], "*")
  
print(S)
Buggy python submission (verdict: Runtime Error):
l=[]
m=[]
for i in range(5):
  i = int(input())
  k = 10 - (i%10)
  l.append(i)
  if k != 10:
    m.append(k)
m.sort()
s = sum(m)-m[-1]
print(sum(l)+s)

Fixed submission:
l=[]
m=[]
for i in range(5):
  i = int(input())
  k = 10 - (i%10)
  l.append(i)
  if k != 10:
    m.append(k)
m.sort()
if len(m)==0:
  print(sum(l))
else:
  s = sum(m)-m[-1]
  print(sum(l)+s)

Buggy python submission (verdict: Runtime Error):
l=[]
m=[]
for i in range(5):
  i = int(input())
  k = 10 - (i%10)
  l.append(i)
  if k != 10:
    m.append(k)
m.sort()
s = sum(m)-m[4]
print(sum(l)+s)

Fixed submission:
l=[]
m=[]
for i in range(5):
  i = int(input())
  k = 10 - (i%10)
  l.append(i)
  if k != 10:
    m.append(k)
m.sort()
if len(m)==0:
  print(sum(l))
else:
  s = sum(m)-m[-1]
  print(sum(l)+s)
Buggy python submission (verdict: Runtime Error):
b = input()

if b==A:
  print('T')
elif b==T:
  print('A')
elif b==G:
  print('C')
else:
  print('G')

Fixed submission:
b = input()

if b=='A':
  print('T')
elif b=='T':
  print('A')
elif b=='G':
  print('C')
else:
  print('G')
Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
c = []

for b in range(1,x+1):
  for q in range(2,x+2):
    a = b**q
    if a <=x:
      c.append(a)

C = set(c)
print(max(C))

Fixed submission:
x = int(input())
c = 1

for b in range(1,x):
  for q in range(2,x):
    if b**q <=x:
      c = max(c,b**q)
    else:
      break
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
j = 1
for i in range(1,n+1):
  k = i * j
  j = k
print(k%(10**9+7))

Fixed submission:
import math
n = int(input())
k = math.factorial(n)
print(k%(10**9+7))
Buggy python submission (verdict: Runtime Error):
a = map(int, input().split())

b = a[0]*a[1] 
c = a[2]*a[3]
A = [b, c]
print(max(A))

Fixed submission:
a = list(map(int, input().split()))
b = a[0]*a[1] 
c = a[2]*a[3]
A = [b, c]
print(max(A))
Buggy python submission (verdict: Runtime Error):
x = input()
if X == "1":
    print("0")
else:
    print("1")

Fixed submission:
X = input()
if X == "1":
    print("0")
else:
    print("1")
Buggy python submission (verdict: Runtime Error):
N = input()
A = [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z]
if N in A:
    print("A")
else:
    print("a")

Fixed submission:
word = input()
A = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
if word in A:
    print("A")
else:
    print("a")