Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
D ={}
for i in range(n):
    s = input()
    if s in D.keys(): #sが辞書Dにあるのかチェック(これはある場合)
        D[s] += 1 #D[s] += 1 ->{'s':今までに出てきた回数+1}となる
    else:  #sが辞書Dにない場合
        D[s] = 1 #D[s] = 1 ->{'s':1}となる
poll = [j for j in D if D[j] == max(D.values())]
print('\n'.join(sorted(poll)))

Fixed submission:
n = int(input())
D ={}
for i in range(n):
    s = input()
    if s in D.keys(): #sが辞書Dにあるのかチェック(これはある場合)
        D[s] += 1 #D[s] += 1 ->{'s':今までに出てきた回数+1}となる
    else:  #sが辞書Dにない場合
        D[s] = 1 #D[s] = 1 ->{'s':1}となる
maxD = max(D.values())
poll = [k for k,v in D.items() if v == maxD]
print('\n'.join(sorted(poll)))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
D ={}
for i in range(n):
    s = input()
    if s in D.keys(): #sが辞書Dにあるのかチェック(これはある場合)
        D[s] += 1 #D[s] += 1 ->{'s':今までに出てきた回数+1}となる
    else:  #sが辞書Dにない場合
        D[s] = 1 #D[s] = 1 ->{'s':1}となる
poll = [k for k,v in D.items() if v == max(D.values())]
print('\n'.join(sorted(poll)))

Fixed submission:
n = int(input())
D ={}
for i in range(n):
    s = input()
    if s in D.keys(): #sが辞書Dにあるのかチェック(これはある場合)
        D[s] += 1 #D[s] += 1 ->{'s':今までに出てきた回数+1}となる
    else:  #sが辞書Dにない場合
        D[s] = 1 #D[s] = 1 ->{'s':1}となる
maxD = max(D.values())
poll = [k for k,v in D.items() if v == maxD]
print('\n'.join(sorted(poll)))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
D ={}
for i in range(n):
    s = input()
    if s in D.keys(): #sが辞書Dにあるのかチェック(これはある場合)
        D[s] += 1 #D[s] += 1 ->{'s':今までに出てきた回数+1}となる
    else:  #sが辞書Dにない場合
        D[s] = 1 #D[s] = 1 ->{'s':1}となる
poll = [k for k,v in D.items() if v == max(D.values())]
poll.sort()
for j in range(len(poll)):
    print(poll[j])

Fixed submission:
n = int(input())
D ={}
for i in range(n):
    s = input()
    if s in D.keys(): #sが辞書Dにあるのかチェック(これはある場合)
        D[s] += 1 #D[s] += 1 ->{'s':今までに出てきた回数+1}となる
    else:  #sが辞書Dにない場合
        D[s] = 1 #D[s] = 1 ->{'s':1}となる
maxD = max(D.values())
poll = [k for k,v in D.items() if v == maxD]
print('\n'.join(sorted(poll)))
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
h = list(map(int,input().split()))

sumh = sum(h)

if n <= k:
    print(0)
elif k == 0:
    print(sumh)
else:
    for i in range(k):
        sumh -= max(h)
        print(sumh)

Fixed submission:
n,k = map(int,input().split())
h = list(sorted(map(int,input().split())))

ans = 0

