Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
for i1 in range(1000000):
  for i2 in range(1000000):
    for i3 in range(1000000):
      for i4 in range(1000000):
        for i5 in range(1000000):
          for i6 in range(1000000):
            if 100 * i1 + 101 * i2 + 102 * i3 + 103 * i4 + 104 * i5 + 105 * i6 == X:
              print("1")
            else:
              print("0")
  


Fixed submission:
X = int(input())
a = X // 100
r = X % 100
if r <= 5 * a:
  print("1")
else:
  print("0")

Buggy python submission (verdict: Runtime Error):
X = int(input())
for i1 in range(1000000):
  if i1 * 100 <= X:
    for i2 in range(1000000):
      if i1 * 100 + i2 * 101 <= X:
        for i3 in range(1000000):
          if i1 * 100 + i2 * 101 + i3 * 102 <= X:
            for i4 in range(1000000):
              if i1 * 100 + i2 * 101 + i3 * 102 + i4 * 103 <= X:
                for i5 in range(1000000):
                  if i1 * 100 + i2 * 101 + i3 * 102 + i4 * 103 + i5 * 104 <= X
                    for i6 in range(1000000):
                      if 100 * i1 + 101 * i2 + 102 * i3 + 103 * i4 + 104 * i5 + 105 * i6 == X:
                        print("1")
                      else:
                        print("0")
  


Fixed submission:
X = int(input())
a = X // 100
r = X % 100
if r <= 5 * a:
  print("1")
else:
  print("0")

Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
for i1 in range(1000000):
  for i2 in range(1000000):
    for i3 in range(1000000):
      for i4 in range(1000000):
        for i5 in range(1000000):
          for i6 in range(1000000):
            if 100 * i1 + 101 * i2 + 102 * i3 + 103 * i4 + 104 * i5 + 105 * i6 == X:
              print("1")
            else:
              print("0")
  

Fixed submission:
X = int(input())
a = X // 100
r = X % 100
if r <= 5 * a:
  print("1")
else:
  print("0")
Buggy python submission (verdict: Runtime Error):
S = input()
week = ["SUN","MON", "TUE", "WED", "THU", "FRI", "SAT"]
for i in week:
  if week[i] == S:
    print(7 - i)

Fixed submission:
S = input()
week = ["SUN","MON", "TUE", "WED", "THU", "FRI", "SAT"]
for i in range(7):
  if week[i] == S:
    print(7 - i)
Buggy python submission (verdict: Runtime Error):
r = input()
print (3 * r ** 2)

Fixed submission:
r = int(input())
print (3 * r ** 2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())
K = int(input())
for i in S:
  if s[i - 1] != s[k]:
    s[i - i] = "*"
print(S)

Fixed submission:
N = int(input())
S = list(input())
K = int(input())
for i in range(N):
  if S[i] != S[K - 1]:
    print('*', end = '')
  else:
    print(S[i], end ='')
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
a = 0
b = S.count('.')
num = min(N - y, y)
for i in range(N):
  x = S[i] =='#'
  a += x
  b -= 1-x
  num = num(num, a+b)
print(num)


Fixed submission:
N = int(input())
S = input()
a = 0
b = S.count('.')
num = min(N - b, b)
for i in range(N):
  x = S[i] =='#'
  a += x
  b -= 1-x
  num = min(num, a+b)
print(num)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())
num = 0
for i in range(N):
  if S[i] == '#' and S[i + 1] ==".":
    num++
print(num)
    

Fixed submission:
N = int(input())
S = input()
a = 0
b = S.count('.')
num = min(N - b, b)
for i in range(N):
  x = S[i] =='#'
  a += x
  b -= 1-x
  num = min(num, a+b)
print(num)
Buggy python submission (verdict: Runtime Error):
N = int(input())
print(N.count("2"))

Fixed submission:
N = input()
print(N.count("2"))

Buggy python submission (verdict: Runtime Error):
N = intput()
sum = 0
for i in range(0, len(N)):
  if N[i] == 2:
    sum += 1
print(sum)

