CodeEff/ECCO huggingface dataset:
# Original solution
import math
a, b, n = list(map(int, input().split()))

num = 0
max_num = 0

for i in range(1, n+1):
    num = math.floor(a*i/b) - a * math.floor(i / b)
    max_num = max(max_num, num)
print(max_num)

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

if b > n:
    ans = math.floor(a*n/b) - a*math.floor(n/b)
else:
    num = b - 1
    ans = math.floor(a*num/b) - a*math.floor(num/b)
print(ans)
# Original solution
a, b, n = list(map(int, input().split()))
ans = 0
for i in range(1, min(n, b)+1):
    ans = max(ans, int(a*i/b)-a*int(i/b))
print(ans)

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

ma = 0

if(n < b):
    s = a * n / b
    t = n / b
    ss = s // 1
    tt = (t // 1) * a
    ma = ss - tt
else:
    for i in range(b-1,n+1,b):
        s = a * i / b
        t = i / b
        ss = s // 1
        tt = (t // 1) * a
        if(ma < ss - tt):
            ma = ss - tt

print((str(int(ma))))

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

def ma(k):
    s = a * k / b
    t = k / b
    ss = s // 1
    tt = (t // 1) * a
    return ss - tt

if(n < b):
    print((str(int(ma(n)))))
else:
    print((str(int(ma(b-1)))))
# Original solution
#!/usr/bin/env python3

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

for x in range(1, N+1):
    num = (A*x)//B - A*(x//B)
    ans = max(ans, num)
print(ans)

# Optimized solution
#!/usr/bin/env python3

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

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

m=-1
x=0

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

  if m<c or m==-1:
    m=c
    x=i

print(m)

# Optimized solution
a,b,n=list(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)
"""
if b<=n:
  print((int(a*(b-1)/b)-a*int((b-1)/b)))
else:
  print((int(a*n/b)-a*int(n/b)))
# Original solution
A, B ,N = list(map(int,input().split()))
if B-1 <= N:
    print((A*(B-1)//B))
else:
    ans = 0
    for x in range(1,N+1):
        ans_candidate = (A*x)//B- A*(x//B)
        if ans < ans_candidate:
            ans = ans_candidate
    print(ans)


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

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

print(ans)

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

x = min(n, b - 1)

print((int(a * x / b) - a * int(x / b)))
# Original solution
# floor(Ax/B) - A floor(x/B) の最大値Mを求める
# xはN以下の非負整数
# floor(Ax / B) = M + A floor(x / B)
# x / B = k + r
# Ax / B = Ak + Ar

# floor(Ak + Ar) = M + A floor(k + r)
# Ak + floor(Ar) = M + Ak + A floor(r)
# floor(Ar) = M

# r = x / B - k
# M = floor(A * (x / B - k))
#   = floor(A * x /B) - Ak
#   = floor(A/B * x) - Ak
#   = floor(A/B * x) - A * (x // B) 

# A B N
# 5 7 4

# M = floor(5/7 * x) - 5 * (x // 7)


# A B N 
# 11 10 9
# M = floor(11 / 10 * x) - 11 * (x // 10)

import math

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

def resolve_v1(A, B, N):
    maxM = 0
    for x in range(N+1): # O(N)
        M = calcM(A, B, x)
        maxM = max(maxM, M)

    return maxM

def resolve_v2(A, B, N):
    # x == kB - 1
    maxM = calcM(A, B, N)

    for x in [x for x in range(N+1) if (x + 1) % B == 0]: # O(N/B)
        maxM = max(maxM, calcM(A, B, x))
    return maxM


def resolve_v3(A, B, N):
    maxM = calcM(A, B, N)

    k, r = divmod(N, B)
    if k and B * k -1 <= N:
        # k * B - 1で調査
        maxM = max(maxM, calcM(A, B, k * B - 1))
    # if r == 0:
    #     maxM = max(maxM, calcM(A, B, N - 1))

    maxM = calcM(A, B, min(N, B - 1))


    return maxM

if __name__ == '__main__':
    A, B, N = list(map(int, input().split()))
    M = resolve_v3(A, B, N)
    print(M)




# Optimized solution
# floor(Ax/B) - A floor(x/B) の最大値Mを求める
# xはN以下の非負整数
# floor(Ax / B) = M + A floor(x / B)
# x / B = k + r
# Ax / B = Ak + Ar

# floor(Ak + Ar) = M + A floor(k + r)
# Ak + floor(Ar) = M + Ak + A floor(r)
# floor(Ar) = M

# r = x / B - k
# M = floor(A * (x / B - k))
#   = floor(A * x /B) - Ak
#   = floor(A/B * x) - Ak
#   = floor(A/B * x) - A * (x // B) 

# A B N
# 5 7 4

# M = floor(5/7 * x) - 5 * (x // 7)


# A B N 
# 11 10 9
# M = floor(11 / 10 * x) - 11 * (x // 10)

import math

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

def resolve_v1(A, B, N):
    maxM = 0
    for x in range(N+1): # O(N)
        M = calcM(A, B, x)
        maxM = max(maxM, M)

    return maxM

def resolve_v2(A, B, N):
    # x == kB - 1
    maxM = calcM(A, B, N)

    for x in [x for x in range(N+1) if (x + 1) % B == 0]: # O(N/B)
        maxM = max(maxM, calcM(A, B, x))
    return maxM


def resolve_v3(A, B, N):
    maxM = calcM(A, B, N)

    k, r = divmod(N, B)
    if k and B * k -1 <= N:
        # k * B - 1で調査
        maxM = max(maxM, calcM(A, B, B - 1))
    # if r == 0:
    #     maxM = max(maxM, calcM(A, B, N - 1))

    maxM = calcM(A, B, min(N, B - 1))


    return maxM

if __name__ == '__main__':
    A, B, N = list(map(int, input().split()))
    M = resolve_v3(A, B, N)
    print(M)
# Original solution
from collections import deque

def main():
    A,B,N=list(map(int,input().split()))
    d=deque()
    
    x=0
    while(x<=N):
        #tmp=((A*x)//B)-A*(x//B)
        if (A*x<B):
            tmp1=0
        if (x<B):
            tmp2=0
        tmp1=((A*x)//B)
        tmp2=A*(x//B)
        tmp=tmp1-tmp2
        
        if x>=1:
            if d[-1]>tmp:
                break
        
        d.append(tmp)
        x+=1
        
    print((d[-1]))
    exit()
    
if __name__=="__main__":
    main()


# Optimized solution
from math import floor

def main():
    A,B,N=list(map(int,input().split()))
    
    ans1=min(N,B-1)
    ans2=floor(A*ans1/B)-A*floor(ans1/B)
    print(ans2)
    
if __name__=="__main__":
    main()
# Original solution
A, B, N = list(map(int, input().split()))

if N < B:
    print(((A*N)//B))
    exit()

qa, ra = divmod(A, B)
ans = 0
rx = 0

for x in range(N+1):
    rx = max(rx, x%B)
    if rx == B-1:
        break

print((qa*rx + (ra*rx)//B))


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

if N < B:
    print(((A*N)//B))
else:
    qa, ra = divmod(A, B)
    rx = B-1
    print((qa*rx + (ra*rx)//B))
# Original solution
import math
A,B,N = list(map(int,input().split()))
ans = 0
for i in range(1,N+1):
  score = 0
  score = math.floor(A*i/B) -A* math.floor(i/B)
  ans = max(ans,score)
print(ans)

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

# Optimized solution
a, b, n = list(map(int, input().split()))
x = min(b-1, n)
print((a*x//b - a*(x//b)))
# Original solution
A,B,N = list(map(int,input().split()))
max_ = 0
for x in range(1,N+1):
    C = (A*x)//B - A*(x//B)
    if C > max_:
        max_ = C
print(max_)

# Optimized solution
A,B,N = list(map(int,input().split()))
if B-1>N:
    x = N
else :
    x = B-1
print(( (A*x)//B - A*(x//B)))
# Original solution
a,b,n = list(map(int,input().split()))
max = 0
s = int(b/a)
f = n+1
if b < n:
    f = b+1
for i in range(s,f):
    buf = a*(i%b)-(a*i)%b 
    if buf > max:
        max = buf

print((int(max/b)))

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

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

w=min(n,b-1) 
ma=f(w)
print(ma)
# Original solution
import math
import sys

a, b, n = list(map(int, input().split()))
step = math.ceil(1/10**3)
array = list(range(1, n+1, step))
ans = -sys.maxsize-1

for x in array:
    val = int((a*x)/b) - a*int(x/b)
    if val > ans:
        ans = val

print(ans)


# Optimized solution
a, b, n = list(map(int, input().split()))
x = min(b-1, n)
ans = int((a*x)/b) - a*int(x/b)
print(ans)
# Original solution
a,b,n=list(map(int,input().split()))
pmax=0
for i in range(1,n+1):
    p = i/b - i//b
    if pmax < p:
        pmax=p
print((int(pmax*a)))

# Optimized solution
a,b,n=list(map(int,input().split()))
if n>=b:
    print((int((b-1)/b*a)))
else:
    print((int(n/b*a)))
# Original solution
A, B, N = list(map(int, input().split()))
c = 0
i = 1
x = B * i - 1
while x <= N:
    cc = (A * x) // B - A * (x // B)
    c = max(c, cc)
    i += 1
    x = B * i - 1
if c == 0:
    x = N
    c = (A * x) // B - A * (x // B)
print(c)

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

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

def Calcf(i):
  return math.floor((a * i) / b) - a * math.floor(i / b)
    
print((Calcf(min(b - 1, n))))
# Original solution
A,B,N = list(map(int,input().split()))
ans = 0
if N >= B-1:
    for i in range(B-1,N+1,B):
        a =A*i//B
        b = A*(i//B)
        ans = max(ans,a-b)
else:
    ans = A*N//B - A*(N//B)
print(ans)

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

x = list()
if n<=b:
  for i in range(n+1):
    y = int(a*i/b) - a*int(i/b)
    x.append(y)
else:
  for i in range(b):
    y = int(a*i/b) - a*int(i/b)
    x.append(y)
x = sorted(x)
print((x[-1]))

# Optimized solution
a,b,n=list(map(int,input().split()))
x=min(b-1,n)
print(((a*x)//b-a*(x//b)))
# Original solution
a,b,n = list(map(int,input().split()))
sum = 0
ans = 0

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

# Optimized solution
A, B, N = list(map(int, input().split()))
ans = 0
x = min(B-1, N)
print(((A*x)//B-A*(x//B)))
# Original solution
import math
A, B, N = list(map(int, input().split()))

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

if N < B:
    print((fnc(N)))
else:
    ans = 0
    for i in range(B-1, N+1, B):
        s = fnc(i)
        if s > ans:
            ans = s
    print(ans)

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

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

if B == 1:
    print((0))
elif N < B:
    print((fnc(N)))
else:
    ans = 0
    for i in range(B-1, N+1, B):
        s = fnc(i)
        if s > ans:
            ans = s
    print(ans)
# Original solution
import math
import decimal

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

ans=[]

for i in range(1,n+1):
  x=decimal.Decimal(a*i/b)
  y=decimal.Decimal(i/b)
  c=math.floor(x)-a*math.floor(y)
  ans.append(c)

print((max(ans)))

# Optimized solution
import math
import decimal

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

if b<=n:
  x=decimal.Decimal(a*(b-1)/b)
  c=math.floor(x)
  print(c)

else:
  x=decimal.Decimal(a*n/b)
  c=math.floor(x)
  print(c)
# Original solution
from math import floor, ceil
a, b, n = list(map(int, input().split()))
ans = 10 ** 6 * (-1)
x = 1
while x <= n:
    tmp = floor(a * x / b) - a * floor(x / b)
    ans = max(ans, tmp)
    x += ceil(b / a)
print(ans)


# Optimized solution
from math import floor
a, b, n = list(map(int, input().split()))
x = min(b - 1, n)
ans = floor(a * x / b) - a * floor(x / b)
print(ans)
# Original solution
A, B, N = list(map(int, input().split()))
mx = 0
count = 0
for a in range(N, -1, -1):
    count += 1
    new = int(A*a/B) - A*int(a/B)
    mx = max(mx, new)

print(mx)


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

x = min(B-1, N)

ans = int(A*x/B) - A*int(x/B)

print(ans)
# Original solution
import math
a , b  , n = list(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)


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

# Optimized solution
A,B,N = list(map(int,input().split()))
if B>N:
    print((int(A*N/B)-A*(int(N/B))))
else:
    print((int(A*(B-1)/B)-A*(int((B-1)/B))))
# Original solution
A, B, N = list(map(int, input().split()))
l = -1
r = N
# ans = 0
# for i in range(1, N+1):
#     ans = max(ans, (A*i)//B - (A*(i//B)))
ans2 = (A*N)//B - (A*(N//B))
for i in range(B-1, N, B):

    ans2 = max(ans2, (A*i)//B - (A*(i//B)))
print(ans2)


# Optimized solution
A, B, N = list(map(int, input().split()))
l = -1
r = N
# ans = 0
# for i in range(1, N+1):
#     ans = max(ans, (A*i)//B - (A*(i//B)))
k = min(B-1, N)
ans2 = (A*k)//B - (A*(k//B))

print(ans2)
# Original solution
import math

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

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

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

print(max)

# Optimized solution
import math

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

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

if b <= n:
    print((f(a, b, b-1)))
else:
    print((f(a, b, n)))
# Original solution
def getN():
    return int(eval(input()))
def getNM():
    return list(map(int, input().split()))
def getList():
    return list(map(int, input().split()))

from collections import defaultdict
from sys import exit
import math


def main():
    a,b,x = getList()
    if x < b:
        print((math.floor( (a*x) / b) - a * math.floor(x/b) ))
    else:
        k = b - 1
        print((math.floor( (a * k) / b) - a * math.floor(k / b) ))
        
if __name__ == "__main__":
    main()

# Optimized solution
import sys
# from collections import defaultdict, deque
import math
# import copy
# from bisect import bisect_left, bisect_right
# import heapq

# sys.setrecursionlimit(1000000)

# input aliases
input = sys.stdin.readline

getS = lambda: input().strip()
getN = lambda: int(eval(input()))
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = 10 ** 20
MOD = 1000000007

def solve():
    a, b, n = getList()
    if n >= b-1:
        x = b - 1
    else:
        x = n
    print((math.floor((a * x) / b) - a * math.floor(x/b)))
    return
def main():
    n = getN()
    for _ in range(n):
        solve()
if __name__ == "__main__":
    # main()
    solve()
# Original solution
import sys
A,B,N=list(map(int,input().split()))
X=B-1
ans=(A*N)//B-A*(N//B)
if B==1:
  print((0))
  sys.exit()
while X<=N:
  ans=max(ans,(A*X)//B-A*(X//B))
  X+=B
print(ans) 

# Optimized solution
import sys
A,B,N=list(map(int,input().split()))
X=B-1
X=min(B-1,N)
ans=(A*X)//B-A*(X//B)
print(ans)
# Original solution
a, b, n = list(map(int, input().split()))
if b > n:
    ans = (a*n)//b
else:
    ans = 0
    for i in range(n//b +1):
        result = a*(b*(i+1)-1)//b - a*i
        if result > ans:
          ans = result
        
print(ans)

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

print((int(a*min(n,b-1)/b)))
# Original solution
import sys
import math
from collections import Counter
import itertools
import fractions
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################
 
A,B,N = MI()

ma = 0
for i in range(1,N+1):
    s = math.floor(A*i/B) - A * math.floor(i/B)
    ma = max(ma,s)
print(ma)


# Optimized solution
import sys
import math
from collections import Counter
import itertools
import fractions
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################
 
A,B,N = MI()

mini = min(B-1,N)
s = math.floor(A*mini/B) - A * math.floor(mini/B)
print(s)
# Original solution
a,b,n=list(map(int,input().split()))
ans=[]
for i in range(n+1):
    ans.append(a*i//b-a*(i//b))
print((max(ans)))

# Optimized solution
a,b,n=list(map(int,input().split()))
if b-1>n:
    ans=n
else:
    ans=b-1
print((a*ans//b-a*(ans//b)))
# Original solution
# ABC 165 D - Floor Function

a,b,n = list(map(int, input().split()))
l =[(int((a/b)*(i+1)) - a*int((i+1)/b)) - (int((a/b)*(i)) - a*int((i)/b)) for i in range(1, n+1)]

left = 0
right = n-1
mid = (left+right)//2

while right - left > 1:
    if l[mid] <= 0:
        right = mid
        mid = (left+right)//2
    else:
        left = mid
        mid = (left+right)//2

res = right +1
print((int((a/b)*(res)) - a*int((res)/b)))

# Optimized solution
# ABC 165 D - Floor Function

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

def func(i):
    return int(i*a/b) - a*int(i/b)

print((func(min(b-1, n))))
# Original solution
import math

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

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

print(m)

# Optimized solution
import math

a, b, n = [int(x) for x in input().split()]
# a = 10 ** 6
# b = 10 ** 12
# n = 10 ** 12

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

print(m)
# Original solution
import math

a,b,n = list(map(int, input().split()))
l = []
for i in range(n + 1):
  c = math.floor(a * i / b) - a * math.floor(i / b)
  l.append(c)
print((max(l)))

# Optimized solution
from math import floor

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

if n < b:
  c = floor(a * n / b) - a * floor(n / b)
else:
  c = floor(a * (b - 1) / b) - a * floor((b - 1) / b)
print(c)
# Original solution
import sys
import math
def IL(): return list(map(int,sys.stdin.readline().rstrip().split()))

def Main():
    a,b,n = IL()
    x = min(b-1,n)
    print((math.floor(a*x/b)-a*math.floor(x/b)))
    return

if __name__=='__main__':
    Main()

# Optimized solution
import sys
import math
def IL(): return list(map(int,sys.stdin.readline().rstrip().split()))
 
def Main():
    a,b,n = IL()
    x = min(b-1,n)
    print((a*x//b))
    return
 
if __name__=='__main__':
    Main()
# Original solution
import math


li = list(map(int,input().split()))

def main():

	max = 0
	for i in range(li[2]+1):
		l = (math.floor((li[0]*i)/li[1]) - li[0]*(math.floor(i/li[1])))
		if l > max:
			max = l
	return(print(max))

      

main()


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

# Optimized solution
A, B, N = list(map(int, input().split()))
ans = 0
x = min(B-1,N)
print(((A*x)//B))
# Original solution
import math

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

max_value = 0
n = min(N, B-1)

for i in range(1, n+1):
    tmp =  math.floor(A*i/B) - A* math.floor(i/B)
    if tmp >= max_value:
        max_value = tmp

    
print(max_value)

# Optimized solution
import math

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

max_value = 0
n = min(N, B-1)

max_value =  math.floor(A*n/B) - A* math.floor(n/B)


    
print(max_value)
# Original solution
A,B,N = [int(i) for i in input().split()]
x = N
M = A*N//B
ans = -float("inf")

for _ in range(min([10**7,N])):
    s = (A*x)//B - A*(x//B)
    ans = max([ans,s])
    x -= 1

print(ans)

# Optimized solution
A,B,N = [int(i) for i in input().split()]
t = min([N,B-1])
print((A*t//B))
# Original solution
A,B,N=list(map(int, input().split()))
print((A*min(B-1,N)//B))

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

A, B, N = list(map(int, input().split()))
max = 0
temp = 0
bk_temp = 0

if B <= N:
    max = math.floor(A * (B - 1) / B) - (A * math.floor((B - 1) / B))
else:
    for i in range(1, N + 1):
        temp = math.floor(A*i/B) - (A * math.floor(i/B))
        # print(str(i) + ' ' + str(temp))
        if bk_temp > temp:
            max = bk_temp
            break
        if max < temp:
            max = temp
        bk_temp = temp

print(max)

# Optimized solution
import math

A, B, N = list(map(int, input().split()))
max = 0
temp = 0
bk_temp = 0

if B <= N:
    max = math.floor(A * (B - 1) / B) - (A * math.floor((B - 1) / B))
else:
    # for i in range(1, N + 1):
    #     temp = math.floor(A*i/B) - (A * math.floor(i/B))
    #     print(str(i) + ' ' + str(temp))
    #     if bk_temp > temp:
    #         max = bk_temp
    #         break
    #     if max < temp:
    #         max = temp
    #     bk_temp = temp
    max = math.floor(A * N / B) - (A * math.floor((N) / B))

print(max)
# Original solution
import math
mat =[]
a, b, n = list(map(int, input().split()))
for x in range(n+1):
    ans = math.floor(a*x/b) - a * math.floor(x/b)
    mat.append(ans)
    if mat[x] < mat[x-1]:
        break
print((max(mat)))

# Optimized solution
a, b, n = list(map(int, input().split()))
x = min(b-1, n)
s = (a*x) // b - a * (x // b)
print(s)
# Original solution
a, b, n = list(map(int, input().split()))
def func(i, j, k):
    return (i*k)//j - i*(k//j)
ans = 0
for i in range(1, min(b+1, n+1)):
    if func(a, b, i) > ans:
        ans = func(a, b, i)
print(ans)

# Optimized solution
a, b, n = list(map(int, input().split()))
def func(i, j, k):
    return (i*k)//j - i*(k//j)
m = min(n, b-1)
r = (a*min(n, b-1)) // b
while ((a*m) // b) == r:
    m -= 1
print((func(a, b, m+1)))
# Original solution
A,B,N = list(map(int, input().split()))
ans = -1145141919810931931
Flag = True
for x in range(1, N+1, max(1, int(B/A) - 1)):
    a = int(A*x/B) - A*int(x/B)
    if a>=ans:
        ans = a
        Flag = True
    elif Flag:
        Flag = False
    else:
        break

a = int(A*N/B) - A*int(N/B)
if a>ans:
    ans = a
print(ans)

# Optimized solution
A,B,N = list(map(int, input().split()))
ans = 0
if N >= B:
    ans = int(A*(2*B-1)/B) - A*int((2*B-1)/B)
else:
    ans = int(A*N/B)
print(ans)