Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, d = map(int, input().split())
count = 0
for i in range(a, b+1):
    if not (i % c == 0 or i % d == 0):
        count += 1
print(count)

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

def gcd(c, d):
    while d:
        c, d = d, c % d
    return c

lcm = c * d // gcd(c, d)
b_num = b - (b // c) - (b // d) + (b // lcm)
a_num = a - 1 - ((a - 1) // c) - ((a - 1) // d) + ((a - 1) // lcm)
print(int(b_num - a_num))

Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, d = map(int, input().split())
count = 0
for i in range(a, b+1):
    if i % c != 0 and i % d != 0:
        count += 1
print(count)

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

def gcd(c, d):
    while d:
        c, d = d, c % d
    return c

lcm = c * d // gcd(c, d)
b_num = b - (b // c) - (b // d) + (b // lcm)
a_num = a - 1 - ((a - 1) // c) - ((a - 1) // d) + ((a - 1) // lcm)
print(int(b_num - a_num))
Buggy python submission (verdict: Runtime Error):
n = int(input())
xy = set(tuple(map(int, input().split())) for _ in range(n))

costs = []
for a in xy:
    besides_a = xy - {a}
    for b in besides_a:
        p = b[0] - a[0]
        q = b[1] - a[1]
        arrow_num = 0
        for c in xy:
            if (c[0] + p, c[1] + q) in xy:
                arrow_num += 1
        cost = n - arrow_num
        costs.append(cost)

print(min(costs))


Fixed submission:
n = int(input())
xy = set(tuple(map(int, input().split())) for _ in range(n))

costs = []
for a in xy:
    besides_a = xy - {a}
    for b in besides_a:
        p = b[0] - a[0]
        q = b[1] - a[1]
        arrow_num = 0
        for c in xy:
            if (c[0] + p, c[1] + q) in xy:
                arrow_num += 1
        cost = n - arrow_num
        costs.append(cost)

if n == 1:
    print(1)
else:
    print(min(costs))

Buggy python submission (verdict: Runtime Error):
from itertools import permutations

n = int(input())
xy = [tuple(map(int, input().split())) for _ in range(n)]
xy = sorted(xy, key=lambda xy: xy[0])

costs = []
for per in permutations(xy, n):
    cost = 1
    p = per[1][0] - per[0][0]
    q = per[1][1] - per[0][1]
    for i in range(2, n):
        if not (per[i][0] - per[i-1][0] == p and per[i][1] - per[i-1][1] == q):
            cost += 1
    costs.append(cost)
print(min(costs))


Fixed submission:
n = int(input())
xy = set(tuple(map(int, input().split())) for _ in range(n))

costs = []
for a in xy:
    besides_a = xy - {a}
    for b in besides_a:
        p = b[0] - a[0]
        q = b[1] - a[1]
        arrow_num = 0
        for c in xy:
            if (c[0] + p, c[1] + q) in xy:
                arrow_num += 1
        cost = n - arrow_num
        costs.append(cost)

if n == 1:
    print(1)
else:
    print(min(costs))
Buggy python submission (verdict: Runtime Error):
pqr = list(map(int, input.split()))
print(sum(pqr) - max(pqr))

Fixed submission:
pqr = list(map(int, input().split()))
print(sum(pqr) - max(pqr))
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
c = 1
for i in range(1,n):
    if h[i] >= max(h[j] for j in range(i)):
        c += 1
print(c)

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

count = 0
for i in range(2):
    if a < b:
        count += b
        b -= 1
    else:
        count += a
        a -= 1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
s = input()
lr = [list(map(int, input().split())) for i in range(q)]

# ACの位置を記憶
ac_pos = []
for i in range(n-1):
    if s[i] == 'A' and s[i+1] == 'C':
        ac_pos.append(i+1) # 1-index

for i in range(q):
    count = 0
    for j in ac_pos:
        if lr[i][0] <= j < lr[i][1]:
            count += 1
    print(count)        

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

# 0-index
for i in range(q):
    for j in range(2):
        lr[i][j] -= 1

# 'AC'のカウントの累積和
ac_cnt = [0 for i in range(n)]
for i in range(n-1):
    ac_cnt[i+1] = ac_cnt[i] + (1 if s[i:i+2] == 'AC' else 0)

for i in range(q):
    print(ac_cnt[lr[i][1]] - ac_cnt[lr[i][0]])

Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
s = input()
lr = [list(map(int, input().split())) for i in range(q)]
for i in range(q):
    print(s[lr[i][0]-1:lr[i][1]].count('AC'))

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

# 0-index
for i in range(q):
    for j in range(2):
        lr[i][j] -= 1

# 'AC'のカウントの累積和
ac_cnt = [0 for i in range(n)]
for i in range(n-1):
    ac_cnt[i+1] = ac_cnt[i] + (1 if s[i:i+2] == 'AC' else 0)

for i in range(q):
    print(ac_cnt[lr[i][1]] - ac_cnt[lr[i][0]])
Buggy python submission (verdict: Time Limit Exceeded):
import copy

N = int(input())
txy = {}
for i in range(N):
    t, x, y = list(map(int, input().split(' ')))
    txy[t] = [x, y]

src_t = 0
src_x = 0
src_y = 0

success = True

for t, xy in txy.items():
    dest_t = t
    dest_x = xy[0]
    dest_y = xy[1]

    before = [[src_x, src_y]]
    after = []
    for i in range(src_t, dest_t):
        after.clear()
        for before_x, before_y in before:
            after.append([before_x + 1, before_y])
            after.append([before_x - 1, before_y])
            after.append([before_x, before_y + 1])
            after.append([before_x, before_y - 1])
        before = copy.deepcopy(after)

    if [dest_x, dest_y] in after:
        src_t = dest_t
        src_x = dest_x
        src_y = dest_y
        continue
    else:
        success = False
        break

if success:
    print('Yes')
else:
    print('No')


Fixed submission:
n = int(input())

src_t = 0
src_x = 0
src_y = 0
success = True

for i in range(n):
    t, x, y = map(int, input().split(' '))
    if success == True:
        dt = t - src_t
        dist = abs(x - src_x) + abs(y - src_y)
        if dist <= dt and dist % 2 == dt % 2:
            src_t = t
            src_x = x
            src_y = y
            continue
        else:
            success = False

if success:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())

power = 1
for i in range(n):
    power = power + (i+1)%1000000007
    power %= %1000000007

print(power)

Fixed submission:
n = int(input())

power = 1
for i in range(n):
    power = power * (i+1)%1000000007
    power %= 1000000007

print(power)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

power = 1
for i in range(n):
    power *= (i+1)%1000000007

print(power%(1000000007))


Fixed submission:
n = int(input())

power = 1
for i in range(n):
    power = power * (i+1)%1000000007
    power %= 1000000007

print(power)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

power = 1
for i in range(n):
    power *= i+1

print(power%(1000000007))


Fixed submission:
n = int(input())

power = 1
for i in range(n):
    power = power * (i+1)%1000000007
    power %= 1000000007

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

S = str(input())

K = int(input())

Char = []

#Muita gambiarra! lol

for i in range(len(S)-(len(S)-N)):

	Char.append(S[i])	if Char[i] != S[K-1]:

		Char[i] = '*'

for i in Char:

	print(i,end='')

Fixed submission:
N = int(input())
S = str(input())
K = int(input())
Char = ''
for i in range(N):
	if S[i] != S[K-1]:
		Char += '*'
	else:
		Char += S[i]
print(Char)
Buggy python submission (verdict: Runtime Error):
s = input()
s_list = list(s)
out_list = []

for i in range(len(s_list)):
    if s_list[i] == "0":
        out_list.append("0")
    elif s_list[i] == "1":
        out_list.append("1")
    elif s_list[i] == "B":
        del out_list[-1]

for ol in out_list:
    print(ol, end="")


Fixed submission:
s = input()
s_list = list(s)
out_list = []

for i in range(len(s_list)):
    if s_list[i] == "0":
        out_list.append("0")
    elif s_list[i] == "1":
        out_list.append("1")
    elif s_list[i] == "B":
        if out_list:
            del out_list[-1]

for ol in out_list:
    print(ol, end="")
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys


def answer(N, A, B):
    rail = N * A
    taxi = B

    return min(rail, taxi)


if __name__ == '__main__':
    args = sys.stdin.read().split(' ')
    answer(args[0], args[1], args[2])


Fixed submission:
# -*- coding: utf-8 -*-
import sys


def answer(N, A, B):
    rail = N * A
    taxi = B

    print(min(rail, taxi))


if __name__ == '__main__':
    args = sys.stdin.read().split(' ')
    answer(int(args[0]), int(args[1]), int(args[2]))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys


def answer(N, A, B):
    rail = N * A
    taxi = B

    return min(rail, taxi)


if __name__ == '__main__':
    args = sys.stdin
    answer(args[0], args[1], args[2])


Fixed submission:
# -*- coding: utf-8 -*-
import sys


def answer(N, A, B):
    rail = N * A
    taxi = B

    print(min(rail, taxi))


if __name__ == '__main__':
    args = sys.stdin.read().split(' ')
    answer(int(args[0]), int(args[1]), int(args[2]))
Buggy python submission (verdict: Runtime Error):
a , b =input().split()
print(a-b)

Fixed submission:
a , b = input().split()
if int(b)==1:
    print(0)
else:
    print(int(a)-int(b))
Buggy python submission (verdict: Runtime Error):
num1, num2, num3 = [int(i) for i in input().split()]
a=list[num1+num2,num2+num3,num1+num3]
print(max(a))

Fixed submission:
num1, num2, num3 = [int(i) for i in input().split()]
a=[num1+num2,num2+num3,num1+num3]
print(min(a))
Buggy python submission (verdict: Runtime Error):
s = int(input())
digit = lambda i:(digit(i//10) + [i%10]) if i > 0 else []

s = digit(s)
if s[0] == s[1]:
    print("Bad")
elif s[1] == s[2]:
    print("Bad")
elif s[2] == s[3]:
    print("Bad")
else:
    print("Good")



Fixed submission:
s = list(input())

if s[0] == s[1]:
    print("Bad")
elif s[1] == s[2]:
    print("Bad")
elif s[2] == s[3]:
    print("Bad")
else:
    print("Good")
Buggy python submission (verdict: Runtime Error):
N,L = map(int,input().split())

a = 10**6
b = 0
ans = 0
for i in range(1,N+1):
    if abs(L+i-1) < mina:
        mina = abs(L+i-1)
        minb = i
        
for i in range(1,N+1):
    if i != minb:
        ans += (L+i-1)

print(ans)




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

a = 10**6
b = 0
ans = 0
for i in range(1,N+1):
    if abs(L+i-1) < a:
        a = abs(L+i-1)
        b = i

for i in range(1,N+1):
    if i != b:
        ans += (L+i-1)

print(ans)

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

a = 10**6
b = 0
ans = 0


for i in range(1,N+1):
    if abs(L+i-1) < mina:
        mina = abs(L+i-1)
        minb = i
        print(mina)

for i in range(1,N+1):
    if i != minb:
        ans += (L+i-1)

print(ans)




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

a = 10**6
b = 0
ans = 0
for i in range(1,N+1):
    if abs(L+i-1) < a:
        a = abs(L+i-1)
        b = i

for i in range(1,N+1):
    if i != b:
        ans += (L+i-1)

print(ans)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A>12:
    print(B)
elif 13>A>5:
    print(B//2)
else:
    print(0)

Fixed submission:
a,b = map(int,input().split());print(b//-~(a<13)*(a>5))

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if B%2==0:

    if A>12:
        print(B)
    elif 13>A>5:
        print(round(B/2))
    else:
        print(0)


Fixed submission:
a,b = map(int,input().split());print(b//-~(a<13)*(a>5))

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A>12:
    print(B)
elif 13>A>5:
    print(round(B/2))
else:
    print(0)


Fixed submission:
a,b = map(int,input().split());print(b//-~(a<13)*(a>5))

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A>12:
    print(B)
elif 13>A>6:
    print(round(B/2))
else:
    print(0)


Fixed submission:
a,b = map(int,input().split());print(b//-~(a<13)*(a>5))
Buggy python submission (verdict: Runtime Error):
import pandas as pd
import sys

n = int(input())

jobs = pd.DataFrame(columns=["cost", "deadline"])

for i in range(n):
    a, b = map(int, input().split(' '))
    jobs.loc[len(jobs)] = [a, b]

jobs = jobs.sort_values("deadline")

sum = 0
for i in range(n):
    sum += jobs.iat[i, 0]
    if sum > jobs.iat[i, 1]:
        print('No')
        sys.exit()

print('Yes')

Fixed submission:
import numpy as np
import sys

n = int(input())

# jobs = pd.DataFrame(columns=["cost", "deadline"])

a = []
b = []

for i in range(n):
    aa, bb = map(int, input().split(' '))
    a.append(aa)
    b.append(bb)

a = np.array(a)
b = np.array(b)

sortIndex = np.argsort(b)

a = a[sortIndex]
b = b[sortIndex]

sum = 0
for i in range(n):
    sum += a[i]
    if sum > b[i]:
        print('No')
        sys.exit()

print('Yes')
Buggy python submission (verdict: Runtime Error):
import pandas as pd

n, m = map(int, input().split(' '))
ab = pd.DataFrame(columns=["a", "b"])
for nn in range(n):
    ls = list(map(int, input().split(' ')))
    ab.loc[nn] = ls
    
sortedAb = ab.sort_values("a")
amount = 0
count = 0
for i in range(len(sortedAb)):
    amount += min(sortedAb.iat[i, 1], m - count) * sortedAb.iat[i, 0]
    count += sortedAb.iat[i, 1]
    if count >= m:
        break

print(amount)

Fixed submission:
import numpy as np
 
n, m = map(int, input().split(' '))
a = []; b = []
for nn in range(n):
    ls = list(map(int, input().split(' ')))
    a.append(ls[0])
    b.append(ls[1])

a = np.array(a)
b = np.array(b)

ind = np.argsort(a)
a = a[ind]
b = b[ind]
    
amount = 0
count = 0
for i in range(len(a)):
    amount += min(b[i], m - count) * a[i]
    count += b[i]
    if count >= m:
        break
 
print(amount)
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = []; y = []; h = []

xmin = 0; ymin = 0; xmax = 101; ymax = 101

for i in range(n):
    xx, yy, hh = list(map(int, input().split(' ')))
    x.append(xx)
    y.append(yy)
    h.append(hh)

field = []

for i in range(n):
    if i == 0:
        for xx in range(xmin, xmax):
            f = []
            for yy in range(ymin, ymax):
                f.append(max(abs(xx - x[i]) + abs(yy - y[i]) + h[i], 0))
            field.append(f)
    
    else:
        for xx in range(xmin, xmax):
            for yy in range(ymin, ymax):
                f = max(abs(xx - x[i]) + abs(yy - y[i]) + h[i], 0)
                if field[xx][yy] != f:
                    field[xx][yy] = -1

maxx = 0; maxy = 0; maxV = 0
for xx in range(xmin, xmax):
    for yy in range(ymin, ymax):
        if maxV <= field[xx][yy]:
            maxx = xx; maxy = yy; maxV = field[xx][yy]

print(str(maxx) + " " + str(maxy) + " " + str(maxV))

Fixed submission:
old = int(input())

if old == 1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a + b)
Buggy python submission (verdict: Runtime Error):
import numpy as np
from itertools import product as p
N, K = map(int, input().split())
a = np.array(list(map(int, input().split())))
bs = np.array(list(p((True, False), repeat=N)))

z = np.zeros(N, dtype=int)
ids = np.arange(N)
if sum(a) < K:
 print(0)
else:
 for i in range(N):
  Si = sum(a[bs[i,:]])
  if Si < K: continue
  for j in ids[bs[i,:]]:
   if Si - a[j] < K: z[j] = 1
 print(N-sum(z))

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

if a == b:
 print('H')
else:
 print('D')

Buggy python submission (verdict: Runtime Error):
import numpy as np
from itertools import product as p
N, K = map(int, input().split())
a = np.array(list(map(int, input().split())))
bs = np.array(list(p((True, False), repeat=N)))

z = np.zeros(N, dtype=int)
ids = np.arange(N)
if sum(a) < K:
 print(0)
else:
 for i in range(N):
  Si = sum(a[bs[i,:]])
  if Si < K: continue
  for j in ids[bs[i,:]]:
   if Si - a[j] < K: z[j] = 1
 print(N-sum(z))

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

if a == b:
 print('H')
else:
 print('D')

Buggy python submission (verdict: Runtime Error):
a, b = input().split()

if a == b:
 print('H')
else:
 print('D')s

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

if a == b:
 print('H')
else:
 print('D')
Buggy python submission (verdict: Runtime Error):
X = int(input())

def move(i, x):
 if x == X:
  return i
 elif i > X:
  return X+1
 else:
  if x > X:
   return min([move(i+1, x-(i+1)), move(i+1, x)])
  else:
   return min([move(i+1, x+(i+1)), move(i+1, x)])

print((move(0,0)))


Fixed submission:
X = int(input())

i=0
while(i*(i+1)<2*X):
 i+=1

print(i)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
import math
# sys.setrecursionlimit(10000)


def main():
    # 入力処理
    N, M = map(int, input().split())

    # アルゴリズム本体
    K = int(M / 2)

    # 出力
    print(K)


if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-
import sys
# sys.setrecursionlimit(10000)


def main():
    # 入力処理
    N = int(input())

    # アルゴリズム本体
    x = 800 * N
    y = 200 * int(N / 15)

    # 出力
    print(x-y)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
import math
# sys.setrecursionlimit(10000)


def main():
    # 入力処理
    N, M = map(int, input().split())

    # アルゴリズム本体
    K = N + int((M - 2 * N) / 4)

    # 出力
    print(K)


if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-
import sys
# sys.setrecursionlimit(10000)


def main():
    # 入力処理
    N = int(input())

    # アルゴリズム本体
    x = 800 * N
    y = 200 * int(N / 15)

    # 出力
    print(x-y)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
import math
# sys.setrecursionlimit(10000)


def main():
    # 入力処理
    N, M = map(int, input().split())

    # アルゴリズム本体
    if N >= 2 * M:
        K = int(M / 2)
    else:
        K = N + int((M - 2 * N) / 4)

    # 出力
    print(K)


if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-
import sys
# sys.setrecursionlimit(10000)


def main():
    # 入力処理
    N = int(input())

    # アルゴリズム本体
    x = 800 * N
    y = 200 * int(N / 15)

    # 出力
    print(x-y)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
import math
import numpy as np


def main():
    # 入力処理
    # M = int(input())
    N, M = map(int, input().split())
    sA = ''.join([input() for i in range(N)])
    sB = ''.join([input() for i in range(M)])
    A = np.array([s for s in sA]).reshape(N,N)
    B = np.array([s for s in sB]).reshape(M,M)

    # アルゴリズム本体
    result = np.zeros((N-M,N-M), dtype=bool)
    for i in range(N-M+1):
        for j in range(N-M+1):
            result[i,j] = (A[i:i+M, j:j+M] == B).all()

    # 出力
    if result.any():
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-
import sys
import math
import numpy as np


def main():
    # 入力処理
    # M = int(input())
    N, M = map(int, input().split())
    sA = ''.join([input() for i in range(N)])
    sB = ''.join([input() for i in range(M)])
    A = np.array([s for s in sA]).reshape(N,N)
    B = np.array([s for s in sB]).reshape(M,M)

    # アルゴリズム本体
    result = np.zeros((N-M+1,N-M+1), dtype=bool)
    for i in range(N-M+1):
        for j in range(N-M+1):
            result[i,j] = (A[i:i+M, j:j+M] == B).all()

    # 出力
    if result.any():
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
bound = 0
length = 0

n, x = input().split()
l = input().split()

for i in range(int(n)):
  if length <= int(x):
    length += int(l[i])
    bound += 1
  else:
    break

print(bound)


Fixed submission:
x, a = input().split()
if x < a:
  print("0")
else:
  print("10")
Buggy python submission (verdict: Runtime Error):
N, X_MAX=input().split()
L = input().split()
i = 0
X = 0

while int(X_MAX) >= X:
    X += int(L[i])
    i+=1
print(i)

Fixed submission:
N, X_MAX=input().split()
L = input().split()
count_i = 1
X = 0

for L_n in L:
    X += int(L_n)
    if int(X_MAX) < X:
        break
    count_i += 1
print(count_i)

Buggy python submission (verdict: Runtime Error):
N, X_MAX=input().split()
L = input().split()
i = 0
X = 0

while int(X_MAX) >= X:
    X += int(L[i])
    i+=1
print(i)

Fixed submission:
N, X_MAX=input().split()
L = input().split()
count_i = 1
X = 0

for L_n in L:
    X += int(L_n)
    if int(X_MAX) < X:
        break
    count_i += 1
print(count_i)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n, m = map(int, input().split())
road = [0]*n
a = [0]*m
a = np.array(a)
b = [0]*m
b = np.array(b)
for i in range(m):
  x, y = input().split()
  a[i] = (int(x))
  b[i] = (int(y))
for i in road:
  road[int(a[i]) - 1] += 1
  road[int(b[i]) - 1] += 1
for i in road:
    print(i)


Fixed submission:
import numpy as np
n, m = map(int, input().split())
road = [0]*n
a = [0]*m
a = np.array(a)
b = [0]*m
b = np.array(b)
for i in range(m):
  x, y = input().split()
  a[i] = (int(x))
  b[i] = (int(y))
for i in range(m):
  road[int(a[i]) - 1] += 1
  road[int(b[i]) - 1] += 1
for i in road:
    print(i)
Buggy python submission (verdict: Runtime Error):
nab = input().split()
n = nab[0]
a = nab[1]
b = nab[2]

if n*a > b:
  print(n*a)
else:
  print(b)

Fixed submission:
nab = input().split()
n = int(nab[0])
a = int(nab[1])
b = int(nab[2])

if n*a > b:
  print(b)
else:
  print(n*a)
Buggy python submission (verdict: Runtime Error):
lr = list(map(int, input().split()))
l = lr[0]
r = lr[1]
lmod = l%2019

def minfunc(x, y):
    if x > y:
        return y
    else:
        return x

if r - l >= 2019:
    print(0)
elif 2019 <= r - l + lmod:
    print(0)
else:
    min = 9999999
    for i in list(map(lambda x: x%2019,range(l,r)):
        for j in list(map(lambda x: x%2019, range(i,r+1))):
            min = minfunc(minfunc(i,j),min)
    print(min)


Fixed submission:
import sys
lr = list(map(int, input().split()))
l = lr[0]
r = lr[1]
lmod = l%2019

def minfunc(x, y):
    if x > y:
        return y
    else:
        return x

if r - l >= 2019:
    print(0)
elif 2019 <= r - l + lmod:
    print(0)
else:
    min = 9999999
    modlist = list(map(lambda x: x%2019,range(l,r+1)))
    for i in range(r-l):
        for j in range(i+1, r-l+1):
            min = minfunc((modlist[i]*modlist[j])%2019,min)
    print(min)

Buggy python submission (verdict: Runtime Error):
lr = list(map(int, input().split()))
l = lr[0]
r = lr[1]
lmod = l%2019

def minfunc(x, y):
    if x > y:
        return y
    else:
        return x

if r - l >= 2019:
    print(0)
elif 2019 <= r - l + lmod:
    print(0)
else:
    min = 9999999
    for i in list(map(lambda x: x%2019,range(l,r)):
        for j in list(map(lambda x: x%2019, range(i,r+1))):
            min = minfunc(minfunc(i,j),min)


Fixed submission:
import sys
lr = list(map(int, input().split()))
l = lr[0]
r = lr[1]
lmod = l%2019

def minfunc(x, y):
    if x > y:
        return y
    else:
        return x

if r - l >= 2019:
    print(0)
elif 2019 <= r - l + lmod:
    print(0)
else:
    min = 9999999
    modlist = list(map(lambda x: x%2019,range(l,r+1)))
    for i in range(r-l):
        for j in range(i+1, r-l+1):
            min = minfunc((modlist[i]*modlist[j])%2019,min)
    print(min)

Buggy python submission (verdict: Runtime Error):
lr = list(map(int, input().split()))
l = lr[0]
r = lr[1]
lmod = l%2019

if r - l >= 2019:
    print(0)
elif 2019 <= r - l + lmod:
    print(0)
else:ß
    print((lmod * (lmod + 1)) % 2019)


Fixed submission:
import sys
lr = list(map(int, input().split()))
l = lr[0]
r = lr[1]
lmod = l%2019

def minfunc(x, y):
    if x > y:
        return y
    else:
        return x

if r - l >= 2019:
    print(0)
elif 2019 <= r - l + lmod:
    print(0)
else:
    min = 9999999
    modlist = list(map(lambda x: x%2019,range(l,r+1)))
    for i in range(r-l):
        for j in range(i+1, r-l+1):
            min = minfunc((modlist[i]*modlist[j])%2019,min)
    print(min)