Fixed submission:
N = input()
print(N.count("2"))
Buggy python submission (verdict: Runtime Error):
S = input()
buffer = 0
if len(S) != 2:
  buffer = S[0]
  S[0] = S[2]
  S[2] = buffer
print(S)
  

Fixed submission:
S = input()
if len(S) == 2:
  print(S)
else:
  for i in range(len(S)):
    print(S[len(S) - i - 1],end = "")
Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())
if a + b = 15:
  print("+")
elif a * b = 15:
  print("*")
else:
  print("x")

Fixed submission:
a, b = map(int,input().split())
if a + b == 15:
  print("+")
elif a * b == 15:
  print("*")
else:
  print("x")
Buggy python submission (verdict: Runtime Error):
S = list(print(""))
w = int(input())
for i in range(len(S)):
  if (i + 1) % w == 1:
    print(S[i]),

Fixed submission:
S = input()
w = int(input())
for i in range(len(S)):
  if w != 1 and (i + 1) % w == 1 :
    print(S[i], end = "")
  elif w == 1:
    print(S[i], end = "")
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int,input().split())
ans = 0
for i in range(len(N)):
  i = str(i)
  count = 0
  for j in i:
    count += int(j)
  if A <= count and B >= count:
    ans += int(i)
print(ans)

Fixed submission:
N, A, B = map(int,input().split())
ans = 0
for i in range(N + 1):
  i = str(i)
  count = 0
  for j in i:
    count += int(j)
  if A <= count and B >= count:
    ans += int(i)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
m = int(input())
print((n - 1) * (m - 1))

Fixed submission:
n, m = list(map(int,input().split(" ")))
print((n - 1) * (m - 1))
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
min = min{a + b, b + c, c + a}
print(min)

Fixed submission:
a, b, c = map(int, input().split())
min = min(a + b, b + c, c + a)
print(min)
Buggy python submission (verdict: Runtime Error):
S = input()
for i in range(1, len(S)):
  s = S[:-i]
  l = len(s) / 2
  if s[:l] == s[l:]:
    print(len(s))


Fixed submission:
import sys
S = input()

for i in range(1, len(S)):
  s = S[:-i]
  l = len(s) // 2
  if s[:l] == s[l:]:
    print(len(s))
    sys.exit()

Buggy python submission (verdict: Runtime Error):
s = input()
for i in range(int(len(s) + 1) / 2):
  if s[i] != s[int(len(s) + 1) / 2]:
    del[len(s) - 1]
print(len(s) + 1)

Fixed submission:
import sys
S = input()

for i in range(1, len(S)):
  s = S[:-i]
  l = len(s) // 2
  if s[:l] == s[l:]:
    print(len(s))
    sys.exit()
Buggy python submission (verdict: Runtime Error):
x, y = map(int,input().split())
S1 = [1, 3, 5, 7, 8, 10, 12]
S2 = [4, 6, 9, 11]
for i in range(len(S1)):
  for j in range(len(S1)):
    if (S1[i] == x and s1[j] == y) or (S2[i] == x adn S2[j] == y):
      print("Yes")
    else:
      print("No")

Fixed submission:
x, y = map(int,input().split())
S1 = [1, 3, 5, 7, 8, 10, 12]
S2 = [4, 6, 9, 11]
ans = False
for i in range(len(S1)):
  for j in range(len(S1)):
    if S1[i] == x and S1[j] == y:
      ans = True
for i in range(len(S2)):
  for j in range(len(S2)):
    if S2[i] == x and S2[j] == y:
      ans = True
if ans:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
A, op, B = input().split()
if op == '-':
  print(int(A) - int(B))
else:
  print(int(A) + (B))

Fixed submission:
A, op, B = input().split()
if op == '-':
  print(int(A) - int(B))
else:
  print(int(A) + int(B))

Buggy python submission (verdict: Runtime Error):
A, op, B = input().split()
if op = '-':
  print(A - B)
else:
  print(A + B)

Fixed submission:
A, op, B = input().split()
if op == '-':
  print(int(A) - int(B))
else:
  print(int(A) + int(B))

Buggy python submission (verdict: Runtime Error):
A, op, B = list(map(int,input().split()))
if op = '+':
  print(A + B)
