Buggy python submission (verdict: Time Limit Exceeded):
import math
from math import floor
A,B,N = map(int,input().split())
maxi = 0
Npower = 0
diff = 0
S = N
while S/10 >= 1:
    Npower += 1
    S /=10
if Npower >= 7:
    for i in range(0,10**6+10**5):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
    for i in range(N-3*10**6,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
else:
    for i in range(0,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
print(max(maxi,0))


Fixed submission:
import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))

Buggy python submission (verdict: Time Limit Exceeded):
import math
from math import floor
A,B,N = map(int,input().split())
maxi = 0
Npower = 0
diff = 0
S = N
while S/10 >= 1:
    Npower += 1
    S /=10
if Npower >= 7:
    for i in range(0,10**6+10**5):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
    for i in range(N-5*10**6,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
else:
    for i in range(0,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
print(max(maxi,0))

Fixed submission:
import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))

Buggy python submission (verdict: Time Limit Exceeded):
import math
from math import floor
A,B,N = map(int,input().split())
maxi = 0
Npower = 0
diff = 0
S = N
while S/10 >= 1:
    Npower += 1
    S /=10
if Npower >= 7:
    for i in range(0,10**6+10**5):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
    for i in range(N-9*10**6,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
else:
    for i in range(0,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
print(max(maxi,0))


Fixed submission:
import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))

Buggy python submission (verdict: Time Limit Exceeded):
import math
from math import floor
A,B,N = map(int,input().split())
maxi = 0
Npower = 0
diff = 0
S = N
while S/10 >= 1:
    Npower += 1
    S /=10
if Npower >= 7:
    for i in range(0,10**6+10**5):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
    for i in range(N-10**7,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
else:
    for i in range(0,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
print(max(maxi,0))


Fixed submission:
import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))

Buggy python submission (verdict: Time Limit Exceeded):
import math
from math import floor
A,B,N = map(int,input().split())
maxi = 0
Npower = 0
diff = 0
S = N
while S/10 >= 1:
    Npower += 1
    S /=10
if Npower >= 7 and Npower < 10:
    for i in range(0,10**6+10**5):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
    for i in range(N-10**6-10**5-10**4-10**3-10**2,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
else:
    for i in range(0,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
print(max(maxi,0))

Fixed submission:
import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))

Buggy python submission (verdict: Time Limit Exceeded):
import math
from math import floor
A,B,N = map(int,input().split())
maxi = 0
Npower = 0
diff = 0
S = N
while S/10 >= 1:
    Npower += 1
    S /=10
if Npower >= 7 and Npower < 11:
    print(N-10**6-10**5-10**4-10**3-10**2)
    for i in range(0,10**6+10**5):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
    for i in range(N-10**6-10**5-10**4-10**3-10**2,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
else:
    for i in range(0,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
print(max(maxi,0))

Fixed submission:
import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))

Buggy python submission (verdict: Time Limit Exceeded):
import math
from math import floor
A,B,N = map(int,input().split())
maxi = 0
Npower = 0
diff = 0
S = N
while S/10 >= 1:
    Npower += 1
    S /=10
if Npower >= 8: 
    for i in range(0,10**7):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
    for i in range(N-10**6-10**5-10**4-10**3-10**2,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
else:
    for i in range(0,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi)
print(max(maxi,0))


Fixed submission:
import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))

Buggy python submission (verdict: Time Limit Exceeded):
import math
from math import floor
A,B,N = map(int,input().split())
maxi = 0
Npower = 0
diff = 0
S = N
while S/10 >= 1:
    Npower += 1
    S /=10
if Npower >= 8: 
    for i in range(0,1000000):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi,0)
    for i in range(N-10**7,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi,0)
else:
    for i in range(0,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi,0)
print(maxi)

Fixed submission:
import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))

Buggy python submission (verdict: Time Limit Exceeded):
import math
from math import floor
A,B,N = map(int,input().split())
maxi = 0
Npower = 0
diff = 0
S = N
while S/10 >= 1:
    Npower += 1
    S /=10
if Npower >= 8: 
    diff = N-10**7
    for i in range(0,10000000):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi,0)
    for i in range(diff,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi,0)
else:
    for i in range(0,N+1):
        maxi = max(floor((A*i)/B)-A*floor(i/B),maxi,0)
print(maxi)

Fixed submission:
import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))

Buggy python submission (verdict: Runtime Error):
import math
A,B,N = map(int,input().split())
maxi = -100000
Npower = 0
diff = 0
while N > 1:
    N /=10
    Npower += 1
if Npower >= 6:
  diff = N-1000
for i in range(diff,N+1):
    maxi = max(math.floor(A*i/B)-A*math.floor(i/B),maxi,0)
print(maxi)

Fixed submission:
import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))

Buggy python submission (verdict: Runtime Error):
import math
A,B,N = map(int,input().split())
maxi = -100000
Npower = 0
diff = 0
while N > 1:
    N /=10
    Npower += 1
if Npower >= 6:
  diff = N-1000
for i in range(diff,N+1):
    maxi = max(math.floor(A*i/B)-A*math.floor(i/B),maxi,0)
print(maxi)


Fixed submission:
import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))

Buggy python submission (verdict: Runtime Error):
import math
A,B,N = map(int,input().split())
maxi = -100000
Npower = 0
while N > 1:
    N /=10
    Npower += 1
if Npower >= 6:
  diff = N-1000
else:
  diff = 0
for i in range(diff,N+1):
    maxi = max(math.floor(A*i/B)-A*math.floor(i/B),maxi,0)
print(maxi)

Fixed submission:
import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))

Buggy python submission (verdict: Runtime Error):
import math
A,B,N = mips()
K = N-1
print(max(math.floor(A*N/B)-A*math.floor(N/B),math.floor(A*K/B)-A*math.floor(K/B),0))

Fixed submission:
import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))

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


Fixed submission:
import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))

Buggy python submission (verdict: Runtime Error):
import math
A,B,N = mips()
maxi = -100000
for i in range(0,N+1):
    maxi = max(math.floor(A*i/B)-A*math.floor(i/B),maxi)
print(maxi)

Fixed submission:
import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))