Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split(" ")))
b = list(map(int, input().split(" ")))
c = list(map(int, input().split(" ")))

b_sum = sum(b)

c_sum = 0
for i in range(n-1):
    if a[i] != n:
        if a[i] + 1 == a[i+1]:
            c_sum += c[ai-1]

print(b_sum + c_sum)

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

b_sum = sum(b)

c_sum = 0
for i in range(n-1):
    if a[i] != n:
        if a[i] + 1 == a[i+1]:
            c_sum += c[a[i]-1]

print(b_sum + c_sum)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split(" ")))
b = list(map(int, input().split(" ")))
c = list(map(int, input().split(" ")))

b_sum = sum(b)

c_sum = 0
for i in range(n-1):
    if a[i] != n and a[i] + 1 == a[i+1]:
        c_sum += c[ai-1]

print(b_sum + c_sum)

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

b_sum = sum(b)

c_sum = 0
for i in range(n-1):
    if a[i] != n:
        if a[i] + 1 == a[i+1]:
            c_sum += c[a[i]-1]

print(b_sum + c_sum)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split(" "))
b = map(int, input().split(" "))
c = map(int, input().split(" "))

b_sum = sum(b)

c_sum = 0
for i in range(n-1):
    ai = a[i]
    if ai != n:
        c_sum += c[ai-1]

print(b_sum + c_sum)


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

b_sum = sum(b)

c_sum = 0
for i in range(n-1):
    if a[i] != n:
        if a[i] + 1 == a[i+1]:
            c_sum += c[a[i]-1]

print(b_sum + c_sum)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split(" ")))

plsl = []
plsn = 0
for i in range(n-1):
    if h[i]>= h[i+1] and i == n-2:
        plsn += 1
        # print(plsn)
        plsl.append(plsn)
        # print(plsl)
    elif h[i]>= h[i+1] and i < n-2:
        plsn += 1
        # print(plsn)
    else:
        plsl.append(plsn)
        # print(plsl)
        plsn = 0
        # print(plsn)
plsl.sort(reverse = True)
print(plsl[0])

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
answer = -1#これなに
m = 0#カウントするやつやね
for i in range(n-1):
    if h[i] >= h[i+1]:
        m += 1
    else:
        answer = max(answer,m)
        m = 0
answer = max(answer,m)
print(answer)

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

plsl = []
plsn = 0
for i in range(n-1):
    if h[i]>= h[i+1] and i == n-2:
        plsn += 1
        # print(plsn)
        plsl.append(plsn)
        # print(plsl)
    elif h[i]>= h[i+1] and i < n-1:
        plsn += 1
        # print(plsn)
    else:
        plsl.append(plsn)
        # print(plsl)
        plsn = 0
        # print(plsn)
plsl.sort(reverse = True)
print(plsl[0])


Fixed submission:
n = int(input())
h = list(map(int, input().split()))
answer = -1#これなに
m = 0#カウントするやつやね
for i in range(n-1):
    if h[i] >= h[i+1]:
        m += 1
    else:
        answer = max(answer,m)
        m = 0
answer = max(answer,m)
print(answer)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split(" ")))

plsl = []
plsn = 0
for i in range(n-1):
    if h[i]>= h[i+1] and i == n-2:
        plsn += 1
        # print(plsn)
        plsl.append(plsn)
        # print(plsl)
    elif h[i]>= h[i+1] and i =< n-1:
        plsn += 1
        # print(plsn)
    else:
        plsl.append(plsn)
        # print(plsl)
        plsn = 0
        # print(plsn)
plsl.sort(reverse = True)
print(plsl[0])

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

v.sort()
# print(v)
w = []

w0 = (v[0] + v[1])/2
w.append(w0)

for i in range(1,n-1):
    y = (v[i+1] + w[i-1])/2
    w.append(y)
    # print(w)
# print(w)
print(w[n-2])

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

plsl = []
plsn = 0
for i in range(n-1):
    if h[i]>= h[i+1] and i == n-1:
        plsn += 1
        # print(plsn)
        plsl.append(plsn)
        # print(plsl)
    elif h[i]>= h[i+1] and i < n-1:
        plsn += 1
        # print(plsn)
    else:
        plsl.append(plsn)
        # print(plsl)
        plsn = 0
        # print(plsn)
plsl.sort(reverse = True)
print(plsl[0])

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

v.sort()
# print(v)
w = []

w0 = (v[0] + v[1])/2
w.append(w0)

for i in range(1,n-1):
    y = (v[i+1] + w[i-1])/2
    w.append(y)
    # print(w)