else:
  print(A - B)

Fixed submission:
A, op, B = input().split()
if op == '-':
  print(int(A) - int(B))
else:
  print(int(A) + int(B))
Buggy python submission (verdict: Runtime Error):
import itertools

N = int(input())
A = list(int(x) for x in input().split())

mod = 10**9+7
ans = 0
summ = 0

for i in range(N):
    summ += A[i]
    summ %= mod

for i in range(N):
    summ -= A[i]
    if summ < 0:
        sum += mod
    ans += A[i] * summ
    ans %= mod

print(ans)


Fixed submission:
import itertools

N = int(input())
A = list(int(x) for x in input().split())

mod = 10**9+7

sum_ = 0
ans = 0

for i in range(N):
    ans += sum_ * A[i]
    ans %= mod
    sum_ += A[i]
    sum_ %= mod

print(ans)

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

N = int(input())
A = list(int(x) for x in input().split())

mod = 10**9+7
ans = 0
summ = 0

for i in range(N):
    summ += A[i]
    summ %= mod

for i in range(N):
    summ -= A[i]
    if summ < 0:
        sum += mod
    ans += A[i] * summ
    ans %= mod

print(ans)


Fixed submission:
import itertools

N = int(input())
A = list(int(x) for x in input().split())

mod = 10**9+7

sum_ = 0
ans = 0

for i in range(N):
    ans += sum_ * A[i]
    ans %= mod
    sum_ += A[i]
    sum_ %= mod

print(ans)

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

N = int(input())
A = list(int(x) for x in input().split())

mod = 10**9+7
ans = 0
summ = 0

for i in range(N):
    summ += A[i]
    summ %= mod

for i in range(N):
    summ -= A[i]
    print(summ)
    if summ < 0:
        sum += mod
    ans += A[i] * summ
    print(ans)
    ans %= mod
    print(ans)
print(ans)


Fixed submission:
import itertools

N = int(input())
A = list(int(x) for x in input().split())

mod = 10**9+7

sum_ = 0
ans = 0

for i in range(N):
    ans += sum_ * A[i]
    ans %= mod
    sum_ += A[i]
    sum_ %= mod

print(ans)
Buggy python submission (verdict: Runtime Error):
r = int(inputs())

print(r*r)

Fixed submission:
r = int(input())
     
print(r*r)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import setrecursionlimit
from collections import Counter
setrecursionlimit(1000000)
def l_in(type_): return list(map(type_, input().split()))
def i_in(): return int(input())
def m_in(type_): return map(type_, input().split())
def r_in(n, type_): return [type_(input()) for _ in range(n)]

def find_components(n, connectors):
    nodes = [i for i in range(n)]
    for a, b in connectors:
        for e in range(n):
            if nodes[e] == nodes[a-1]: nodes[e] = nodes[b-1]
    return len(Counter(nodes))

n, m = m_in(int)
ab = [list(m_in(int)) for _ in range(m)]

ans = find_components(n, ab) - 1

print(ans)


Fixed submission:
from sys import setrecursionlimit
from collections import Counter
import networkx as nx
setrecursionlimit(1000000)
def l_in(type_): return list(map(type_, input().split()))
def i_in(): return int(input())
def m_in(type_): return map(type_, input().split())
def r_in(n, type_): return [type_(input()) for _ in range(n)]

def find_components(n, connectors):
    g = nx.Graph()
    for i in range(n): g.add_node(i+1)
    g.add_edges_from(connectors)
    return len(list(nx.connected_components(g)))


n, m = m_in(int)
ab = [list(m_in(int)) for _ in range(m)]

ans = find_components(n, ab) - 1

print(ans)

Buggy python submission (verdict: Runtime Error):
from sys import setrecursionlimit
setrecursionlimit(1000000)
def l_in(type_): return list(map(type_, input().split()))
def i_in(): return int(input())
def m_in(type_): return map(type_, input().split())
def r_in(n, type_): return [type_(input()) for _ in range(n)]

n, m = m_in(int)
ab = [list(m_in(int)) for _ in range(m)]

