Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

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

#while n > abs(n-k):
#    n = abs(n-k)
while 2*n > k:
    
    if n > k:
        n = n-k
    elif n <= k:
        n = k-n
        
print(n)

Fixed submission:
#!/usr/bin/env python3

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

#while n > abs(n-k):
#    n = abs(n-k)
while 2*n > k:
    
    if n > k:
        n = n%k
    elif n <= k:
        n = k-n

print(n)

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

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

while n > abs(n-k):
    n = abs(n-k)

print(n)

Fixed submission:
#!/usr/bin/env python3

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

#while n > abs(n-k):
#    n = abs(n-k)
while 2*n > k:
    
    if n > k:
        n = n%k
    elif n <= k:
        n = k-n

print(n)
Buggy python submission (verdict: Runtime Error):
from decimal import *
 
a, b, c = map(Decimal, input().split())
if sqrt(a) + sqrt(b) < sqrt(c):
    print('Yes')
else:
    print('No')

Fixed submission:
from decimal import *
 
a, b, c = map(Decimal, input().split())
if a.sqrt() + b.sqrt() < c.sqrt():
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
from decimal import *
 
a, b, c = map(Decimal, input().split())
if sqrt(a) + sqrt(b) < sqrt(c):
    print('Yes')
else:
    print('No')

Fixed submission:
from decimal import *
 
a, b, c = map(Decimal, input().split())
if a.sqrt() + b.sqrt() < c.sqrt():
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
from * import decimal
from math import sqrt
 
a, b, c = map(decimal, input().split())
if sqrt(a) + sqrt(b) < sqrt(c):
    print('Yes')
else:
    print('No')

Fixed submission:
from decimal import *
 
a, b, c = map(Decimal, input().split())
if a.sqrt() + b.sqrt() < c.sqrt():
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import decimal
from math import sqrt
 
a, b, c = map(decimal, input().split())
if sqrt(a) + sqrt(b) < sqrt(c):
    print('Yes')
else:
    print('No')

Fixed submission:
from decimal import *
 
a, b, c = map(Decimal, input().split())
if a.sqrt() + b.sqrt() < c.sqrt():
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
from math import sqrt
 
a, b, c = map(Decimal, input().split())
if sqrt(a) + sqrt(b) < sqrt(c):
    print('Yes')
else:
    print('No')

Fixed submission:
from decimal import *
 
a, b, c = map(Decimal, input().split())
if a.sqrt() + b.sqrt() < c.sqrt():
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
from math import sqrt
 
a, b, c = map(decimal, input().split())
if sqrt(a) + sqrt(b) < sqrt(c):
    print('Yes')
else:
    print('No')

Fixed submission:
from decimal import *
 
a, b, c = map(Decimal, input().split())
if a.sqrt() + b.sqrt() < c.sqrt():
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
from math import sqrt
 
a, b, c = map(desimal, input().split())
if sqrt(a) + sqrt(b) < sqrt(c):
    print('Yes')
else:
    print('No')

Fixed submission:
from decimal import *
 
a, b, c = map(Decimal, input().split())
if a.sqrt() + b.sqrt() < c.sqrt():
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
from sympy import sqrt

a, b, c = map(int, input().split())
if sqrt(a) + sqrt(b) < sqrt(c):
    print('Yes')
else:
    print('No')

Fixed submission:
from decimal import *
 
a, b, c = map(Decimal, input().split())
if a.sqrt() + b.sqrt() < c.sqrt():
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

input = input()
hitati = [ hi*i for i in range(1, 6) ]
if input in hitati:
    print('Yes')
else:
    print('No')

Fixed submission:
#!/usr/bin/env python3

input = input()
hitati = [ 'hi'*i for i in range(1, 6) ]
if input in hitati:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
def main():
  N = input()
  A= input().split()
  result = False
  for a in A:
    count = A.count(a)
    if count > 1:
      result = True
  if result:
    print("NO")
  else:
    print("YES")

main()

Fixed submission:
def main():
  N = input()
  A=list(map(int, input().split()))
  if len(set(A)) == len(A):
    print("YES")
  else:
    print("NO")

main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
  N = input()
  A= input().split()
  result = False
  for a in A:
    count = A.count(a)
    if count > 1:
      result = True
  if result:
    print("NO")
  else:
    print("YES")