for i in range(n-k):
    ans += h[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
n,m = map(int,input().split())
price = list(map(int,input().split()))
price.sort(reverse=True)
while m != 0:
    tmp = max(price)
    tmp = tmp//2
    price[price.index(max(price))] = tmp
    m -= 1
print(sum(price))

Fixed submission:
import heapq
n,m = map(int,input().split())
p = list(map(int,input().split()))
price = [x*(-1) for x in p]
heapq.heapify(price)
while m != 0:
    max_price = heapq.heappop(price)*(-1)
    heapq.heappush(price,(max_price//2)*(-1))
    m -= 1
print(sum(price)*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
import math
n,m = map(int,input().split())
price = list(map(int,input().split()))
price.sort(reverse=True)
while m != 0:
    tmp = max(price)
    tmp = tmp//2
    price[price.index(max(price))] = tmp
    m -= 1
print(sum(price))

Fixed submission:
import heapq
n,m = map(int,input().split())
p = list(map(int,input().split()))
price = [x*(-1) for x in p]
heapq.heapify(price)
while m != 0:
    max_price = heapq.heappop(price)*(-1)
    heapq.heappush(price,(max_price//2)*(-1))
    m -= 1
print(sum(price)*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
import math
n,m = map(int,input().split())
price = list(map(int,input().split()))
price.sort(reverse=True)
real_price = 0
while m != 0:
    price[0] = price[0]//2
    price.sort(reverse=True)
    m -= 1

#for i in range(n):
#    real_price += math.floor(price[i])
#print(real_price)
print(sum(price))

Fixed submission:
import heapq
n,m = map(int,input().split())
p = list(map(int,input().split()))
price = [x*(-1) for x in p]
heapq.heapify(price)
while m != 0:
    max_price = heapq.heappop(price)*(-1)
    heapq.heappush(price,(max_price//2)*(-1))
    m -= 1
print(sum(price)*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
import math
n,m = map(int,input().split())
price = list(map(int,input().split()))
price.sort(reverse=True)
real_price = 0
while m != 0:
    price[0] = price[0]/2
    price.sort(reverse=True)
    m -= 1

for i in range(n):
    real_price += math.floor(price[i])
print(real_price)

Fixed submission:
import heapq
n,m = map(int,input().split())
p = list(map(int,input().split()))
price = [x*(-1) for x in p]
heapq.heapify(price)
while m != 0:
    max_price = heapq.heappop(price)*(-1)
    heapq.heappush(price,(max_price//2)*(-1))
    m -= 1
print(sum(price)*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
import math
n,m = map(int,input().split())
price = list(map(int,input().split()))
price.sort(reverse=True)
real_price = 0
while m != 0:
    price[0] = price[0]/2
    price.sort(reverse=True)
    m -= 1

for i in range(n):
    real_price += math.floor(price[i])
print(real_price)

Fixed submission:
import heapq
n,m = map(int,input().split())
p = list(map(int,input().split()))
price = [x*(-1) for x in p]
heapq.heapify(price)
while m != 0:
    max_price = heapq.heappop(price)*(-1)
    heapq.heappush(price,(max_price//2)*(-1))
    m -= 1
print(sum(price)*(-1))
Buggy python submission (verdict: Runtime Error):
import math

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

num1 = B // C - (A-1) // C
num2 = B // D - (A-1) // D
gcdCD = C * D // math.gcd(C, D)
num3 = B // gcdCD - (A-1) // gcdCD

print(B - A - num1 - num2 + num3 + 1)

Fixed submission:
from fractions import gcd
a,b,c,d = map(int,input().split())
n = (a-1)//c #1~a-1までのcで割り切れる数
m = b//c #1~bまでのcで割り切れる数
ck = m - n #a~bまでのcで割り切れる数

o = (a-1)//d #1~a-1までのdで割り切れる数
p = b//d #1~bまでのdで割り切れる数
dk = p - o #a~bまでのdで割り切れる数

#cでもdでも割り切れる場合
e = (c * d) // gcd(c, d) #cとdの最小公倍数
q = (a-1)//e #1~a-1までのeで割り切れる数
r = b//e #1~bまでのeで割り切れる数
ek = r - q #a~bまでのeで割り切れる数

#cまたはdで割り切れる数
cord = ck + dk - ek

ans = b - a + 1 - cord
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
n = (a-1)//c #1~a-1までのcで割り切れる数
m = b//c #1~bまでのcで割り切れる数
ck = m - n #a~bまでのcで割り切れる数

o = (a-1)//d #1~a-1までのdで割り切れる数
p = b//d #1~bまでのdで割り切れる数
dk = p - o #a~bまでのdで割り切れる数

#cでもdでも割り切れる場合
e = (c * d) // math.gcd(c, d) #cとdの最小公倍数
q = (a-1)//e #1~a-1までのeで割り切れる数
r = b//e #1~bまでのeで割り切れる数
ek = r - q #a~bまでのeで割り切れる数

#cまたはdで割り切れる数
cord = ck + dk - ek

ans = b - a + 1 - cord
print(ans)

Fixed submission:
from fractions import gcd
a,b,c,d = map(int,input().split())
n = (a-1)//c #1~a-1までのcで割り切れる数
m = b//c #1~bまでのcで割り切れる数
ck = m - n #a~bまでのcで割り切れる数

o = (a-1)//d #1~a-1までのdで割り切れる数
p = b//d #1~bまでのdで割り切れる数
dk = p - o #a~bまでのdで割り切れる数

#cでもdでも割り切れる場合
e = (c * d) // gcd(c, d) #cとdの最小公倍数
q = (a-1)//e #1~a-1までのeで割り切れる数
r = b//e #1~bまでのeで割り切れる数
ek = r - q #a~bまでのeで割り切れる数

#cまたはdで割り切れる数
cord = ck + dk - ek

ans = b - a + 1 - cord
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
n = (a-1)//c #1~a-1までのcで割り切れる数
m = b//c #1~bまでのcで割り切れる数
ck = m - n #a~bまでのcで割り切れる数

o = (a-1)//d #1~a-1までのdで割り切れる数
p = b//d #1~bまでのdで割り切れる数
dk = p - o #a~bまでのdで割り切れる数

#cでもdでも割り切れる場合
e = (c * d) // math.gcd(c, d) #cとdの最小公倍数
q = (a-1)//e #1~a-1までのeで割り切れる数
r = b//e #1~bまでのeで割り切れる数
ek = r - q #a~bまでのeで割り切れる数

#cまたはdで割り切れる数
cord = ck + dk - ek

ans = b - a + 1 - cord
print(ans)

Fixed submission:
from fractions import gcd
a,b,c,d = map(int,input().split())
n = (a-1)//c #1~a-1までのcで割り切れる数
m = b//c #1~bまでのcで割り切れる数
ck = m - n #a~bまでのcで割り切れる数

o = (a-1)//d #1~a-1までのdで割り切れる数
p = b//d #1~bまでのdで割り切れる数
dk = p - o #a~bまでのdで割り切れる数

#cでもdでも割り切れる場合
e = (c * d) // gcd(c, d) #cとdの最小公倍数
q = (a-1)//e #1~a-1までのeで割り切れる数
r = b//e #1~bまでのeで割り切れる数
ek = r - q #a~bまでのeで割り切れる数

#cまたはdで割り切れる数
cord = ck + dk - ek

ans = b - a + 1 - cord
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
a = [int(input()) for i in range(m)]

mod = 10**9+7
dp = [0] * (n+1)
dp[0] = 1

for i in range(1,n+1):
    if i in a:
        continue
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % mod
print(dp[-1])

Fixed submission:
n,m = map(int,input().split())
mod = 10**9+7
a = set()
for i in range(m):
  s = int(input())
  a.add(s)
  
dp = [0]*(n+1)
dp[0] = 1
for i in range(1,n+1):
  if i in a:
    continue
  dp[i] = (dp[i-1] + dp[i-2]) % mod
  
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
a = [int(input()) for i in range(m)]

mod = 10**9+7
dp = [0] * (n+1)
dp[0] = 1

for i in range(1,n+1):
    if i in a:
        continue
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % mod
print(dp[-1])

Fixed submission:
n,m = map(int,input().split())
mod = 10**9+7
a = set()
for i in range(m):
  s = int(input())
  a.add(s)
  
dp = [0]*(n+1)
dp[0] = 1
for i in range(1,n+1):
  if i in a:
    continue
  dp[i] = (dp[i-1] + dp[i-2]) % mod
  
print(dp[-1])

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = [int(input()) for i in range(m)]
mod = 10**9+7
dp = [0]*n
dp[0] = 1
dp[1] = 2
for i in range(2,n):
    if i+1 in a:
        dp[i] = 0
    else:
        dp[i] = (dp[i-1] + dp[i-2])%mod
print(dp[n-1])

Fixed submission:
n,m = map(int,input().split())
mod = 10**9+7
a = set()
for i in range(m):
  s = int(input())
  a.add(s)
  
dp = [0]*(n+1)
dp[0] = 1
for i in range(1,n+1):
  if i in a:
    continue
  dp[i] = (dp[i-1] + dp[i-2]) % mod
  
print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n,k = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
start = 0
end = k
count = 0
for i in range(n):
    if all(x==1 for x in a):
        print(count)
        sys.exit()
    a[start:end] = [1]*k
    start += (k-1)
    end += (k-1)
    count += 1

Fixed submission:
import sys
n,k = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
start = 0
end = k
count = 0
for i in range(n):
    if a[n-1]==1:
        print(count)
        sys.exit()
    a[start:end] = [1]*k
    start += (k-1)
    end += (k-1)
    count += 1
Buggy python submission (verdict: Runtime Error):
import collections
n = int(input())
a = list(map(int,input().split()))
b = [0]*(n//2)
c = [0]
d = [0]*(n//2)
e = []
lot = 10**9 + 7
ans = 2**(n//2)%lot
for i in range(n):
    b[i] = n-(2*i+1)
    if b[i] == 1 or b[i] == 2:
        break
for i in range(n):
    d[i] = n-(2*i+1)
    if d[i] == 1 or b[i] == 2:
        break
if n%2 == 0:
    e = b + d
else:
    e = b + c + d

count1 = collections.Counter(a)
count2 = collections.Counter(e)

if count1 == count2:
    print(ans)
else:
    print(0)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7
ans = 2**(n//2)%mod
if n % 2 == 0:
    l = n ** 2
else:
    l = (n - 1) * (n + 1)
if sum(a) == l // 2:
    print(ans)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
import collections
n = int(input())
a = list(map(int,input().split()))
b = [0]*(n//2)
c = [0]
d = [0]*(n//2)
e = []
for i in range(n):
    b[i] = n-(2*i+1)
    if b[i] == 1 or b[i] == 2:
        break
for i in range(n):
    d[i] = n-(2*i+1)
    if d[i] == 1 or b[i] == 2:
        break
if n%2 == 0:
    e = b + d
else:
    e = b + c + d

count1 = collections.Counter(a)
count2 = collections.Counter(e)

if count1 == count2:
    print(2**(n//2))
else:
    print(0)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7
ans = 2**(n//2)%mod
if n % 2 == 0:
    l = n ** 2
else:
    l = (n - 1) * (n + 1)
if sum(a) == l // 2:
    print(ans)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):

s = str(input())
r = 0
a = s.find("R")
if a==-1:
    print(r)
else:
    r+=1
    while(s[a+1]=="R"):
        r+=1
        a+=1
    print(r)

Fixed submission:

s = str(input())
r = 0
a = s.find("R")
if a==-1:
    print(r)
else:
    r+=1
    if a<2:
        while(s[a+1]=="R"):
            r+=1
            a+=1
            if a==2:
                break
    print(r)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
a = list(map(int,input().split()))
i = k
for _ in range(n-k):
    if sum(a[i-k+1:i+1])>sum(a[i-k:i]):
        print("Yes")
    else:
        print("No")
    i+=1

Fixed submission:
n,k = map(int,input().split())
a = list(map(int,input().split()))
temp,i = sum(a[:k]),k
for _ in range(n-k):
    score = temp+a[i]-a[i-k]
    print("Yes" if score>temp else "No")
    temp = score
    i+=1

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
a = list(map(int,input().split()))
temp,i = sum(a[:k]),k+1
for _ in range(n-k):
    score = sum(a[i-k:i])
    print("Yes" if score>temp else "No")
    temp = score
    i+=1

Fixed submission:
n,k = map(int,input().split())
a = list(map(int,input().split()))
temp,i = sum(a[:k]),k
for _ in range(n-k):
    score = temp+a[i]-a[i-k]
    print("Yes" if score>temp else "No")
    temp = score
    i+=1

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
a = list(map(int,input().split()))
s,e = 1,k+1
temp = sum(a[:k])
for i in range(n-k):
    score = sum(a[s:e])
    print("Yes" if score>temp else "No")
    temp = score
    s+=1
    e+=1

Fixed submission:
n,k = map(int,input().split())
a = list(map(int,input().split()))
temp,i = sum(a[:k]),k
for _ in range(n-k):
    score = temp+a[i]-a[i-k]
    print("Yes" if score>temp else "No")
    temp = score
    i+=1

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
a = list(map(int,input().split()))
s,e = 1,k+1
temp = 1
for i in range(k):
    temp *= a[i]
for i in range(n-k):
    score = 1
    for j in range(s,e):
        score *= a[j]
    print("Yes" if score>temp else "No")
    temp = score
    s+=1
    e+=1

Fixed submission:
n,k = map(int,input().split())
a = list(map(int,input().split()))
temp,i = sum(a[:k]),k
for _ in range(n-k):
    score = temp+a[i]-a[i-k]
    print("Yes" if score>temp else "No")
    temp = score
    i+=1
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
q = int(input())
res = []
for i in range(q):
    b,c = map(int,input().split())
    while b in a:
        a.remove(b)
        a.append(c)
    res.append(sum(a))

for x in res:
    print(x)


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
q = int(input())
res = sum(a)
temp = [0]*100001
for x in a:
    temp[x] += 1
for i in range(q):
    b,c = map(int,input().split())
    res -= b*temp[b]
    temp[c] += temp[b]
    res += c*temp[b]
    temp[b] = 0
    print(res)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
q = int(input())
b,c = [],[]
for i in range(q):
    B,C = map(int,input().split())
    b.append(B)
    c.append(C)
for i in range(q):
    while b[i] in a:
        a.remove(b[i])
        a.append(c[i])
    print(sum(a))


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
q = int(input())
res = sum(a)
temp = [0]*100001
for x in a:
    temp[x] += 1
for i in range(q):
    b,c = map(int,input().split())
    res -= b*temp[b]
    temp[c] += temp[b]
    res += c*temp[b]
    temp[b] = 0
    print(res)
Buggy python submission (verdict: Runtime Error):
def tag(a,b,v,w,t):
    if w>=v:
        return "NO"
    elif w==v:
        res = a+(v*(t+1))-b(w+t)
        if res>-1:
            return "YES"
        return "NO"
    else:
        res = a+(v*t)-b(w+t)
        if res>-1:
            return "YES"
        return "NO"

if __name__ == "__main__":
    a,v = map(int,input().split())
    b,w = map(int,input().split())
    t = int(input())
    print(tag(a,b,v,w,t))

Fixed submission:
def tag(a,b,v,w,t):
    res = (v*t)-(abs(b-a)+(w*t))
    if res>=0:
        return "YES"
    return "NO"

if __name__ == "__main__":
    a,v = map(int,input().split())
    b,w = map(int,input().split())
    t = int(input())
    print(tag(a,b,v,w,t))
Buggy python submission (verdict: Runtime Error):
n = int(input())
nums = list(map(int,input().split()))
limit = 10**18
res = 1
i = 0
if 0 in num:
    print(0)
    exit()
while i<n:
    res *= nums[i]
    i += 1
    if res > limit:
        res = -1
        break
print(res)

Fixed submission:
n = int(input())
nums = list(map(int,input().split()))
limit = 10**18
res = 1
i = 0
if 0 in nums:
    print(0)
    exit()
while i<n:
    res *= nums[i]
    i += 1
    if res > limit:
        res = -1
        break
print(res)
Buggy python submission (verdict: Runtime Error):
from decimal import Decimal
m,n = map(eval,input().split())
print(Decimal(m)*Decimal(b))

Fixed submission:
from decimal import Decimal
m,n = input().split()
print(int(Decimal(m)*Decimal(n)))
Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
if X == 1:
    print(0,-1)
    exit()
for i in range(-1,X//5):
    for j in range(-1,X//5):
        if (i**5) - (j**5) == X:
            print(i,j)
            exit()

Fixed submission:
X = int(input())
for i in range(-500,500):
    for j in range(-500,500):
        if (i**5) - (j**5) == X:
            print(i,j)
            exit()
Buggy python submission (verdict: Runtime Error):
import itertools
N, M, Q = map(int,input().split())
L = []
for _ in range(Q):
    L.append(list(map(int,input().split())))

A = itertools.combinations_with_replacement([i for i in range(1,M+1)], N)
count = []
for a in A:
    temp = 0
    for l in l:
        if a[l[1]-1] - a[l[0]-1] == l[2]:
            temp += l[3]
    count.append(temp)
print(max(count))

Fixed submission:
import itertools
N, M, Q = map(int,input().split())
L = []
for _ in range(Q):
    L.append(list(map(int,input().split())))

A = itertools.combinations_with_replacement([i for i in range(1,M+1)], N)
count = []
for a in A:
    temp = 0
    for l in L:
        if a[l[1]-1] - a[l[0]-1] == l[2]:
            temp += l[3]
    count.append(temp)
print(max(count))

Buggy python submission (verdict: Runtime Error):
import itertools
N, M, Q = map(int,input().split())
L = []
for _ in range(Q):
    L.append(list(map(int,input().split())))

A = itertools.combinations_with_replacement([i for i in range(1,M+1)], N)
count = []
for a in A:
    temp = 0
    for l in l:
        if a[l[1]-1] - a[l[0]-1] == l[2]:
            temp += l[3]
    count.append(temp)
print(max(count))

Fixed submission:
import itertools
N, M, Q = map(int,input().split())
L = []
for _ in range(Q):
    L.append(list(map(int,input().split())))

A = itertools.combinations_with_replacement([i for i in range(1,M+1)], N)
count = []
for a in A:
    temp = 0
    for l in L:
        if a[l[1]-1] - a[l[0]-1] == l[2]:
            temp += l[3]
    count.append(temp)
print(max(count))
Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = map(int,input().split())
res = []
for x in range(1,N+1):
    res.append(int(A*x/B) - (A*int(x/B)))
print(max(res))

Fixed submission:
A, B, N = map(int,input().split())
x = min(B-1,N)
res = int(A*x/B) - (A*int(x/B))
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
import math
A, B, N = map(int,input().split())
x = [i for i in range(1,N+1)]
res = [math.floor(A*x[i]/B) - (A*math.floor(x[i]/B)) for i in range(N)]
print(max(res))

Fixed submission:
A, B, N = map(int,input().split())
x = min(B-1,N)
res = int(A*x/B) - (A*int(x/B))
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
import math
A, B, N = map(int,input().split())
x = [i for i in range(1,N+1)]
res = []
for i in range(N):
    ans = math.floor(A*x[i]/B) - (A*math.floor(x[i]/B))
    res.append(ans)
print(max(res))

Fixed submission:
A, B, N = map(int,input().split())
x = min(B-1,N)
res = int(A*x/B) - (A*int(x/B))
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
l = []
for i in range(1,N+1):
    l.append(A.count(i))
    print(l[i-1])
    if sum(l)==N-1:
        break
num = N-len(l)
print(("0\n"*num).strip())

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
l = []
for _ in range(N):
    l.append(0)
for i in A:
    l[i-1] +=1
for x in l:
    print(x)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
l = []
for i in range(1,N+1):
    l.append(A.count(i))
    if sum(l)==N-1:
        break
for i in range(len(l)):
    print(l[i])
for _ in range(N-len(l)):
    print(0)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
l = []
for _ in range(N):
    l.append(0)
for i in A:
    l[i-1] +=1
for x in l:
    print(x)
Buggy python submission (verdict: Runtime Error):
N, K = map(int,input().split())
if K == 1 or N == 0 or N == K or N%K==0:
    print(0)
    exit()
elif K == 0 or K > N:
    print(N)
    exit()
elif N == 1 or N == K-1 or K == N-1:
    print(1)
    exit()
elif N > K:
    ans = (N//K) + 1
    res = abs(N - (K*ans))
    print(res)
    exit()

Fixed submission:
x, y, z = map(int, input().split())
print(z,x,y)

Buggy python submission (verdict: Runtime Error):
N, K = map(int,input().split())
if K == 1 or N == 0 or N == K:
    print(0)
    exit()
elif K == 0:
    print(N)
    exit()
elif N == 1:
    print(1)
    exit()
else:
    l = []
    ans = N
    for i in range(max(N,K)):
        ans = abs(ans - K)
        l.append(ans)
    print(min(l))

Fixed submission:
x, y, z = map(int, input().split())
print(z,x,y)

Buggy python submission (verdict: Runtime Error):
N, K = map(int,input().split())
if K == 1 or N == 0 or N == K:
    print(0)
    exit()
elif K == 0:
    print(N)
    exit()
elif N == 1:
    print(1)
    exit()
else:
    l = []
    ans = N
    for i in range(max(N,K)):
        ans = abs(ans - K)
        l.append(ans)
        if i >= 1:
            if ans in l:
                print(min(l))
                exit()
    print(min(l))

Fixed submission:
x, y, z = map(int, input().split())
print(z,x,y)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

ans = all(a%3==0 or a%5==0 for a in A if a%2==0)
if ans:
    print("APPROVED")
else:
    print("DENIED")


Fixed submission:
A, B, C = map(int, input().split())
if A == B and A == C:
    print("No")
elif A == B or A == C or B == C:
    print("Yes")
else:
    print("No")

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

ans = False
for a in n:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            ans = True
if ans:
    print("APPROVED")
else:
    print("DENIED")


Fixed submission:
A, B, C = map(int, input().split())
if A == B and A == C:
    print("No")
elif A == B or A == C or B == C:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
for a in A:
    if a%2==0:
        if a%3==0 or a%5==0:
            ans = 1
        else:
            ans = 0

if ans == 1:
    print("APPROVED")
else:
    print("DENIED")


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

ans = all(a%3==0 or a%5==0 for a in A if a%2==0)
if ans:
    print("APPROVED")
else:
    print("DENIED")

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

for a in n:
    if a % 2 == 0:
        ans = all(a%3==0 or a%5==0)
if ans:
    print("APPROVED")
else:
    print("DENIED")


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

ans = all(a%3==0 or a%5==0 for a in A if a%2==0)
if ans:
    print("APPROVED")
else:
    print("DENIED")