nodes = [i for i in range(n)]
for a, b in ab:
    nodes.pop(b-1)

ans = len(nodes)-1

print(ans)


Fixed submission:
from sys import setrecursionlimit
from collections import Counter
import networkx as nx
setrecursionlimit(1000000)
def l_in(type_): return list(map(type_, input().split()))
def i_in(): return int(input())
def m_in(type_): return map(type_, input().split())
def r_in(n, type_): return [type_(input()) for _ in range(n)]

def find_components(n, connectors):
    g = nx.Graph()
    for i in range(n): g.add_node(i+1)
    g.add_edges_from(connectors)
    return len(list(nx.connected_components(g)))


n, m = m_in(int)
ab = [list(m_in(int)) for _ in range(m)]

ans = find_components(n, ab) - 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from math import factorial
n = int(input())
ans = 0

for c in range(1, n):
    x = n - c
    for b in range(1, x+1): ans += int(x % b == 0)

print(int(ans))


Fixed submission:
n = int(input())
ans = 0

for a in range(1, n):
    ans += (n-1)//a

print(int(ans))
Buggy python submission (verdict: Runtime Error):
def l_in(type_): return list(map(type_, input().split()))
def i_in(): return int(input())
def m_in(type_): return map(type_, input().split())
def r_in(n, type_): return [type_(input()) for _ in range(n)]
ans = None

d, t, s = m_in()
ans = 'Yes' if d <= t*s else 'No'

print(ans)


Fixed submission:
def l_in(type_): return list(map(type_, input().split()))
def i_in(): return int(input())
def m_in(type_): return map(type_, input().split())
def r_in(n, type_): return [type_(input()) for _ in range(n)]
ans = None

d, t, s = m_in(int)
ans = 'Yes' if d <= t*s else 'No'

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def l_in(type_): return list(map(type_, input().split()))
def i_in(): return int(input())
def m_in(type_): return map(type_, input().split())
def r_in(n, type_): return [type_(input()) for _ in range(n)]
ans = 0
const = 1000000007

n = i_in()
a = l_in(int)
hn = n/2
ts = sum(a)

for i in range(n):
    s = sum(a[i+1:]) if i > hn else ts - sum(a[:i+1])
    ans += s * a[i]

print(ans%const)


Fixed submission:
def l_in(type_): return list(map(type_, input().split()))
def i_in(): return int(input())
def m_in(type_): return map(type_, input().split())
def r_in(n, type_): return [type_(input()) for _ in range(n)]
const = 1000000007
ans = 0

n = i_in()
a = l_in(int)

ins = 0
for i in range(1, n):
    ins += a[i-1]
    ans += ins * a[i]

print(ans%const)

Buggy python submission (verdict: Time Limit Exceeded):
def l_in(type_): return list(map(type_, input().split()))
def i_in(): return int(input())
def m_in(type_): return map(type_, input().split())
def r_in(n, type_): return [type_(input()) for _ in range(n)]
ans = 0
const = 1000000007

n = i_in()
a = l_in(int)

for i in range(n):
    ans += sum(a[i+1:])*a[i]

ans %= const
print(ans)


Fixed submission:
def l_in(type_): return list(map(type_, input().split()))
def i_in(): return int(input())
def m_in(type_): return map(type_, input().split())
def r_in(n, type_): return [type_(input()) for _ in range(n)]
const = 1000000007
ans = 0

n = i_in()
a = l_in(int)

ins = 0
for i in range(1, n):
    ins += a[i-1]
    ans += ins * a[i]

print(ans%const)

Buggy python submission (verdict: Time Limit Exceeded):
def l_in(type_): return list(map(type_, input().split()))
def i_in(): return int(input())
def m_in(type_): return map(type_, input().split())
def r_in(n, type_): return [type_(input()) for _ in range(n)]
ans = 0
const = 1000000007

n = i_in()
a = l_in(int)

for i in range(n):
    ans += sum(a[i+1:])*a[i]

ans %= const
print(ans)


Fixed submission:
def l_in(type_): return list(map(type_, input().split()))
def i_in(): return int(input())
def m_in(type_): return map(type_, input().split())
def r_in(n, type_): return [type_(input()) for _ in range(n)]
const = 1000000007
ans = 0