# print(w)
print(w[n-2])
Buggy python submission (verdict: Runtime Error):
s = int(input())

if s[0] == s[1]:
    if s[2] == s[3]:
        print("Yes")
    else:
        print("No")

if s[0] == s[2]:
    if s[1] == s[3]:
        print("Yes")
    else:
        print("No")

if s[0] == s[3]:
    if s[2] == s[1]:
        print("Yes")
    else:
        print("No")

Fixed submission:
s = input()
s_list = list(s)
s_list.sort()

if s_list[0] == s_list[1] and s_list[2] == s_list[3] and s_list[0] != s_list[2]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
s = int(input())
sorted(s)

if s[0] == s[1] and s[2] == s[3]:
    print("Yes")
else:
    print("No")

Fixed submission:
s = input()
s_list = list(s)
s_list.sort()

if s_list[0] == s_list[1] and s_list[2] == s_list[3] and s_list[0] != s_list[2]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
for i in range(1,4):
    if s[0] == s[i]:
        for j in range(2,4):
            if s[1] == s[j]
    else:
        print("No") 
        exit()
print("Yes")

Fixed submission:
s = input()
s_list = list(s)
s_list.sort()

if s_list[0] == s_list[1] and s_list[2] == s_list[3] and s_list[0] != s_list[2]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
s = int(input())

for i in range(1,4):
    if s[0] == s[i]:
        for j in range(2,4):
            if s[1] == s[j]
    else:
        print("No") 
        exit()
    print("Yes")

Fixed submission:
s = input()
s_list = list(s)
s_list.sort()

if s_list[0] == s_list[1] and s_list[2] == s_list[3] and s_list[0] != s_list[2]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
o_list = o.split(" ")
o_list_i = [int(s) for s in o_list]
o_list_i.sort()

o0 = int(o_list_i[0])
o1 = int(o_list_i[1])
print( o0 + o1 )

Fixed submission:
o = input()
o_list = o.split(" ")

p = int(o_list[0])
q = int(o_list[1])
r = int(o_list[2])
pq = p + q
qr = q + r
rp = r + p

if pq <= qr and pq <= rp:
    print(pq)
elif qr <= rp and qr <= pq:
    print(qr)
elif rp <= pq and rp <= qr:
    print(rp)
Buggy python submission (verdict: Runtime Error):
x = input().split(" ")
a = int(x[0])
b = int(x[1])

ans = 0
num = 0
while num < 2:
    if a >= b:
        ans += a
        a -= 1
    else:
        asn += b
        b -= 1
    num += 1
print(ans)

Fixed submission:
x = input().split(" ")
a = int(x[0])
b = int(x[1])

ans = 0
num = 0

while num < 2:
    if a >= b:
        ans += a
        a -= 1
    else:
        ans += b
        b -= 1
    num += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if (e-a) =< k:
    print("Yay!")
else:
    print(":(")


Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

i = e-a

if i <= k:
    print("Yay!")
else:
    print(":(")
Buggy python submission (verdict: Runtime Error):
l = input().split(" ")
s = input().split(" ")

H = int(l[0])
W = int(l[1])
h = int(s[0])
w = int(s[1])

print(HW-(wH + hW - wh))

Fixed submission:
l = input().split(" ")
s = input().split(" ")

H = int(l[0])
W = int(l[1])
h = int(s[0])
w = int(s[1])

print(H*W-(w*H + h*W - w*h))
Buggy python submission (verdict: Runtime Error):
x = int(input())
if x = 3 or x = 5 or x = 7:
    print("YES")
else:
    print("NO")

Fixed submission:
x = int(input())
if x == 3 or x == 5 or x == 7:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
count = int(input())
a = list(map(int, input().split()))
total = 1
for i in a:
    total = total*i
if total>10**18:
    print(-1)
else:
    print(total)


Fixed submission:
import sys
count = int(input())
a = list(map(int, input().split()))
#0が出た時点で終了する
for i in a:
    if i == 0:
        print(0)
        sys.exit()
#合計の計算        
total = 1
for j in a:
    total = total*j
    #10^18超えた時点で終了する
    if total>10**18:
        print(-1)
        sys.exit()

print(total)
Buggy python submission (verdict: Time Limit Exceeded):
a,b = map(int, input().split())

if b == 1:
    print(0)
    exit()
      
while True:
    x = abs(a-b)
    if x < a:
        a = x
    else:
        print(a)
        break

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

if a > b:
    if a % b == 0:
        print(0)
        exit()
    else:
        print(min(a%b, b-(a%b)))
        exit()

while True:
    x = abs(a-b)
    if x < a:
        a = x
    else:
        print(a)
        break
