peterverebics/CodeNet_Python_118 huggingface dataset:
#!/usr/bin/env python3
N = list(map(int, input().split()))
ans = []
for i in range(N[2]):
    f_1 = int((N[0]*(i+1))/N[1])
    f_2 = N[0] * (int((i+1)/N[1]))
    ans.append(f_1 + f_2)
ans.sort()
print(ans[-1])
N = [int(e) for e in input().split()]
t = N[2]
ans = (N[0]*N[2])//N[1] - N[0]*(t//N[1])
print(ans)
import math
 
A, B, N = map(int, input().split())
c = 0
for x in range(0, N+1):
    j = (A*x / B)
    k = (x / B)
    if j < 1:
        pass
    else:
        a = math.floor(j) - A * math.floor(k)
        print(x, a)
        if a > c:
            c = a
print(c)
a, b, n = map(int, input().split())
ans = -float('inf')
for i in range(n, n-4, -1):
    f1 = (a*i)//b
    f2 = i//b
    tmp = f1-(a*f2)
    if ans < tmp:
        ans = tmp
print(ans)
import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b,n=map(int,input().split())

cnt=0
if b>10**9:
	for i in range(10000000):
		cnt=max(cnt,(a*(n-i)//b-a*((n-i)//b)))
	print(cnt)

else:
	for i in range(a):
		cnt=max(cnt,(a*(n-i)//b-a*((n-i)//b)))
	print(cnt)
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


def main():
    a, b, n = map(int, input().split())
    l = 0
    r = n
    ans = math.floor(a*n/b) - a*math.floor(n/b)
    while(l+1 < r):
        x = (l+r)//2
        print(x)
        t = math.floor(a*x/b) - a*math.floor(x/b)
        if ans <= t:
            ans = t
            r = x
        else:
            l = x

    print(ans)


main()
def floor(A,B,x):
    return int(A*x/B)-A*int(x/B)

A,B,N =map(int,input().split())

ans =max(floor(A,B,N),floor(A,B,max(0,B*(N//B)-1)))


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

x = min(b, n)
print( int( (a*x / b) ) - ( a * int( x / b ) ) )
import sys
import math
A, B, N = map(int, input().split())

if A == 1 or B == 1:
  print(0)
  sys.exit()
elif A == B:
  print(N)
  sys.exit()  

ra = []
for i in reversed(range(1, N+1)):
  temp = math.floor(A * i / B) - (A * math.floor(i / B))
  if not temp in ra:
    ra.append(temp)
  else:
    if temp > 0:
      break
  
print(max(ra))
a,b,n=map(int,input().split())

nb=n//b

xmax=0
if n<b:
    xmax=a*n//b
else:
    xmax=0
    for xb in range(nb):
        xv=(a*xb*b+a*(b-1))//b-a*xb
        xmax=max(xmax,xv)
    xb=nb
    xv=(a*xb*b+a*n)//b-a*xb
    xmax=max(xmax,xv)

print(xmax)
import math
def f(a,b,x):
	return math.floor((a*x)/b) - a*math.floor(x/b)

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

ans = f(a,b,n)
if (n < b/a):
	ans = f(a,b,0)
print(ans)
A, B, N = map(int, input().split())
ans = 0
if(A>B):
    ans = int(A*N/B)-A*int(N/B)
else:
    ans = int(A*0/B)-A*int(0/B)
print(ans)
A, B, N = map(int,input().split())
score = 0
for i in range(N-1,N):
    x = i+1
    val = int(A*x/B) - A * int(x/B)
    #print( int(A*x/B) , A * int(x/B))
    if(val > score):
        score = val
print(score)
import math
A,B,N=map(int,input().split())
max=0
if N==1 :
  for x in range(1,N+1):
    temp=math.floor(x*(A/B))-A*math.floor(x/B)
    if temp>max:
       max=temp
  print(max)
else:
  for x in range(N-1,N+1):
    temp=math.floor(x*(A/B))-A*math.floor(x/B)
    if temp>max:
      max=temp
  print(max)
import math
A, B, N = list(map(int, input().split()))
ans = 0
if B+1 < N:
    C = B+1
else:
    C = N
for i in range(1, C+1):
    val = math.floor(A*i/B) - A*math.floor(i/B)
    print("i", i, "val", val)
    ans = max(ans, val)

print(ans)
"""
import math

M,N,Q = map(int,input().split())
a = []

for i in range(Q):
    a.append(list(map(int,input().split())))

print(a)
"""

import math

A,B,N = map(int,input().split())
ans = 0

if N>B:
    p = B*(N//B)-1
    q =math.floor(A*p/B)-A*math.floor(p/B)
else:
    q =0

if N%B!=0 and B!=1:
    ans=math.floor(A*N/B)-A*math.floor(N/B)
else:
    ans=math.floor(A*(N-1)/B)-A*math.floor((N-1)/B)

print(max(q,ans))
import math
A, B, N = map(int, input().split())

k =0

for i in range (0, 1000000):
	p = math.floor(A*i/B)-A*math.floor(i/B)
	if p> k:
		k = p

print(k)
import math
 
A, B, N = map(int, input().split())

flag = 1
max = 0
for i in range(N, -1, -1):
    tmp = math.floor(A*i/B) - A*math.floor(i/B)
    if max < tmp:
        max = tmp
    elif max > tmp:
        if flag > 0:
            flag -= 1
        else:
          break
 
print(max)
A, B, N = map(int,input().split())
import math
x1 = N
x2 = min(N,B-1)
def f(x): 
    return math.floor((A*x)/B) - A * math.floor(x/B)
print(max(f(x1),f(x2)))
from math import floor
A, B , N = map(int, input().split())

Answer = floor((A*N)/B) - (A*floor(N/B))

print(Answer)
A, B, N = map(int, input().split())

tmp = 0
a = 0
for i in range(B - 1, N + 1, B):
    if (s := (A * i) // B - A * a) > tmp:
        a += 1
    else:
        break
    
for i in range(N, N - N % B - 1, -1):
    if (s := (A * i) // B - A * (i // B)) > 0:
        tmp = max(s, tmp)
    else:
        break

print(tmp)
def f1(a, b, x):
  return int(a * x / b)
 
def f2(a, b, x):
  return a * f1(1, b, x)
 
a, b, n = map(int, input().split())
result = 0
 
result = f1(a, b, n)-f2(a, b, n)
    
 
print(result)
A, B, N = map(int,input().split())
ans = []

if N >= 100000:
    for i in range(N-300,N+1): 
        k = (A*i)//B - A*(i//B)
        ans.append(k)
        i = i + 1
    
else:
    for i in range(N//2,N+1):
        k = (A*i)//B - A*(i//B)
        ans.append(k)
        i = i + 1
    
print(max(ans))
import math

A, B, N = map(float, input().split())
ans = 0

for i in range(int(A*N/B)+1):
    tmp_ans = math.floor(i) - A*math.floor(i/A)
    if ans < tmp_ans:
        ans = tmp_ans

print(int(tmp_ans))
# abc165_d.py
A, B,N = map(int,input().split())
ans = 0
for i in range(A):
    if N < A:
        break
    t = (A*i) // B - A * (i//B)
#    print(i, t,floor(A*i/B),A*floor(i/B))
    if ans < t :
        ans = t
print(ans)
a, b, n = list(map(int, input().split()))
if b <= n:
    k = n // b
    x = b * k - 1
else:
    x = n

print( a * x // b + a * int(x // b) )
a,b,n = map(int,input().split())
if b%n != 0:
	print((a*n)//b - ((n//b)*a))
elif b == n:
	print(a)
else:
	n -= 1
	print((a*n)//b - ((n//b)*a))
A, B, N = map(int, input().split())

if (N <= B):
    print(((A * (N)) // B) - (A * ((N) // B)))
elif(N > B):
    print(((A * (B - 1)) // B) - (A * ((B - 1) // B)))
import math
a,b,n=map(int,input().split())
ans=0
temp=0
for i in range(b):
    if i*a/b>=1:
        temp=i
        break
if n < b:
    for i in range(n+1):
        ans=max(ans,math.floor(i*a/b))
    print(ans)
else:
    for i in range(0,temp):
        ans=max(ans,math.floor(i*a/b))
    print(ans)
a, b, n = map(int, input().split())
ans = 0
if b > n:
    ans = a*n//b
else:
    for i in range(b, n+1):
        res = a*i//b - a*(i//b)
        if ans < res:
            ans = res
print(ans)
import math
a, b, n = map(int, input().split())
val = (a // b + 1) * b - 1
val_1 = (a // b) * b - 1
max1 = math.floor(a * val / b) - a * math.floor(val / b)
max2 = math.floor(a * val_1 / b) - a * math.floor(val_1 / b)
if val <= n:
    print(max(max1, max2))
elif val_1 > 0 and val_1 <= n:
    print(max2)
else:
    print(math.floor(a * n / b) - a * math.floor(n / b))
import math
A, B, N = map(int, input().split())

Score = list()
i = 1
while True:
  score = math.floor(A*i/B) - A * math.floor(i/B)
  Score.append(score)
  if score < max(Score):
    break
  i += 1
print(max(Score))
A, B, N = map(int, input().split())
x = N
for i in range(N-1,0,-1):
    if int(A*i/B) != int(A*N/B):
        break
    x = i

x2 = 0
for i in range(N):
    if int(i/B) != 0:
        break
    x2 = i

C = int(A*x/B) - A * int(x/B)
D = int(A*x2/B) - A * int(x2/B)

print(max(C,D))
a, b, n = map(int, input().split())
if n < b:
    ans = a*n//b
else:
    ans = a*n//b
    ans = max(ans, n/b)
    ans = max(ans, (a*(b*2-1))//b - a)
    li = [1, (1+(n//b))//2, -(-(1+(n//b))//2)]
    for i in li:
        check = (a*(b*(i+1)-1))//b - a*i
        ans = max(ans, check)
    ans = max(ans, (a*n)//b)-a*(n//b)
print(ans)
a, b, n = map(int, input().split())
ans = int((a * n) / b) - a * int(n / b)
print(max(ans, int(a / b) -  int(n / b)))
a,b,n = map(int, input().split())
ans = 0
if n < 101:
    for x in range(n+1):
        ans = max(int(a*x/b) - (a*int(x/b)),ans)
else:
    m = n - 100
    for x in range(m,n+1):
        ans = max(int(a*x/b) - (a*int(x/b)),ans)
print(ans)
# coding: utf-8
# Your code here!
import math

def has_duplicates(seq):
    return len(seq) != len(set(seq))

A,B,N = map(int, input().split())
List=[]
i=1
while i<=N:
    one=math.floor((A*i)/B)
    two=math.floor(i/B)
    three=A*two
    ans=one-three
    List.append(ans)
    if has_duplicates(List)==True:
        break
    #print(ans)
    i+=1
#print("ans")
print(max(List))
a, b, n = map(int, input().split())

def calc(x):
    return int(a*x/b) - a*int(x/b)

if n <= b:
    print(calc(n))
else:
    print(calc(b-(a/(2*b))))
A,B,N = map(int, input().split())
ans = -1
for t in range(N):
    x = t
    ansX = A*x//B-A*(x//B)
    if ansX > ans:
        ans = ansX
    elif ansX == ans:
        break


print(ans)
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


def main():
    a, b, n = map(int, input().split())
    l = 1
    r = n
    ans = 0
    x = n
    for z in range(1000):
        t = math.floor(a*x/b) - a*math.floor(x/b)
        if ans <= t:
            ans = t
            r = x
        else:
            l = x
        x = (l+r)//2

    print(ans)


main()
from math import floor
a,b,n=map(int,input().split())
max=floor(a*n/b)-a*floor(n/b)
print(max)
from math import floor
a, b, n = map(int, input().split())

ans = -float("inf")
for x in range(n, max(-1, n - 2 * a - 1), -1):
    ans = max(ans, floor(a * x / b) - a * floor(x / b))

for x in range(0, min(n+1,2 * a + 1)):
    ans = max(ans, floor(a * x / b) - a * floor(x / b))

print(max(int(ans), 0))
import math
A, B, N =map(int,input().split())
max_f =0 


N_MAX = 100000000

if N > N_MAX:
    for x in range(N_MAX):       
        f_new = math.floor(A*x/B) - A* math.floor(x/B)

        max_f = max(max_f, f_new)

else:
    for x in range((N%B)+1):

        
        f_new = math.floor(A*x/B) - A* math.floor(x/B)

    
        max_f = max(max_f, f_new)
    
print(max_f)
import math
from collections import deque
a, b, n = map(int, input().split())
d = deque(list(math.floor(a*i/b)- a * math.floor(i/b) for i in range(1, min(n+1, 50000))))
print(max(d))
import math

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

if a == 1 or b == 1:
    print(0)
    exit()
    

l_n = n - 1
r_n = n - (n%b+1)


print(max(math.floor(a*l_n/b)- a*math.floor(l_n/b), math.floor(a*r_n/b)- a*math.floor(r_n/b)))
a,b,n=map(int,input().split())
ans=int((n*a)//b)-(a*int(n//b))
for i in range(n-1,-1,-1):
  tmp=int((i*a)//b)-(a*int(i//b))
  if ans>=tmp:
    break
  else:
    ans=tmp
print(ans)
# abc165_d.py
from math import floor
A, B,N = map(int,input().split())
ans = 0
for i in range(1,A+1):
    t = floor(A*i/B)-A*floor(i/B)
#    print(i, t,floor(A*i/B),A*floor(i/B))
    if ans<t:
        ans = t
print(ans)
a,b,n = map(int,input().split())

from math import floor

def f_ans(X):
  return floor(a*X/b) - a * floor(X/b)

temp = n // b
temp = temp * b
if temp > 0:
  print(f_ans(temp-1))
else:
  print(f_ans(n))

# for i in range(1,n+1):
#   print(str(i) + ':' + str(f_ans(i)))
import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b,n=map(int,input().split())

cnt=0
if b>10**6:
	print(a*n//b-a*n//b)

else:
	for i in range(a):
		cnt=max(cnt,(a*(n-i)//b-a*((n-i)//b)))
		print(cnt)
from math import floor

A, B, N = list(map(int, input().split()))
# print(A, B, N)

x = None
if N < B:
    x = N
else:
    x = B
    max_diff = 0
    for _x in range(B, N + 1):
        diff = (x / B) - floor(x / B)
        if max_diff <= diff:
            max_diff = diff
            x = _x

answer = floor(A * x / B) - A * floor(x / B)

print(answer)
import math
import itertools
a,b,n = map(int,input().split())
pnt = 0
maxi = 0
if n>b:
    x = b-1
else:
    x = n

#for x in range(1,n+1):
pnt = math.floor(a*x/b) - a*math.floor(x/b)
print(pnt)
#    if pnt > maxi:
#        maxi = pnt
#print(maxi)
A, B, N = [int(i) for i in input().split()]
if B == 1:
    max = 0
elif B >= N:
    x = N
    max = ((A * x) // B) - A * (x // B)
else:
    if (B * ((N // B) + 1) - 1) <= N:
        x = B * (N // B + 1) - 1
    else:
        x = B * (N // B) - 1
    max = ((A * x) // B) - A * (x // B)
print(max)
a,b,n = [int(x) for x in input().split()]

ans = 0

for x in range(n+1)[::-1]:
    if ans > ((a*x//b)-(x//b)*a):
        ans = max(ans, (a*x//b)-(x//b)*a)
        break
    else:
        ans = max(ans, (a*x//b)-(x//b)*a)

print(ans)
import sys
from math import sqrt, floor

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)


def I():
    return int(input())


def MI():
    return map(int, input().split())


def main():
    a, b, n = MI()

    if b < n:
        print((a * (b - 1)) // b)
    else:
        print((a * n) // b)


if __name__ == "__main__":
    main()
def cal(A,B,x):
    return int((A*x)/B) - A*int(x/B)

def main():
    A,B,N = map(int,input().split())
    if N <= B-1:
        ans = cal(A,B,N)
    else:
        d = N // B
        ans = cal(A,B,B*d-1)
    print(ans)

if __name__ == "__main__":
    main()
import math

A,B,N = map(int,input().split())
T=[]
for i in range(max(1,N+1-B),N+1):
  t = math.floor(A*i/B)-A*math.floor(i/B)
  T.append(t)
print(max(T))
import math
A, B, N = list(map(int, input().split()))
ans = 0
if B+1 < N:
    C = B+1
else:
    C = N
if B//A == 0:
    D = 1
else:
    D = B//A
for i in range(1, C+1, D):
    val = math.floor(A*i/B) - A*math.floor(i/B)
    #print("i", i, "val", val)
    ans = max(ans, val)

print(ans)
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**6,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)
import math

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

l = [0]

for x in reversed(range(0,n+1)):
    ans = 0
    ans = math.floor(a*x/b) - a * math.floor(x/b)
    l.append(ans)
    if max(l) > ans:
        break
print(l)
print(max(l))
A,B,N=map(int,input().split())
s=list(range(1))
import math
for x in range(N):
  s.append(math.floor((A*x)/B)-A*math.floor(x/B))
print(max(s))
a,b,n=map(int,input().split())
import math
x=b-1
m=[math.floor(a*n/b)]
while x<=n:
    f=math.floor(a*x/b)-a*(math.floor(x/b))
    m.append(f)
    x+=b
print(max(m))
A, B, N = map(int, input().split())

mx = -1
count = 0
for x in reversed(range(1, N+1)):
  temp = ((A*x) // B) - A*(x//B)
  mx = max(mx, temp)
  count +=1
  if count == 3000000:
    break
print(mx)
import math
A,B,N=map(int,input().split())
answer=0
for i in reversed(range(1,N+1)):
    temp=math.floor(A*i/B)-A*math.floor(i/B)
    if answer>temp:
        answer=max(answer,temp)
        break
    else:
        
        answer=max(answer,temp)
    
print(answer)
import math


def main():
    A, B, N = map(int, input().split())
    ans = 0

    for x in range(1, 100):
        temp = math.floor(A*x/B) - A * math.floor(x/B)
        if temp < N:
            ans = temp
        else:
            print(ans)
            break


if __name__ == '__main__':
    main()
temp=list(map(int,input().rstrip().split()))
a=temp[0]
b=temp[1]
n=temp[2]
result=((a*n)//b)-(a*(n//b))
print(result)
A, B, N = map(int, input().split())
Max = 0
 
floor = int(A*N/B) - A*int(N/B)
    
print(floor)
A, B, N = map(int, input().split())
x = N if N%B != 0 else N-1
print(A*x//B-A*(x//B))
import math
A, B, N  = map(int, input().split())

max_v = 0
for x in range(0, min(B+1, N+1), min(B, N)):
    v = math.floor(A*x/B) - A*math.floor(x/B)
    if max_v < v:
        max_v = v
print(max_v)
import math

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

for x in range(int(n), int(n-20), -1):
    n = math.floor(a*x/b) - a * math.floor(x/b)
    if ans <= n:
      ans = n
  
print(ans)
A,B,N = map(int, input().split())
ans = -1
for t in range(N):
    x = N-t
    ansX = A*x//B-A*(x//B)
    if ansX > ans:
        ans = ansX
    elif ansX == ans:
        break

print(ans)
A,B,N = map(int,input().split())

k = (N+1)//B

print(max( A*(B-1)//B , (A*N)//B - A*(N//B)))
A,B,N = map(int,input().split())
x = N
while x>0:
  if x%B != 0:
    print(A*x//B - A*(x//B))
    break
  else:
    x -= 1
a,b,n=map(int,input().split())
print(int(a*(n%b)/b))
A,B,N =map(int,input().split())
ans =int(A/B)-A*int(1/B)
i=2
while True:
    if int((A*i)/B)-A*int(i/B) > ans:
            ans =int(A*i/B)-A*int(i/B)
            i+=1
    else:
        print(i-1)
        break
def readInt():
    return list(map(int,input().split()))
    
a,b,n = readInt()
f_max = 0
# print(a,b,n)
for x in range(n+1):
    f_sum = int(a*x/b) + int(x/b)
    # print(f_sum)
    if f_sum>=f_max:
        f_max = f_sum
print(f_max)
a, b, x = map(int, input().split())

ans = min(a, b) - 1
tmp = 0
for i in range(1, x+1):
    tmp = max(tmp, a*i//b - a*(i//b))
    
    if i == 10**6+1:
        print(ans)
        exit()
    
print(tmp)
a, b, n = map(int, input().split())

import math

cnt = 0
box = [0]
floor = a*n//b - a*(n//b)
box.append(floor)
for x in reversed(range(1, n+1)):
  floor = a*x//b - a*(x//b)
  box.append(floor)
  cnt+=1
  if cnt > 100:
    break
#  print(x, math.floor(a*x/b), a*math.floor(x/b), floor)

box.sort(reverse=True)
print(box[0])
#print(box)
a,b,n = map(int, input().split())
ans = 0
if n < 11:
    for x in range(n+1):
        ans = max(int(a*x/b) - (a*int(x/b)),ans)
else:
    m = n - 10
    for x in range(m,n+1):
        ans = max(int(a*x/b) - (a*int(x/b)),ans)
print(ans)
global A, B
A, B, N = map(int, input().split())

def f(num):
    return(A * num) // B - A * (num // B)

print(min(f(N - N % B - 1), f(N)))
import math

def main():
  a, b, n = map(int,input().split())
  ans = math.floor(a * n / b) - a * math.floor(n / b)
  print(ans)

if __name__ == '__main__':
  main()
A, B, N = [int(x) for x in input().split()]

Q = A // B
R = A % B

if B <= N:
    ans = R - 1 + Q * (B - 1)
else:
    ans = int(A * N / B) - A * int(N / B)

print(ans)
import math

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

m = b/a


if b <= n:
    print(math.floor(a*(b-m/2)/b) - a*math.floor((b-m/2)/b))
else:
    print(math.floor(a*n/b) - a*math.floor(n/b))
import math
A,B,N = [int(x) for x in input().split(' ')]
if N/B >= 1:
  print(int(A-math.floor(-float(A)/float(B))))
else:
  print(int(math.floor(float(N)*float(A)/float(B))))
a,b,n=map(int,input().split())
ans=int((n*a)//b)-(a*int(n//b))
print(ans)
a,b,n = map(int,input().split()) 



ans = (int(a*(b-1)/b) - a * int((b-1)/b))

print(ans)
import math

if __name__ == '__main__':
    a, b, n = map(int, input().split())

    x = n
    res = math.floor((a*x)/b) - a * math.floor(x/b)
    print(res)
import math
a,b,n = map(int, input().split())

number = []
number.append(min(b, n))
current = b*2
while current-1 <= n:
    number.append(current-1)
    current += b

max_v = 0
for x in number:
    v = math.floor(a*x/b) - a * math.floor(x/b)
    max_v = max(v, max_v)

print(max_v)
import math

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


d = math.floor((a*n)/b) - a*math.floor(n/b)
print(d)
A, B, N = map(int,input().split())

L = []

if N <= B:
  r = N/B
  L.append(int(A*r)-A*int(r))
else:
  for i in range(100000):
    r = (N+i+1)/B
    L.append(int(A*r)-A*int(r))

print(max(L))
import math

def floor(A, B, x):
    return math.floor(A * x / B) - A * math.floor(x/B) 

A, B, N = map(int, input().split(' '))

print(max(floor(A,B,N), floor(A,B,B-1)))
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 >= 6:
    diff = N-500000
    for i in range(0,500000):
        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)
A, B, N = map(int, input().split())


def calc(x):
    return (A*x)//B - A*(x//B)

index = 1
prev = -1
max_num = 0
flag = True
if B == 1:
    flag = False
    max_num = 0

if A >= B:
    flag = False
    max_num = calc(N)

while flag and index <= N:
    tmp = calc(index)
    if tmp < prev:
        flag = False
    else:
        prev = tmp
    if max_num < tmp:
        max_num = tmp
    index += 1

print(max_num)
A, B, N = map(int, input().split())
# S = input()
# X1_list = [int(input()) for i in range(N)]
# X2_list = [list(map(int,input().split())) for i in range(N)]

if N < B:
    a = int(A * N / B)
    b = A * int(N / B)
    print(a - b)
    exit(0)

ans = 0
before_ans = 0
for i in range(1, N + 1,A):
    a = int(A * i / B)
    b = A * int(i / B)
    ans = max(ans, a - b)
    if before_ans > a - b:
        break
    if ans == min(A - 1, B - 1):
        break
    before_ans = a - b
print(ans)
a, b, n = map(int, input().split())


def calc(x):
    return int(a * x / b) - a * int(x / b)


if b < n:
    print(calc(b))
else:
    print(calc(n))
import math
s = list(map(int,input().split()))

a = s[0]
b = s[1]
n = s[2]
x = 0
if b-1 <= n:
    x = b-1
    ans = math.floor(a*x/b)-n*math.floor(x/b)
else:
    x = n-1
    ans = math.floor(a*x/b)-n*math.floor(x/b)
print(ans)
A,B,N  = map(int, input().split())
ans = 0

if B >= N:
  ans = (A*(B-1))//B
else:
  ans = (A*(N))//B

print(ans)
a, b, n = map(int, input().split())
max_int = 0
if a != b:
    for i in range(n, n-max(int(b/a), int(a/b), int(a%b), int(b%a))-1, -1):
        tmp = int((a*i)/b) -a * int(i/b)

        #print(i)
        #print(tmp)
        if max_int < tmp:
            max_int = tmp

print(max_int)
import math

#X=int(input())
# a=int(input())
A,B,N=map(int,input().split(" "))
#a=[int(_) for _ in input().split(" ")]

s=N//B

if s==0:
  x=N
else:
  x=s*B-1

#print(x)

#ans = math.floor(A*x/B) - A * math.floor(x/B)
ans = math.floor(x/B*A) - A * math.floor(x/B)
#ans1 = math.floor(A/B*N) - A * math.floor(N/B)

#if ans1 > ans:
#  ans = ans1

#print(a,b)
print(ans)
#D
A,B,N=map(int,input().split())
if N>=B:
    ans=A-int(A/B)
else:
    ans=int(A*N/B)
print(ans)
import math
def main(a,b,n):
    res = 0
    r = n // b
    for i in range(1,min(b,n)+1):
        res = max(res,calc(a,b,i))
    for i in range((r-1)*b, n+1):
        res = max(res, calc(a,b,i))
    return res
    
def calc(a,b,x):
    return (math.floor(a*x/b) - a * math.floor(x/b))

a,b,n = map(int, input().split())
print(main(a,b,n))
li=list(map(int,input().split()))
a=li[0]
b=li[1]
n=li[2]
c=int((a*n)/b)
d=int(n/b)


if c>0:
  e=int(c-a*d)
  print(e)
else:
  pass
import math

def f(a, b, x):
    return math.floor(a*x/b) - 5 * math.floor(x/b)

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

for i in range(b):
    j = b - i
    if j > n:
        pass
    elif f(a, b, j) > max:
        max = f(a, b, j)
        break

print(max)
a, b,n  = map(int, input().split())
from math import floor
if n<b:
    ans =  floor(a*n/b)-a*floor(n/b)

else:
    m = n//b
    m = m*b-1
    ans = floor(a*m/b)-a*floor(m/b)
print(ans)
import math
A, B, N = map(int, input().split())
ans = -1

#for i in range(N%B, N+1):
#    ans = max(ans, (math.floor(A*i/B) - A*math.floor(i/B)))

ans = max(ans, (math.floor(A*N/B) - A*math.floor(N/B)))
print(ans)
A,B,N=map(int,input().split())
max(B-1,N)
a,b,n=map(int,input().split())
d=((a*(n))//b)-(a*((n)//b))
e=((a*(n-1))//b)-(a*((n-1)//b))
f=((a*(n-2))//b)-(a*((n-2)//b))
print(max(d,e,f))
import math

a, b, n = [int(x) for x in input().split()]

m = 0
if (n < b):
    m = math.floor(a * n / b) - a * math.floor(n / b)
else:
    for i in range(min(a, b), n + 1, n // b):
        m = max(m, math.floor(a * i / b) - a * math.floor(i / b))

print(m)
a,b,n=map(int,input().split())
"""
m=-1

for i in range(b+1):
  w=int(a*i/b)-a*int(i/b)
  if m<w or m==-1:
    m=w
print(m)
"""

print(int(a*(b-1))-a*int((b-1)/b))
a,b,n = [int(x) for x in input().split()]
import math,bisect
i = n
x = math.floor(a*i/b)-math.floor(i/b)*a
print(x)