n = i_in()
a = l_in(int)

ins = 0
for i in range(1, n):
    ins += a[i-1]
    ans += ins * a[i]

print(ans%const)

Buggy python submission (verdict: Time Limit Exceeded):
def l_in(type_): return list(map(type_, input().split()))
def i_in(): return int(input())
def m_in(type_): return map(type_, input().split())
def r_in(n, type_): return [type_(input()) for _ in range(n)]
ans = 0
const = 1000000007

n = i_in()
a = l_in(int)

for i in range(n):
    for j in range(n - i-1):
        ans += a[i]*a[i+j+1]

ans %= const
print(ans)


Fixed submission:
def l_in(type_): return list(map(type_, input().split()))
def i_in(): return int(input())
def m_in(type_): return map(type_, input().split())
def r_in(n, type_): return [type_(input()) for _ in range(n)]
const = 1000000007
ans = 0

n = i_in()
a = l_in(int)

ins = 0
for i in range(1, n):
    ins += a[i-1]
    ans += ins * a[i]

print(ans%const)
Buggy python submission (verdict: Runtime Error):
from sys import exit
n = int(input())
a = list(map(int, input().split()))
if n==1: print(0); exit()
al = [0 for _ in range(n)]
for index in range(n-1):
	person = a[index]
	person_behind = a[index+1]
	if person_behind < person:
		k = person - person_behind
		a[index+1] += k
		al[person_behind] = k
print(sum(al))

Fixed submission:
from sys import exit
n = int(input())
a = list(map(int, input().split()))
if n==1: print(0); exit()
al = [0 for _ in range(n)]
for index in range(n-1):
	person = a[index]
	person_behind = a[index+1]
	if person_behind < person:
		k = person - person_behind
		a[index+1] += k
		al[index+1] = k
print(sum(al))

Buggy python submission (verdict: Runtime Error):
from sys import exit
n = int(input())
if n==1: print(0); exit()
a = list(map(int, input().split()))
al = [0 for _ in range(n)]
for index in range(n-1):
	person = a[index]
	person_behind = a[index+1]
	if person_behind < person:
		k = person - person_behind
		a[index+1] += k
		al[person_behind] = k
print(sum(al))

Fixed submission:
from sys import exit
n = int(input())
a = list(map(int, input().split()))
if n==1: print(0); exit()
al = [0 for _ in range(n)]
for index in range(n-1):
	person = a[index]
	person_behind = a[index+1]
	if person_behind < person:
		k = person - person_behind
		a[index+1] += k
		al[index+1] = k
print(sum(al))
Buggy python submission (verdict: Runtime Error):
A = int(input())
print(a + a**2 + a ** 3)

Fixed submission:
a = int(input())
print(a + a**2 + a ** 3)
Buggy python submission (verdict: Runtime Error):
x, n = map(int, input().split())
p = list(map(int, input().split()))
i, ans = 0, 0
for i in range(max(p)+2):
    if x+i not in p:
        if x-i not in p:
            ans=x-i
            break
        ans=x+i
        break
    if x-i not in p:
        ans=x-i
        break
print(ans)

Fixed submission:
x, n = map(int, input().split())
p = list(map(int, input().split()))
i, ans = 0, 0
a = 1
while a:
    if x not in p: print(x); break
    for i in range(max(p)+2):
        if x+i not in p:
            if x-i not in p:
                ans=x-i
                break
            ans=x+i
            break
        if x-i not in p:
            ans=x-i
            break
    print(ans)
    a = 0
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = 1
for i in range(n):
    ans = ans * a[i]

if ans > 1000000000000000000:
    print(-1)
else:
    print(ans)

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

fflag = False
for i in range(n):
    if a[i] == 0:
        fflag = True
        break

ans = 1
flag = True
for i in range(n):
    if fflag == True:
        ans = 0
        break
    ans = ans * a[i]
    if ans == 0:
        break
    if ans > 1000000000000000000:
        print(-1)
        flag = False
        break

if flag == True:
    print(ans)