main()

Fixed submission:
def main():
  N = input()
  A=list(map(int, input().split()))
  if len(set(A)) == len(A):
    print("YES")
  else:
    print("NO")

main()
Buggy python submission (verdict: Runtime Error):
n,q = map(int, input().split())
s =input()
A = [[int(j) for j in input().split()] for i in range(q)]
ls = [0] * (n+1)
for i in range(n-1):
    if s[i] == 'A' and s[i+1] == 'C':
        ls[i+1]= ls[i]+1
    else:
        ls[i+1]= ls[i]

for k in range(q):
    print(ls[[k][0]-1-A[k][1]-1])

Fixed submission:
n,q = map(int, input().split())
s =input()
A = [[int(j) for j in input().split()] for i in range(q)]
ls = [0] * (n+1)
for i in range(n-1):
    if s[i] == 'A' and s[i+1] == 'C':
        ls[i+1]= ls[i]+1
    else:
        ls[i+1]= ls[i]

for k in range(q):
    print(ls[A[k][1]-1]-ls[A[k][0]-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int, input().split())
s =input()
A = [[int(j) for j in input().split()] for i in range(q)]
ls = [0] * (n+1)
for i in range(n-1):
    if s[i] == 'A' and s[i+1] == 'C':
        ls[i]= 1

for k in range(q):
    print(sum(ls[A[k][0]-1:A[k][1]-1]))

Fixed submission:
n,q = map(int, input().split())
s =input()
A = [[int(j) for j in input().split()] for i in range(q)]
ls = [0] * (n+1)
for i in range(n-1):
    if s[i] == 'A' and s[i+1] == 'C':
        ls[i+1]= ls[i]+1
    else:
        ls[i+1]= ls[i]

for k in range(q):
    print(ls[A[k][1]-1]-ls[A[k][0]-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int, input().split())
s =input()

ls = [0] * (n+1)
for i in range(n-1):
    if s[i] == 'A' and s[i+1] == 'C':
        ls[i]= 1

for i in range(q):
    l,r = map(int, input().split())
    print(sum(ls[l-1:r-1]))

Fixed submission:
n,q = map(int, input().split())
s =input()
A = [[int(j) for j in input().split()] for i in range(q)]
ls = [0] * (n+1)
for i in range(n-1):
    if s[i] == 'A' and s[i+1] == 'C':
        ls[i+1]= ls[i]+1
    else:
        ls[i+1]= ls[i]

for k in range(q):
    print(ls[A[k][1]-1]-ls[A[k][0]-1])
Buggy python submission (verdict: Runtime Error):
import collections
N,K=map(int,input().split())
while K>0:
  K=K-1
  d=int(input())
  a.append(map(str,input().split()))
e=collections.Counter(a)
p=N-len(e)
print(p)

Fixed submission:
import collections
N,K=map(int,input().split())
a=[]
d=[]
while K>0:
  K=K-1
  d.append(int(input()))
  b=list(map(int,input().split()))
  a.extend(b)
e=collections.Counter(a)
print(N-len(e))

Buggy python submission (verdict: Runtime Error):
import collections
N,K=map(int,input().split())
a=[]
K=K+1
while K>0:
  K=K-1
  d=int(input())
  a.append(map(str,input().split()))
e=collections.Counter(a)
print(N-len(a))

Fixed submission:
import collections
N,K=map(int,input().split())
a=[]
d=[]
while K>0:
  K=K-1
  d.append(int(input()))
  b=list(map(int,input().split()))
  a.extend(b)
e=collections.Counter(a)
print(N-len(e))

Buggy python submission (verdict: Runtime Error):
import collections
N,K=map(int,input().split())
a=[]
while K>0:
  K=K-1
  d=int(input())
  a.append(map(str,input().split())
e =collections.Counter(a)
print(N-len(e))

Fixed submission:
import collections
N,K=map(int,input().split())
a=[]
d=[]
while K>0:
  K=K-1
  d.append(int(input()))
  b=list(map(int,input().split()))
  a.extend(b)
e=collections.Counter(a)
print(N-len(e))

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
a=[]
while K>0:
  d=int(input())
  b=list(map(int,input().split())
  a.extend(b)
  K=K-1
e=collection.Counter(a)
print(N-len(e))

Fixed submission:
import collections
N,K=map(int,input().split())
a=[]
d=[]
while K>0:
  K=K-1
  d.append(int(input()))
  b=list(map(int,input().split()))
  a.extend(b)
e=collections.Counter(a)
print(N-len(e))

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
a=[]
while K>0:
  d=int(input())
  b=list(map(int,input().split())
  a.extend(b)
  K=K-1
e=collection.counter(a)
print(N-len(e))

Fixed submission:
import collections
N,K=map(int,input().split())
a=[]
d=[]
while K>0:
  K=K-1
  d.append(int(input()))
  b=list(map(int,input().split()))
  a.extend(b)
e=collections.Counter(a)
print(N-len(e))

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
a=[]
while K>0:
  d=int(input())
  b=list(map(int,input().split())
  a.extend(b)
  K=K-1
collection.counter(a)
print(N-len(a))

Fixed submission:
import collections
N,K=map(int,input().split())
a=[]
d=[]
while K>0:
  K=K-1
  d.append(int(input()))
  b=list(map(int,input().split()))
  a.extend(b)
e=collections.Counter(a)
print(N-len(e))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a<=b:
  print(unsafe)
else:
  print(safe)

Fixed submission:
a,b=map(int,input().split())
if a<=b:
  print("unsafe")
else:
  print("safe")
Buggy python submission (verdict: Runtime Error):
import collections
N=int(input())
count=0
a=[]
while N>0:
  a.append(input())
  N=N-1
c=collection.Counter(a)
print(len(c))

Fixed submission:
import collections
N=int(input())
count=0
a=[]
while N>0:
  a.append(input())
  N=N-1
c=collections.Counter(a)
print(len(c))
Buggy python submission (verdict: Runtime Error):
R=input()
i=R*3.141592*2
print(i)

Fixed submission:
R=int(input())
i=R*6.283184
print(i)

Buggy python submission (verdict: Runtime Error):
i=R*6.28318530717958623200
print(i)

Fixed submission:
R=int(input())
i=R*6.283184
print(i)

Buggy python submission (verdict: Runtime Error):
print(R*6.283185)

Fixed submission:
R=int(input())
i=R*6.283184
print(i)

Buggy python submission (verdict: Runtime Error):
i=2*R
s=i*3.1415
print(s)

Fixed submission:
R=int(input())
i=R*6.283184
print(i)

Buggy python submission (verdict: Runtime Error):
print(R*3.141592*2)

Fixed submission:
R=int(input())
i=R*6.283184
print(i)

Buggy python submission (verdict: Runtime Error):
i=R*3.141592*2
print(i)

Fixed submission:
R=int(input())
i=R*6.283184
print(i)

Buggy python submission (verdict: Runtime Error):
i=3.141592*2*R
return i

Fixed submission:
R=int(input())
i=R*6.283184
print(i)

Buggy python submission (verdict: Runtime Error):
i=R*3.1415*2
print(i)

Fixed submission:
R=int(input())
i=R*6.283184
print(i)

Buggy python submission (verdict: Runtime Error):
i=R*3.1415*2
return i

Fixed submission:
R=int(input())
i=R*6.283184
print(i)

Buggy python submission (verdict: Runtime Error):
i=R*3.1415
return i

Fixed submission:
R=int(input())
i=R*6.283184
print(i)
Buggy python submission (verdict: Runtime Error):
m,n=map(int,input().split())
a=input().split()
while n>0:
  m= m-a[n-1]
  n=n-1
if m>=0:
  print(m)
else:
  print(-1)

Fixed submission:
m,n=map(int,input().split())
a=list(map(int,input().split()))
while n>0:
  m= m-a[n-1]
  n=n-1
if m>=0:
  print(m)
else:
  print(-1)

Buggy python submission (verdict: Runtime Error):
m,n=input().split()
while n>0:
  m=m-int(input())
  n=n-1
if m>=0:
  print(m)
else:
  print(-1)

Fixed submission:
m,n=map(int,input().split())
a=list(map(int,input().split()))
while n>0:
  m= m-a[n-1]
  n=n-1
if m>=0:
  print(m)
else:
  print(-1)

Buggy python submission (verdict: Runtime Error):
m,n=input().split()
while n>0:
  m=m-int(input())
  n=n-1
print(n)

Fixed submission:
m,n=map(int,input().split())
a=list(map(int,input().split()))
while n>0:
  m= m-a[n-1]
  n=n-1
if m>=0:
  print(m)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
print(int(input()) int(input()) int(input()))

Fixed submission:
X,Y,Z=input().split()
print(Z,X,Y)

Buggy python submission (verdict: Runtime Error):
print(int(input(Z)) int(input(X)) int(input(Y)))

Fixed submission:
X,Y,Z=input().split()
print(Z,X,Y)

Buggy python submission (verdict: Runtime Error):
a=Y
b=X
c=Z
A=c
B=b
C=a
print(A" "B" "C)

Fixed submission:
X,Y,Z=input().split()
print(Z,X,Y)

Buggy python submission (verdict: Runtime Error):
a=Y
b=X
c=Z
A=c
B=b
C=a
print(A B C)

Fixed submission:
X,Y,Z=input().split()
print(Z,X,Y)
Buggy python submission (verdict: Time Limit Exceeded):
N ,M = map(int, input().split())
H = [int(i) for i in input().split()]
Nlist = [int(i+1) for i in range(N)]

for i in range(M):
    A = [int(i) for i in input().split()]
    if H[A[0] - 1] < H[A[1] - 1]:
        Nlist = [0 if j == A[0] else j for j in Nlist]
    elif H[A[0] - 1] > H[A[1] - 1]:
        Nlist = [0 if j == A[1] else j for j in Nlist]
    else:
        Nlist = [0 if j == A[0] or j == A[1] else j for j in Nlist]

print(N - Nlist.count(0))

Fixed submission:
N ,M = map(int, input().split())
H = [int(i) for i in input().split()]
X = []
cnt = 0

for i in range(M):
    A = [int(i) for i in input().split()]
    if H[A[0] - 1] < H[A[1] - 1]:
        X.append(A[0])
    elif H[A[0] - 1] > H[A[1] - 1]:
        X.append(A[1])
    else:
        X.append(A[0])
        X.append(A[1])
        
print(N - len(set(X)))

Buggy python submission (verdict: Time Limit Exceeded):
N ,M = map(int, input().split())
H = [int(i) for i in input().split()]
Nlist = [int(i+1) for i in range(N)]

for i in range(M):
    A = [int(i) for i in input().split()]
    if H[A[0] - 1] < H[A[1] - 1]:
        Nlist = [0 if j == A[0] else j for j in Nlist]
    elif H[A[0] - 1] > H[A[1] - 1]:
        Nlist = [0 if j == A[1] else j for j in Nlist]
    else:
        Nlist = [0 if j == A[0] else j for j in Nlist]
        Nlist = [0 if j == A[1] else j for j in Nlist]

print(N - Nlist.count(0))

Fixed submission:
N ,M = map(int, input().split())
H = [int(i) for i in input().split()]
X = []
cnt = 0

for i in range(M):
    A = [int(i) for i in input().split()]
    if H[A[0] - 1] < H[A[1] - 1]:
        X.append(A[0])
    elif H[A[0] - 1] > H[A[1] - 1]:
        X.append(A[1])
    else:
        X.append(A[0])
        X.append(A[1])
        
print(N - len(set(X)))
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

K = int(input())
num = 0

for a in range(K):
    for b in range(K):
        for c in range(K):
            num += gcd(a+1, b+1, c+1)

print(num)

Fixed submission:
import math

K = int(input())
num = 0

for a in range(K):
    for b in range(K):
        ab = math.gcd(a+1, b+1)
        for c in range(K):
            num += math.gcd(ab, c+1)

print(num)
Buggy python submission (verdict: Runtime Error):
import numpy as np
import decimal

a, b, c = map(int, input().split())

if c - a - b > 0 and 4*a*b - (c-a-b)**2 < 0:
    print("Yes")
else:
    print("No")

Fixed submission:
a = [0,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]

print(a[int(input())])

Buggy python submission (verdict: Runtime Error):
from decimal import *

a, b, c = map(int, input().split())
if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
    print("Yes")
else:
    print("No")

Fixed submission:
a = [0,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]

print(a[int(input())])

Buggy python submission (verdict: Runtime Error):
import decimal

a, b, c = map(int, input().split())
a = decimal.Decimal(a)
b = decimal.Decimal(b)
b = decimal.Decimal(b)

if 4*a*b - (c-a-b)**2 < 0:
    print("Yes")
else:
    print("No")

Fixed submission:
a = [0,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]

print(a[int(input())])
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
a = decimal.Decimal(a)
b = decimal.Decimal(b)
b = decimal.Decimal(b)

if 4*a*b - (c-a-b)**2 < 0:
    print("Yes")
else:
    print("No")


Fixed submission:
import decimal

a, b, c = map(int, input().split())
a = decimal.Decimal(a)
b = decimal.Decimal(b)
c = decimal.Decimal(c)

if c - a - b > 0 and 4*a*b - (c-a-b)**2 < 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a = input()
Q = int(input())
Qy = [list(map(str,input().split())) for i in range(Q)]

for i in range(Q):
    if Qy[i][0] == "1":
        a = a[::-1]
    elif Qy[i][1] == "1":
        a = Qy[i][2] + a
    else :
        a += Qy[i][2]
print(a)

Fixed submission:
S = input() 

if S.replace("A" ,"") == "" or S.replace("B", "") == "":
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
import math

A, B, C, D = map(int, input().split())

cnt = B//C -(A - 1)//C + B//D - (A - 1)//D - ((B//((C * D) // math.gcd(C, D))) - (A - 1)//((C * D) // math.gcd(C, D)))
cnt1 = B - (A - 1) -cnt

print(cnt1)

Fixed submission:
from fractions import gcd

A, B, C, D = map(int, input().split())

cnt = B//C -(A - 1)//C + B//D - (A - 1)//D - ((B//((C * D) // gcd(C, D))) - (A - 1)//((C * D) // gcd(C, D)))
cnt1 = B - (A - 1) -cnt

print(cnt1)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, C, D = map(int, input().split())
cnt = 0
i = A

while A <= i and i <= B:
    if i%C != 0 and i%D != 0:
        cnt +=1
    i +=1

print(cnt)

Fixed submission:
from fractions import gcd

A, B, C, D = map(int, input().split())

cnt = B//C -(A - 1)//C + B//D - (A - 1)//D - ((B//((C * D) // gcd(C, D))) - (A - 1)//((C * D) // gcd(C, D)))
cnt1 = B - (A - 1) -cnt

print(cnt1)
Buggy python submission (verdict: Time Limit Exceeded):
import math
S =  list(map(int,input().split()))
A = S[0]
B = S[1]
N = S[2]
d = []
for i in range(1,N+1):
    t = math.floor(A*i/B)-math.floor(i/B)*A
    d.append(t)
print(max(d))


Fixed submission:
import math
S =  list(map(int,input().split()))
A = S[0]
B = S[1]
N = S[2]
if N<B:
    print(math.floor(A*N/B)-math.floor(N/B)*A)
else:
    print(math.floor(A*(B-1)/B)-math.floor((B-1)/B)*A)
Buggy python submission (verdict: Runtime Error):
import math

S =  list(map(int,input().split()))
N = S[0]
M = S[1]
A =  list(map(int,input().split()))
ans = N-sum(A)
if ans < 0:
    ans = -1
    
print(ans)

Fixed submission:
import math

X = int(input())
A = X*2*math.pi
print(A)
Buggy python submission (verdict: Runtime Error):
import xgboost as xgb
from sklearn.model_selection import GridSearchCV
import math
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns  # pip install seaborn
import re
import statsmodels.api as sm
import statsmodels.formula.api as smf
from sklearn.model_selection import cross_val_score
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split

S=input()

if S[0:math.floor((len(S)/2))] == S[math.floor((len(S)/2))+1:len(S)]:
    p = S[0:math.floor((len(S)/2))]
    q = S[math.floor((len(S)/2))+1:len(S)]
    print('Yes')
else:
    print('No')            

Fixed submission:
import math

S=input()

if S[0:math.floor((len(S)/2))] == S[math.floor((len(S)/2))+1:len(S)]:
    p = S[0:math.floor((len(S)/2))]
    q = S[math.floor((len(S)/2))+1:len(S)]
    if p == p[len(p)::-1]:
        if q == q[len(q)::-1]:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
from math import floor
import numpy as np

a, b, n = map(int, input().split())
# a, b, n = 4628, 3261783, 3421421

res_arr = np.vectorize(lambda x: floor(a*x / b) - a * floor(x / b))(np.arange(1, n+1))
# np.nanmax(res_arr)
print(np.nanmax(res_arr))

Fixed submission:
from math import floor

a, b, n = map(int, input().split())
        
x = min(n, b-1)
if x < 0:
    x = 0
    
print(floor(a*x / b) - a * floor(x / b))

Buggy python submission (verdict: Time Limit Exceeded):
from math import floor

a, b, n = map(int, input().split())
# a, b, n = 4628, 3261783, 3421

max_num = -99999999999999999999999

for i in range(n):
    x = i + 1
    num = floor(a*x / b) - a * floor(x / b)
    
    if num > max_num:
        max_num = num
        
print(max_num)

Fixed submission:
from math import floor

a, b, n = map(int, input().split())
        
x = min(n, b-1)
if x < 0:
    x = 0
    
print(floor(a*x / b) - a * floor(x / b))

Buggy python submission (verdict: Runtime Error):
import math
import numpy as np

a, b, n = map(int, input().split())
arr = np.arange(1, n+1)

res_arr = np.vectorize(lambda x: math.floor(a*x / b) - a * math.floor(x / b))(np.arange(1, n+1))

print(np.nanmax(res_arr))
# np.vectorize(lambda x: math.floor(a*x / b) - a * math.floor(x / b))( np.arange(1, n+1)).max()

Fixed submission:
from math import floor

a, b, n = map(int, input().split())
        
x = min(n, b-1)
if x < 0:
    x = 0
    
print(floor(a*x / b) - a * floor(x / b))

Buggy python submission (verdict: Runtime Error):
import math
import numpy as np

a, b, n = map(int, input().split())
arr = np.arange(1, n+1)

print(np.vectorize(lambda x: math.floor(a*x / b) - a * math.floor(x / b))( np.arange(1, n+1)).max())
# np.vectorize(lambda x: math.floor(a*x / b) - a * math.floor(x / b))( np.arange(1, n+1)).max()

Fixed submission:
from math import floor

a, b, n = map(int, input().split())
        
x = min(n, b-1)
if x < 0:
    x = 0
    
print(floor(a*x / b) - a * floor(x / b))

Buggy python submission (verdict: Time Limit Exceeded):
import math

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

max_num = -99999999999999999999999

for i in range(n):
    x = i + 1
    num = math.floor(a*x / b) - a * math.floor(x / b)
    
    if num > max_num:
        max_num = num
        
print(max_num)

Fixed submission:
from math import floor

a, b, n = map(int, input().split())
        
x = min(n, b-1)
if x < 0:
    x = 0
    
print(floor(a*x / b) - a * floor(x / b))
Buggy python submission (verdict: Runtime Error):
S = input()
if '7' in S:
  print('Yes')
else
  print('No')


Fixed submission:
S = input()
if '7' in S:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from sklearn.utils.extmath import cartesian
 
k = int(input())
ls = [i for i in range(1, k+1)]
arr = cartesian([ls,ls,ls])
 
temp = np.gcd(arr[:, 0], arr[:, 1])
temp = np.gcd(temp, arr[:, 2])
print(sum(temp))

Fixed submission:
import numpy as np
from sklearn.utils.extmath import cartesian

k = int(input())
ls = [i for i in range(1, k+1)]
arr = cartesian([ls,ls,ls])

print(np.gcd(np.gcd(arr[:, 0], arr[:, 1]), arr[:, 2]).sum())

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from sklearn.utils.extmath import cartesian

k = int(input())
ls = [i for i in range(1, k+1)]
arr = cartesian([ls,ls,ls])

temp = np.gcd(arr[:, 0], arr[:, 1])
temp = np.gcd(temp, arr[:, 2])
print(sum(temp))


Fixed submission:
import numpy as np
from sklearn.utils.extmath import cartesian

k = int(input())
ls = [i for i in range(1, k+1)]
arr = cartesian([ls,ls,ls])

print(np.gcd(np.gcd(arr[:, 0], arr[:, 1]), arr[:, 2]).sum())