Buggy python submission (verdict: Runtime Error):
s = input().split()
a = list(s)
if a[2] == a[3] and a[4] == a[5]:
    print("Yes")
else:
    print("No")    


Fixed submission:
s = input()
a = list(s)
if a[2] == a[3] and a[4] == a[5]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = input()
if n.count() == 0:
    print('No')
else:
    print('Yes')

Fixed submission:
n = input()
if n.count('7') == 0:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
num = abs(n - k)
tmp = n % num
print(min(tmp, abs(tmp - k)))

Fixed submission:
n, k = map(int, input().split())
num = abs(n - k)
if num == 0:
    print(0)
    exit()
tmp = n % k
print(min(tmp, abs(tmp - k)))
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
n, k = map(int, input().split())
p = list(map(int, input().split()))

ans = 0
for i in range(n - k + 1):
    tmp = sum(p[i: i + k])
    if ans < tmp:
        ans = tmp

print((ans + k) / 2)



Fixed submission:
# coding: utf-8
n, k = map(int, input().split())
p = list(map(int, input().split()))
res = [0]
ra = res.append
for i in range(n):
    ra(p[i] + res[i])

ans = 0
for i in range(n - k + 1):
    tmp = res[i + k] - res[i]
    if ans < tmp:
        ans = tmp

print((ans + k) / 2)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
n, k = map(int, input().split())
p = list(map(int, input().split()))
p = list(map(lambda x: x * (x + 1) / (2 * x), p))

ans = 0
for i in range(n - k + 1):
    tmp = sum(p[i: i + k])
    ans = max(ans, tmp)

print(ans)


Fixed submission:
# coding: utf-8
n, k = map(int, input().split())
p = list(map(int, input().split()))
res = [0]
ra = res.append
for i in range(n):
    ra(p[i] + res[i])

ans = 0
for i in range(n - k + 1):
    tmp = res[i + k] - res[i]
    if ans < tmp:
        ans = tmp

print((ans + k) / 2)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
if n =< k:
    print(n)
else:
    print(sum(h[0: n - k]) + k)


Fixed submission:
# coding: utf-8
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
if n <= k:
    print(0)
else:
    print(sum(h[0: n - k]))
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
n = int(input())
lst = list(map(int, input().split()))
cnt = 0
data = []
for i in range(n - 1):
    if lst[i] >= lst[i + 1]:
        cnt += 1
    else:
        data.append(cnt)
        cnt = 0
print(max(cnt))


Fixed submission:
# coding: utf-8
n = int(input())
lst = list(map(int, input().split()))
cnt = 0
data = []
for i in range(n - 1):
    if lst[i] >= lst[i + 1]:
        cnt += 1
    else:
        data.append(cnt)
        cnt = 0
data.append(cnt)
print(max(data))
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
n = int(input())
a = list(map(int, input().split()))

tmp = 0
for i in a:
    tmp += 1 / a

print(tmp)


Fixed submission:
# coding: utf-8
n = int(input())
a = list(map(int, input().split()))

tmp = 0
for i in a:
    tmp += 1 / i

print(1 / tmp)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
n = int(input())
lst = [input() for i in range(n)]
cnt = 0
for j in range(n - 1):
    for k in range(j + 1, n):
        if sorted(list(lst[j])) == sorted(list(lst[k])):
            cnt += 1

print(cnt)


Fixed submission:
# coding: utf-8
from collections import Counter
n = int(input())
lst = [input() for i in range(n)]
cnt = Counter()
ans = 0
for i in lst:
    a = ''.join(sorted(list(i)))
    if a in cnt:
        ans += cnt[a]
    cnt[a] += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
data = list(input())
removed_block = 0
i = 1
log = data[0]
while i < (len(data) + 1):
    try:
        if data[i] != log:
            data.pop(i)
            data.pop(i - 1)
            removed_block += 2
            i = 1
            log = data[0]
        else:
            i += 1
    except:
        break
print(removed_block)


Fixed submission:
# # coding: utf-8
# data = list(input())
# removed_block = 0
# i = 1
# log = data[0]
# while i < (len(data) + 1):
#     try:
#         if data[i] != log:
#             data.pop(i)
#             data.pop(i - 1)
#             removed_block += 2
#             i = 1
#             log = data[0]
#         else:
#             i += 1
#     except:
#         break
# print(removed_block)

# coding: utf-8
n = input()
print(min(n.count('0'), n.count('1')) * 2)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
n = int(input())
l = list(map(int, input().split()))
if len(set(l)) == 3:
    print('Three')
