CodeEff/ECCO huggingface dataset:
# Original solution
import math

def main():
    A, B, N = list(map(int, input().split(" ")))
    max_score = -float("inf")
    log = []

    for x in range(1, min(B, N)+1):
        score = math.floor((A*x)/B) - A*math.floor(x/B)
        log.append(score)
        max_score = max(max_score, score)
    print(max_score)

if __name__ == "__main__":
    main()

# Optimized solution
import math

def main():
    A, B, N = list(map(int, input().split(" ")))
    max_score = -float("inf")

    if B <= N:
        x = B-1 
    else:
        x = N
    score = math.floor((A*x)/B) - A*math.floor(x/B)
    print(score)

if __name__ == "__main__":
    main()
# Original solution
a, b, n = list(map(int, input().split()))

cnt = 1
buf = []
buf.append(int(a * n / b) - a * (int(n / b)))
while True:
    x = cnt * b - 1
    if n < x :
        break
    calc = int(a * x / b) - a * (int(x / b))
    if calc > max(buf):
        buf.append(calc)
    cnt += 1
    

ans = max(buf)
print(ans)

# Optimized solution
a, b, n = list(map(int, input().split()))

cnt = 1
buf = []
if n < b:
    buf.append(int(a * n / b) - a * (int(n / b)))
else:
    buf.append(int(a * (b - 1) / b) - a * (int((b - 1) / b)))
    

while True:
    if n / b > 10 ** 6:
        break
    x = cnt * b - 1
    if n < x :
        break
    calc = int(a * x / b) - a * (int(x / b))
    if calc > max(buf):
        buf.append(calc)
    cnt += 1
    
if n / b > 10 ** 6 and n >= b:
    buf.append(int(a * (b - 1) / b) - a * (int((b - 1) / b)))

ans = max(buf)
print(ans)
# Original solution
A, B, N = [int(x) for x in input().split()]
max_val = 0
for x in range(N+1):
  if (A*x)//B -A*(x//B) > max_val:
    max_val = (A*x)//B -A*(x//B)
print(max_val)

# Optimized solution
A, B, N = [int(x) for x in input().split()]
max_val = 0
j = min(B-1,N)
x = (A*j)//B - A*(j//B)
print(x)
# Original solution
import math
A,B,N= list(map(int,input().split()))

if N>=B:
  N=B
  
max=0
for i in reversed(list(range(1, N+1))):
  y=math.floor(A*i/B)-A*math.floor(i/B)
  if max < y :
    max=y
print((int(max)))

# Optimized solution
import math
A,B,N= list(map(int,input().split()))

max=0
if N>B:
  N=B-1
  y=math.floor(A*N/B)-A*math.floor(N/B)
  print((int(y)))
elif N==B:
  N=B-1
  y=math.floor(A*N/B)-A*math.floor(N/B)
  print((int(y)))
else:
	y=math.floor(A*N/B)-A*math.floor(N/B)
	print((int(y)))
# Original solution
import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b,n=list(map(int,input().split()))

cnt=0