Buggy python submission (verdict: Runtime Error):
s =input()
t =input()

S = len(s)
T = len(t)
cnt=0
max=0

for i in range(T):
    for j in range(S-T):
        if s[i+j] == t[j]:
            cnt += 1
    else:
        if max<cnt:
            max=cnt
            cnt=0

print(T-max)


Fixed submission:
s =input()
t =input()

S = len(s)
T = len(t)

cnt=0
max=0

for i in range(S-T+1):
    for j in range(T):
        if s[i+j] == t[j]:
            cnt += 1
    else:
        if max<cnt:
            max=cnt
            cnt=0
        else:
            cnt=0

print(T-max)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
mod=10**9+7
a=list(map(int,input().split()))


total=0

for i in range(n-1):
    total+=a[i]%mod * (sum(a[i+1:]))%mod
    total%=mod

print(total)


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

A=sum(a)%mod
total=0

for i in range(n-1):
    A-=a[i]
    total+=A*a[i]
    total%=mod

print(total)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
mod=10**9+7
a=list(map(int,input().split()))


total=0

for i in range(n-1):
    total+=a[i]%mod * (sum(a[i+1:]))%mod
    total%=mod

print(total)


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

A=sum(a)%mod
total=0

for i in range(n-1):
    A-=a[i]
    total+=A*a[i]
    total%=mod

print(total)
Buggy python submission (verdict: Runtime Error):
n=int(input())
ans=''
while n>=26:
    s=n%26
    n=n//26
    ans+=(chr(s+96))
ans+=(chr(n+96))
print(ans)

Fixed submission:
a=input()
   
if str.isupper(a):
    print("A")
else:
    print("a")

Buggy python submission (verdict: Runtime Error):
n=int(input())
A=list()
ans=''
while n>=26:
    s=n%26
    n=n//26
    ans+=(chr(s+96))
ans+=(chr(n+96))
print(ans)

Fixed submission:
a=input()
   
if str.isupper(a):
    print("A")
else:
    print("a")

Buggy python submission (verdict: Runtime Error):
while True:
   D=input()
   
   if str.isupper(D):
       print("A")
   else:
        print("a")

Fixed submission:
a=input()
   
if str.isupper(a):
    print("A")
else:
    print("a")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
D=int(1)

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

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
D=int(1)
ans=int(0)
A.sort()
if A[0]==0:
    ans==0
else:
    A.sort(reverse=True)
    for i in range(N):
        D*=A[i]
        if  D>10**18:
            ans=-1
            break

        else:
            ans=D
        

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

print(max)

Fixed submission:
# a,b,n=map(int,input().split())
# max=0
# for i in range(1,n+1):
#     if a%b*i%b<i%b:
#         ans=a*i//b -a*(i//b)
#         if max<ans:
#             max=ans

# print(max)

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

if b>n:
    x=n
    ans=(a*x)//b -a*(x//b)

else:
    x=b-1
    ans=(a*x)//b -a*(x//b)

print(ans)

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

print(max)

Fixed submission:
# a,b,n=map(int,input().split())
# max=0
# for i in range(1,n+1):
#     if a%b*i%b<i%b:
#         ans=a*i//b -a*(i//b)
#         if max<ans:
#             max=ans

# print(max)

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

if b>n:
    x=n
    ans=(a*x)//b -a*(x//b)

else:
    x=b-1
    ans=(a*x)//b -a*(x//b)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
li=[]
cnt=0
for i in range(n):
    s=input()
    if s not in li:
        li.append(s)
        cnt+=1
print(cnt)

Fixed submission:
n=int(input())
li=[]
cnt=0
for i in range(n):
    li.append(input())

li.sort()
last=li[0]

for i in range(1,n):
    if last==li[i]:
        li[i]=0
    
    else:
        last=li[i]

print(n-li.count(0))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
# li=[0]*n
a.sort()
cnt=0

for i in range(n):
    print(a.count(i+1))


Fixed submission:


n=int(input())
a=list(map(int,input().split()))
li=[0]*n

for i in range(n-1):
    t=a[i]
    li[t-1]+=1

for i in range(n):
    print(li[i])