else:
    print('Four')


Fixed submission:
# coding: utf-8
# Your code here!
n = int(input())
l = list(map(str, input().split()))
if len(set(l)) == 3:
    print('Three')
else:
    print('Four')
Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
a=0
for i in len(s):
  if s[i]=!t[i]:
    a +=
print(a)
 


Fixed submission:
s=input()
t=input()
a=0
for i in range(len(s)):
    if s[i]!=t[i]:
        a += 1
print(a)

Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
a=0
for i in len(s):
  if s[i]=!t[i]:
  a +=
print(a)
 

Fixed submission:
s=input()
t=input()
a=0
for i in range(len(s)):
    if s[i]!=t[i]:
        a += 1
print(a)
Buggy python submission (verdict: Runtime Error):
x=input()
y=input()
if 2*x <= y <= 4*x and y%2 == 0:
  print("Yes")
else:
  print("No")

Fixed submission:
S = input( ).split( )
x = int(S[0])
y = int(S[1])
if 2*x <= y <= 4*x and y%2 == 0:
  print("Yes")
else: print("No")

Buggy python submission (verdict: Runtime Error):
x=input()
y=input()
if 2*x <= y <= 4*x and y%2 == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
S = input( ).split( )
x = int(S[0])
y = int(S[1])
if 2*x <= y <= 4*x and y%2 == 0:
  print("Yes")
else: print("No")
Buggy python submission (verdict: Runtime Error):
¥N=int(input())
F=N//3
B=N//5
fb=N//15
S=(N*(N+1))//2
Fizz=(3*F*(F+1))//2
Buzz=(5*B*(B+1))//2
FizzBuzz=(15*fb*(fb+1))//2
print(S-Fizz-Buzz+FizzBuzz)




Fixed submission:
N=int(input())
F=N//3
B=N//5
fb=N//15
S=(N*(N+1))//2
Fizz=(3*F*(F+1))//2
Buzz=(5*B*(B+1))//2
FizzBuzz=(15*fb*(fb+1))//2
print(S-Fizz-Buzz+FizzBuzz)
Buggy python submission (verdict: Runtime Error):
x = int(input())
for i in range(120):
  for j in range(-119, a):
    if i**5 - j**5 == x:
      print(i, j)
      exit()

Fixed submission:
import math
def main():
  x = int(input())
  r = range(-1000,1000)
  for i in r:
    for j in r:
      if math.pow(i, 5) - math.pow(j, 5) == x:
        print(str(i) + ' ' + str(j))
        return
main()
Buggy python submission (verdict: Runtime Error):
def main():
 n,*a=map(int,open(0).read().split());d,s=[0]*n,0
 for i,x in enumerate(a):
  if i+x<n:d[i+x]+=1
  s+=d[i-x]
 print(s)
main()

Fixed submission:
from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
d = defaultdict(int)
for i in range(n):
  d[i+a[i]] += 1
ans = 0
for i in range(n):
  ans += d[i-a[i]]
print(ans)

Buggy python submission (verdict: Runtime Error):
def main():
 n,a=map(int,open(0).read().split());d,s=[0]*n,0
 for i,x in enumerate(a):
  if i+x<n:d[i+x]+=1
  if i-x>=0:s+=d[i-x]
 print(s)
main()

Fixed submission:
from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
d = defaultdict(int)
for i in range(n):
  d[i+a[i]] += 1
ans = 0
for i in range(n):
  ans += d[i-a[i]]
print(ans)

Buggy python submission (verdict: Runtime Error):
def main():
 n,a,d = int(input()),list(map(int, input().split())),[0]*n
 for i,x in enumerate(a):
  if i+x < n: d[i+x] += 1
 print(sum([d[i-x] for i,x in enumerate(a) if i-x>=0]))
main()

Fixed submission:
from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
d = defaultdict(int)
for i in range(n):
  d[i+a[i]] += 1
ans = 0
for i in range(n):
  ans += d[i-a[i]]
print(ans)

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

Fixed submission:
from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
d = defaultdict(int)
for i in range(n):
  d[i+a[i]] += 1
ans = 0
for i in range(n):
  ans += d[i-a[i]]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, n = map(int, input().split())
ans = 0
s = int(b/a)
e = min(n+1,b)
for i in range(s, e):
  x = (int(a*i/b)-a*int(i/b))
  if ans < x:
    ans = x
print(ans)