for i in range(n+1):
	cnt=max(cnt,(a*i)//b-a*(i//b))

print(cnt)

# Optimized solution
import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b,n=list(map(int,input().split()))
cnt=0

if n//b>0:
	print((a*(b-1)//b-a*((b-1)//b)))
else:
	print((a*(n)//b-a*((n)//b)))
# Original solution
import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b,n=list(map(int,input().split()))
cnt=0

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

# Optimized solution
a,b,n=list(map(int,input().split()))
if n>=b-1:
    print(((a*(b-1))//b-a*((b-1)//b)))
else:
    print(((a*n)//b-a*(n//b)))
# Original solution
import math
def solve():
    a, b, n = list(map(int, input().split()))

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


    return ans


print((solve()))


# Optimized solution
import math
def solve():
    a, b, n = list(map(int, input().split()))

    if n < b:
        return math.floor(a*n/b) - a*math.floor(n/b)
    elif n >= b:
        return math.floor(a*(b-1)/b) - a*math.floor((b-1)/b)



print((solve()))
# Original solution
import math
a,b,n = list(map(int,input().split()))
ans = 0
start =  b // a
count = 0
check = start % b
count = 0
for i in range(start,n+1):
    dum1 = (a * i / b) // 1
    dum2 = a * ((i / b)//1)
    dum3 = dum1 - dum2
    #print(dum1,dum2)
    ans = max(ans,dum3)
    if i % b == check and count != 0:
        break
    count += 1
print((math.ceil(ans)))

# Optimized solution
import math
a,b,n = list(map(int,input().split()))
if b-1 <= n:
    print((math.floor((a*(b-1))/b)-(a*math.floor((b-1)/b))))
else:
    print((math.floor((a * (n)) / b) - (a * math.floor((n) / b))))
# Original solution
A, B, N = list(map(int, input().split()))
maxFloor = 0


def floor(x):
    num = int(x // 1)
    return num


for x in range(N + 1):
    check = floor(A * x / B) - A * floor(x / B)
    maxFloor = max(maxFloor, check)
print(maxFloor)


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

maxFloor = 0


def floor(x):
    num = int(x // 1)
    return num


if B - 1 <= N:
    check = floor(A * (B - 1) / B) - A * floor((B - 1) / B)
    print(check)
else:
    check = floor(A * N / B) - A * floor(N / B)
    print(check)
# Original solution
import math
A,B,N = list(map(int,input().split()))
ans = list()
x = 1
while x <= N:
    ans.append(math.floor(A*x/B)-A*math.floor(x/B))
    if x+1 <= N and ans[x-1] > (math.floor(A*(x+1)/B)-A*math.floor((x+1)/B)):
        break
    else:
      x += 1
print((max(ans)))

# Optimized solution
import math
A,B,N = list(map(int,input().split()))
x = min(B-1,N)
print((math.floor(A*x/B)-A*math.floor(x/B)))
# Original solution
import math
a,b,n = list(map(int,input().split()))
ans = -10000000000 
for i in range(0,n+1):
    kari = math.floor(a*i/b) - a*math.floor(i/b)
    if ans <= kari:
        ans = kari
    else:
        break
print(ans)


# Optimized solution
import math
a,b,n = list(map(int,input().split()))
if b <= n:
    print((math.floor(a*(b-1)/b)-a*math.floor((b-1)/b)))
else:
    print((math.floor(a*n/b)-a*math.floor(n/b)))
# Original solution
from decimal import Decimal
import math
a,b,n = list(map(str,input().split()))

a = Decimal(a)
b = Decimal(b)
n = int(n)
ans = 0
for x in range(1,n+1):
    tmp = math.floor((a*x)/b) - a*math.floor(x/b)
    ans = max(ans,tmp)

print(ans)

# Optimized solution
from decimal import Decimal
import math
a,b,n = list(map(str,input().split()))

a = Decimal(a)
b = Decimal(b)
n = int(n)
ans = 0
kouho = [min(b-1,n)]
for x in kouho:
    tmp = math.floor((a*x)/b) - a*math.floor(x/b)
    ans = max(ans,tmp)
print(ans)
# Original solution
from decimal import Decimal

def main():
    a, b, n = list(map(int, input().split()))
    
    floor_list = []
    
    for i in range(n+1):
        floor_1 = int(Decimal(a*i/b))
        floor_2 = a * int(Decimal(i/b))
        floor_list.append(floor_1 - floor_2)
    
    #print(floor_list)
    #floor_list.sort()
    #print(floor_list[-1])
    print((max(floor_list)))

if __name__ == '__main__':
    main()

# Optimized solution
def main():
    a, b, n = list(map(int, input().split()))
    
    limit = 0
    if n >= b-1:
        limit = b-1
    else:
        limit = n
    
    floor_sub = int(limit * a / b) - int(limit / b) * a
    print(floor_sub)

if __name__ == '__main__':
    main()
# Original solution
import math

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

print((max([math.floor(a*i / b) - a * math.floor(i / b)  for i in range(1, b + 1 if b < n else n + 1)])))

# Optimized solution
import math
 
a, b, n = list(map(int, input().split(" ")))
i = min([b-1 , n])
print(( math.floor(a*i / b) - a * math.floor(i / b) ))
# Original solution
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from operator import mul


sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


a, b, n = LI()
ans = -INF
if b - 1 > n:
    x = n
    ans = max(ans, a * x // b - a * (x // b))
else:
    x = b - 1
    while True:
        ans = max(ans, a * x // b - a * (x // b))
        x += b
        if x > n:
            break

print(ans)


# Optimized solution
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from operator import mul


sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


a, b, n = LI()
if b - 1 <= n:
    x = b - 1
else:
    x = n
print((a * x // b - a * (x // b)))
# Original solution
import math
A,B,N= list(map(int,input().split()))
x=[]
AB=A/B
for i in range(1,N+1):
    x.append(math.floor(AB*i)-A*(i//B))
x.sort()
print((x.pop(N-1)))

# Optimized solution
import math
A,B,N= list(map(int,input().split()))
x=[]
AB=A/B
if B==1:
    print("0")
elif N<B:
    #x.append(math.floor(AB*N-1)-A*(N//B)
    print((math.floor(AB*N)))
else:
    x=[math.floor(AB*N)-A*(N//B)]
    for i in range(N//B):
        x.append(math.floor(AB*((i+1)*B-1))-i)
    print((max(x)))
# Original solution
import math

def readInt():
	return int(eval(input()))
 
def readInts():
	return list(map(int, input().split()))
 
def readChars():
	return input().split()

a,b,n = readInts()
res = -1000

for x in range(min(b,n)+1):
	y = (a*x)//b-a*(x//b)
	#print(y)
	if y>res:
		res = y

print(res)


# Optimized solution
import math

def readInt():
	return int(eval(input()))
 
def readInts():
	return list(map(int, input().split()))
 
def readChars():
	return input().split()

a,b,n = readInts()

x = min(b-1,n)

print((x*a//b))
# Original solution
A, B, N = input().split()
max = 0
for i in range(int(N)+1):
    temp = i/int(B) -int(i/int(B))
    if temp > max:
        max = temp

print((int(max*int(A))))

# Optimized solution
A, B, N = input().split()
f = 0
if int(N) >= int(B):
    f = (int(B) - 1) / int(B)
    f = f - int(f)
else:
    f = int(N) / int(B)
    f = f - int(f)

print((int(f*int(A))))
# Original solution
from math import gcd
a,b,n=list(map(int,input().split()))
t=a*b//gcd(a,b)
if a==1:
    print((0))
    exit()

ans=0
if n%t!=0:
    n%=t

for i in range(1,n+1):
    y=int(a*i/b)-a*int(i/b)
    ans=max(ans,y)


print(ans)


# Optimized solution

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

def f(x):
    return a*x//b-a*(x//b)

print((f(min(n,b-1))))
# Original solution
import math
a, b, n = [int(a) for a in input().split()]

def calc(a, b, x):
    # print(a, b, x, math.floor(a*x/b), math.floor(x/b))
    return math.floor(a*x/b) - a * math.floor(x/b)
    
ans = -1
for x in range(1, n+1):
    r = calc(a, b, x)
    if r > ans:
        ans = r
        # print(x)
print(ans)

# Optimized solution
import math
a, b, n = [int(a) for a in input().split()]

def calc(a, b, x):
    # print(a, b, x, math.floor(a*x/b), math.floor(x/b))
    return math.floor(a*x/b) - a * math.floor(x/b)
    
ans = 0
max_x = b
if b > n:
    max_x = n
for x in range(1, max_x+1)[::-1]:
    r = calc(a, b, x)
    if r > ans:
        ans = r
        break

print(ans)
# Original solution
def main():
    a, b, n = [int(x) for x in input().split()]
    gen = (a * x // b - x // b * a for x in range(min(b, n) + 1))
    return max(gen)


if __name__ == '__main__':
    print((main()))


# Optimized solution
def main():
    a, b, n = [int(x) for x in input().split()]
    # gen = (a * x // b - x // b * a for x in range(min(b, n) + 1))

    if n >= b - 1:
        x = b - 1
    else:
        x = n

    return a * x // b - x // b * a


if __name__ == '__main__':
    print((main()))
# Original solution
A, B, N = list(map(int, input().split()))
def function(a, b, x):
  return (a*x)//b - a*(x//b)
print((max([function(A, B, i) for i in range(max([1, N-N%B-1]), N+1)])))

# Optimized solution
A, B, N = list(map(int, input().split()))
def function(a, b, x):
  return (a*x)//b - a*(x//b)
print((max([function(A, B, N), function(A, B, max([1, N-N%B-1]))])))
# Original solution
#d
A,B,N=list(map(int,input().split()))
b=[]
for i in range(1,(N//B)+1):
    b.append(i*B-1)
b.append(N)
a=0
for x in b:
    p=(A*x)//B-A*(x//B)
    if p>a:
        a=p
print(a)

# Optimized solution
#d
A,B,N=list(map(int,input().split()))
b=[]
if N>=B:
    b.append((N//B)*B-1)
b.append(N)
a=0
for x in b:
    p=(A*x)//B-A*(x//B)
    if p>a:
        a=p
print(a)
# Original solution
import math
a,b,n=list(map(int,input().split()))
l=[]
for i in range(n+1):
    ans= math.floor(a*i/b)-a*(math.floor(i/b))
    l.append(ans)
print((max(l)))

# Optimized solution
a,b,n=list(map(int,input().split()))
s=0
if b<=n:
    x=b-1
    s=(a*x)//b-a*(x//b)
else:
    x=n
    s=(a*x)//b-a*(x//b)
print(s)
# Original solution
import time

def floor(y):
    return int(y)

def main():
    a, b, n = list(map(int, input().split()))
    ans = [floor(a*x/b) - a*floor(x/b) for x in range(1, n+1)]
    print((max(ans)))

if __name__ == "__main__":
    main()

# Optimized solution
import math
a, b, n = list(map(int, input().split()))
x = min(b-1, n)
print((math.floor(a*(x%b)/b)))
# Original solution
a,b,n = list(map(int,input().split()))

ans =0

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

print(ans)

# Optimized solution
a,b,n = list(map(int,input().split()))

ans =0

# for x in range(1,n+1):
x = min(b-1,n)
ans = max( ans , (a * x) // b - a* (x // b))
print(ans)
# Original solution
a,b,n=[int(x) for x in input().split()]

ma=0
for i in range(1,min(b,n)+1):
    ma=max(ma,(i*a)//b-a*(i//b))
print(ma)


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

i=min(b-1,n)
print(((i*a)//b-a*(i//b)))
# Original solution
from math import floor

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

mv = 0
while N > 0:
    mv = max(mv, floor(A*N/B) - A*floor(N/B))
    N -= 1

print(mv)

# Optimized solution
from math import floor

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

if B > N:
    print((floor(A*N/B) - A*floor(N/B)))
else:
    N = B - 1
    print((floor(A*N/B) - A*floor(N/B)))
# Original solution
A,B,N = list(map(int,input().split()))
max_num = 0
num = 0
for i in range(1,N+1):
  if (A*i//B) - A*(i//B) > max_num:
    max_num = (A*i//B) - A*(i//B)
    num = i
    
print(max_num)

# Optimized solution
A,B,N = list(map(int,input().split()))
num = min(B-1,N)

print(((A*num//B)-A*(num//B)))
# Original solution
A, B, N = list(map(int,input().split()))
L = []

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

L.append(floor(N))
for i in range(N):
  while B * (i + 1) - 1 < N:
    L.append(floor(B * (i + 1) - 1))

print((max(L)))

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

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

print((floor(min(B - 1, N))))
# Original solution
# D - Floor Function

from math import floor

A, B, N = list(map(int, input().split()))
mx = -1 * float('inf')
i = 0

for i in range(N + 1):
    result = floor(A * i / B) - A * floor(i / B)
    if mx <= result:
        mx = result

print(mx)


# Optimized solution
# D - Floor Function

from math import floor

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

if B <= N:
    mx = floor(A * (B - 1) / B) - A * floor((B - 1) / B)
else:
    mx = floor(A * N / B) - A * floor(N / B)

# mx = -1 * float('inf')
# i = 0

# for i in range(N + 1):
#     result = floor(A * i / B) - A * floor(i / B)
#     print(i, result)
#     if mx <= result:
#         mx = result

print(mx)
# Original solution
A, B, N = list(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



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

print(max_num)


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


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

print((calc(min(B-1, N))))
# Original solution
a, b, n = list(map(int, input().split()))
m = max(1, n - b)
c = 0
for i in range(n, m, - 1):
    d = (a * i) // b - a * (i // b)
    if d >= c:
        c = d
print(c)

# Optimized solution
a, b, n = list(map(int, input().split()))
if n <= b - 1:
    print(((a * n) // b - a * (n // b)))
else:
    print(((a * (b - 1)) // b - a * ((b - 1) // b)))
# Original solution
A,B,N = list(map(int, input().split()))

if N < B:
  floor = int(A*N/B) - A*int(N/B)
elif N == B:
  floor = int(A*(N-1)/B) - A*int((N-1)/B)
else:
  floor = max([(int(A*(x-1)/B) - A*int((x-1)/B)) for x in range(B,N,B)])
print(floor)

# Optimized solution
A,B,N = list(map(int, input().split()))
if B == 1 or A == 1:
  floor = 0
else:
  if N < B:
    floor = int(A*N/B) - A*int(N/B)
  elif N == B:
    floor = int(A*(N-1)/B) - A*int((N-1)/B)
  else:
    floor = max([(int(A*(x-1)/B) - A*int((x-1)/B)) for x in range(B,N,B)])
    
print(floor)
# Original solution
A, B, N = list(map(int, input().split()))
result = []
cnt = 0

for _ in range(N):
  cnt += 1
  result.append(int(A*cnt/B)-A*int(cnt/B))
  
print((max(result)))

# Optimized solution
A, B, N = list(map(int, input().split()))
cnt = min(B-1, N)
result = int(A*cnt/B)-A*int(cnt/B)
  
print(result)
# Original solution
A, B, N = list(map(int, input().split()))

def floor(t):
  return int(t)

max = 0 
for x in range(N+1):
  y = floor(A*x/B)-A*floor(x/B)
  if y > max:
    max = y
    
print(max)

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

def g(x):
  return int(A*x/B)-A*int(x/B)

print((g(min(B-1, N))))
# Original solution
A,B,N=list(map(int,input().split()))

answer=0

for i in range(1,N+1):
    f=int(A*i/B)-A*int(i/B)
    if f>answer:
        answer=f
    if f<answer:
        break
    #print(f)
print(answer)
        

# Optimized solution
import math
A,B,N=list(map(int,input().split()))

def f(x):
    return int(A*x/B)-A*int(x/B)

print((f(min(N,B-1))))
# Original solution
import math
mf=math.floor
a,b,n=list(map(int,input().split()))
d=0
for i in range(n+1):
    c=mf(a*i/b)-a*mf(i/b)
    d=max(d,c)
print(d)


# Optimized solution
import math
mf=math.floor
a,b,n=list(map(int,input().split()))
d=0
if n<b:
    i=n
elif n>=b:
    i=b-1
c=mf(a*i/b)-a*mf(i/b)
print(c)
# Original solution
import math


def main():
    a,b,n = list(map(int,input().split()))
    m = math.floor(a * 0 /b) - a * math.floor(0/b)
    for i in range(1,min(b-1,n)+1):
        if m < math.floor(a * i / b) - a * math.floor(i/b):

            m = math.floor(a * i / b) - a * math.floor(i/b)
    print(m)
if __name__ == "__main__":
    main()


# Optimized solution
import math


def main():
    a,b,n = list(map(int,input().split()))
    # m = math.floor(a * 0 /b) - a * math.floor(0/b)
    # for i in range(1,min(b-1,n)+1):
    #     if m < math.floor(a * i / b) - a * math.floor(i/b):
    #         m = math.floor(a * i / b) - a * math.floor(i/b)
    i = min(b-1,n)
    m = a*i//b - a*(i//b)
    
    print(m)
if __name__ == "__main__":
    main()
# Original solution
import math
A,B,N = list(map(int, input().split()))
judge = 0
for i in range(N+1):
  if judge < math.floor(A*i/B) - A*math.floor(i/B):
    judge = math.floor(A*i/B) - A*math.floor(i/B)
print(judge)

# Optimized solution
import math
A,B,N = list(map(int, input().split()))
if B > N:
  a = N
else:
  a = B-1
judge = math.floor(A*a/B) - A*math.floor(a/B)
print(judge)
# Original solution
A,B,N = list(map(int, input().split()))

import math

ans=0
if N < B:
  end = N + 1
else:
  end = B

for x in range(1,end):
  tmp=math.floor(A*x/B) - A * math.floor(x/B)
  if tmp > ans:
    ans = tmp

for x in range(B-1,N,B):
  tmp=math.floor(A*x/B) - A * math.floor(x/B)
  if tmp > ans:
    ans = tmp
  
print(tmp)


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

import math

ans=0
if N < B:
  end = N
else:
  end = B -1

x = end
tmp=math.floor(A*x/B) - A * math.floor(x/B)
  
print(tmp)
# Original solution
import math

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

_max = 0
for i in range(n + 1):
    val = math.floor((a * i) / b) - (a * math.floor(i / b))
    if _max > 0 and _max > val: break
    _max = max(_max, val)

print(_max)

# Optimized solution
import math

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

k = min(n, b - 1)
print((math.floor(a * k / b) - a * math.floor(k / b)))
# Original solution
import math
a,b,n=list(map(int,input().split()))

def Ans(x):
    s=math.floor(a*x/b)
    t=a*math.floor(x/b)
    return s-t

ans=0
for i in range(b//a,n+1):
    ans=max(Ans(i),ans)

print((Ans(min(b-1,n))))

# Optimized solution
import math
a,b,n=list(map(int,input().split()))

def Ans(x):
    s=math.floor(a*x/b)
    t=a*math.floor(x/b)
    return s-t

ans=0
print((Ans(min(b-1,n))))
# Original solution
n,m,q=list(map(int,input().split()))
import math
a=[]
for i in range(1,q+1):
    a.append(math.floor(n*i/m)-n*math.floor(i/m))
print((max(a)))

# Optimized solution
A, B, N = list(map(int, input().split()))
from math  import floor

def f(A, B, N):
    return floor(A*N/B)-A*floor(N/B)


print((f(A, B, min(B-1, N))))
# Original solution
import sys
input = sys.stdin.readline


a, b, c= list(map(int, input().split()))
t_7 = 2/7

f_table = [a*t//b for t in range(b)]

if c >= b:
    print((f_table[-1]))

else:
    x = c
    c_amari = c%b
    c_sho = c//b
    ans =f_table[c_amari]
    print(ans)


# Optimized solution
import sys
input = sys.stdin.readline


a, b, c= list(map(int, input().split()))


#f_table = [a*t//b for t in range(b)]

if c >= b:
    print(((a * (b-1)) // b))

else:
    x = c
    c_amari = c%b
    c_sho = c//b
    ans =(a * c_amari) //b
    print(ans)
# Original solution
a, b, n = list(map(int, input().split()))

ans = 0
for x in range(n+1):
    tmp = a*x//b - a*(x//b)
    if tmp > ans:
        ans = tmp

print(ans)


# Optimized solution
a, b, n = list(map(int, input().split()))

x = n
if n >= b-1:
    x = b-1

ans = (a*(x%b))//b
print(ans)
# Original solution
A,B,N=list(map(int,input().split()))
def f(x):
    return ((A*x)//B)-A*(x//B)
if N<=10**6:
    ans=0
    for x in range(1,N+1):
        ans=max(ans,f(x))
    print(ans)
elif B<=10**6:
    ans=0
    for x in range(1,min(B+1,N+1)):
        ans=max(ans,f(x))
    print(ans)
elif B>=A:
    x=0
    ans=0
    y=0
    while(x<=N):
        ans=max(ans,f(x))
        y+=1
        x=-((-B*y)//A)
    print(ans)
else:
    ans=0
    for x in range(1,min(B+1,N+1)):
        ans=max(ans,f(x))
    print(ans)



# Optimized solution
A,B,N=list(map(int,input().split()))
def f(x):
    return ((A*x)//B)-A*(x//B)

print((f(min(B-1,N))))
# Original solution
a,b,n=list(map(int,input().split()))
s=n//b
ans=0
for i in range(0,s+1):
  x=min(b*i+b-1,n)
  ans=max((a*x)//b-a*i,ans)
print(ans)

# Optimized solution
a,b,n=list(map(int,input().split()))
x=min(b-1,n)
print((a*x//b))
# Original solution
def floor(x) :
    return int(x)
    
s = input().split(" ")
a = int(s[0])
b = int(s[1])
n = int(s[2])
M = 0

for i in range(1,n+1) :
    if M<(floor(a*i/b)-a*floor(i/b)) :
        M = (floor(a*i/b)-a*floor(i/b))

print(M)


# Optimized solution
s = input().split()

a = int(s[0])
b = int(s[1])
n = int(s[2])

if b==1 :
    print((0))
else :
    c = min(b-1,n)
    m = (a*c)//b
    print(m)
# Original solution
a, b, n = list(map(int, input().split()))

max = 0

for x in range(n+1):
    y = ((a*x)//b) - (a * (x//b))
    if y > max:
        max = y

print(max)

# Optimized solution
a, b, n = list(map(int, input().split()))

x = min(b-1, n)

print(((a*x)//b))