Fixed submission:
a, b, n = map(int, input().split())
ans = 0
e = min(n+1,b)
s = max(int(b/a),e-1000)
for i in range(s, e):
  x = (int(a*i/b)-a*int(i/b))
  if ans < x:
    ans = x
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, n = map(int, input().split())
ans = 0
e = min(n+1,b)
for i in range(int(b/a), e):
  if ans < (int(a*i/b)-a*int(i/b)):
    ans = int(a*i/b)-a*int(i/b)
print(ans)

Fixed submission:
a, b, n = map(int, input().split())
ans = 0
e = min(n+1,b)
s = max(int(b/a),e-1000)
for i in range(s, e):
  x = (int(a*i/b)-a*int(i/b))
  if ans < x:
    ans = x
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, n = map(int, input().split())
ans = 0
for i in range(int(b/a), n+1):
  if ans < (int(a*i/b)-a*int(i/b)):
    ans = int(a*i/b)-a*int(i/b)
print(ans)

Fixed submission:
a, b, n = map(int, input().split())
ans = 0
e = min(n+1,b)
s = max(int(b/a),e-1000)
for i in range(s, e):
  x = (int(a*i/b)-a*int(i/b))
  if ans < x:
    ans = x
print(ans)

Buggy python submission (verdict: Runtime Error):
a, b, n = map(int, input().split())
ans = 0
for i in range(int(b/a), n+1):
  if ans < int(a*i/b)-a*int(i/b);
    ans = ans, int(a*i/b)-a*int(i/b)
  else:
    break
print(ans)

Fixed submission:
a, b, n = map(int, input().split())
ans = 0
e = min(n+1,b)
s = max(int(b/a),e-1000)
for i in range(s, e):
  x = (int(a*i/b)-a*int(i/b))
  if ans < x:
    ans = x
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, n = map(int, input().split())
ans = 0
for i in range(int(b/a), n+1):
  ans = max(ans, int(a*i/b)-a*int(i/b))
print(ans)

Fixed submission:
a, b, n = map(int, input().split())
ans = 0
e = min(n+1,b)
s = max(int(b/a),e-1000)
for i in range(s, e):
  x = (int(a*i/b)-a*int(i/b))
  if ans < x:
    ans = x
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, n = map(int, input().split())
ans = 0
for i in range(n+1):
  ans = max(ans, int(a*i/b)-a*int(i/b))
print(ans)

Fixed submission:
a, b, n = map(int, input().split())
ans = 0
e = min(n+1,b)
s = max(int(b/a),e-1000)
for i in range(s, e):
  x = (int(a*i/b)-a*int(i/b))
  if ans < x:
    ans = x
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, n = map(int, input().split())
ans = 0
for i in range(n+1):
  ans = max(ans, int((a*i/b) - (a*i/b)%1 -(a*((i/b) - (i/b)%1))))
print(ans)

Fixed submission:
a, b, n = map(int, input().split())
ans = 0
e = min(n+1,b)
s = max(int(b/a),e-1000)
for i in range(s, e):
  x = (int(a*i/b)-a*int(i/b))
  if ans < x:
    ans = x
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
a, b, n = map(int, input().split())
ans = 0
for i in range(n+1):
  ans = max(ans, math.floor(a*i/b)-a*math.floor(i/b))
print(ans)

Fixed submission:
a, b, n = map(int, input().split())
ans = 0
e = min(n+1,b)
s = max(int(b/a),e-1000)
for i in range(s, e):
  x = (int(a*i/b)-a*int(i/b))
  if ans < x:
    ans = x
print(ans)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
if m%2b == 1:
  for i in range(m):
    print(str(i+1) + ' ' + str(2*m-i))
else:
  for i in range(m/2):
    print(str(i+1) + ' ' + str(m-i+1))
  for i in range(m/2):
    print(str(i+m+2) + ' ' + str(2*m-i+1))

Fixed submission:
n, m = map(int, input().split())
if m%2 == 1:
  # for i in range(m):
  #   print(str(i+1) + ' ' + str(2*m-i))
  for i in range(int((m-1)/2)):
    print(str(i+1) + ' ' + str(m-i))
  for i in range(int((m+1)/2)):
    print(str(m+i+1) + ' ' + str(2*m-i+1))
else:
  for i in range(int(m/2)):
    print(str(i+1) + ' ' + str(m-i+1))
  for i in range(int(m/2)):
    print(str(i+m+2) + ' ' + str(2*m-i+1))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ss = []
for i in range(n):
  s = input()
  push = True
  for j in ss:
    if s == j:
      push = False
      break
  if push:
    ss.append(s)
print(len(ss))

Fixed submission:
from collections import Counter
n = int(input())
s = [0] * n
for i in range(n):
  s[i] = input()
c = Counter(s)
print(len(c))