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

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


print(ans)


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

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

if n >= b-1:
    ans = floor(b-1)
else:
    ans = floor(n)

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

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

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

print(x)

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

if b>n:
    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()))

# x=0の場合、値は0
ans = 0
# x=1～Nについて
for x in range(1, min(B+1,N+1)):
    if (A*x)//B - A*(x//B) > ans:
        ans = (A*x)//B - A*(x//B)
        
print(ans)

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

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

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

if __name__ == '__main__':
    main()


# Optimized solution
from math import floor
def main():
    a, b, n= list(map(int, input().split()))
    x = min(n, b - 1)
    r = floor((a * x) / b) - a * floor(x / b)
    print(r)

if __name__ == '__main__':
    main()
# Original solution
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from math import floor
def main():
    a, b, n = list(map(int, input().split()))

    amariset = set()
    for i1 in range(1, n + 1):
        amari = (i1 / b) % 1
        if amari in amariset:
            break
        else:
            amariset.add(amari)
    r = 0
    for amarie in amariset:
        rt = floor(amarie * a) - floor((amarie * a) % 1)
        r = max(r, rt)
    print(r)
if __name__ == '__main__':
    main()

# Optimized solution
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from math import floor
def main():
    a, b, n = list(map(int, input().split()))
    if n < b:
        x = n
    else:
        x = b - 1
    r = floor(a * x / b) - a * floor(x / b)
    print(r)

if __name__ == '__main__':
    main()
# Original solution
a,b,n = list(map(int,input().split()))
p = (n+1)//b
c = p*b-1
if c < 0:
  print((a*n//b-a*(n//b)))
  exit()
ans = 0
for i in range(c,n+1):
  ans = max(ans,a*i//b-a*(i//b))
print(ans)

# Optimized solution
a,b,n = list(map(int,input().split()))
p = (n+1)//b
c = p*b-1
if c < 0:
  print((a*n//b-a*(n//b)))
  exit()
ans = max(a*n//b-a*(n//b),a*c//b-a*(c//b))
print(ans)
# Original solution
import sys
import os

def file_input():
    f = open('../Beginner_Contest_165/input.txt', 'r')
    sys.stdin = f

def main():
    #file_input()
    # input()
    A,B,N=list(map(int, input().split()))

    max=0
    # for x in range(N+1):
    #     # ans=int(A*x/B)-A*int(x/B)
    #     min,_=math.modf(x/B)
    #     # ans=int(A*min)
    #     # print(min)
    #     if x==0:
    #         max=min
    #     elif min > max:
    #         max=min
    #     else:
    #         break

    max=0
    max_x=0
    first=0

    for x in range(N+1):
        rem = x%B
        if x == 0:
            first=rem
        elif rem == first:
            break
        if rem > max:
            max=rem
            max_x=x

    # min,_=math.modf(max_x/B)

    print((int(A*max_x/B)-A*int(max_x/B)))

if __name__ == '__main__':
    main()


# Optimized solution
import sys
import os

def file_input():
    f = open('../Beginner_Contest_165/input.txt', 'r')
    sys.stdin = f

def main():
   # file_input()
    # input()
    A,B,N=list(map(int, input().split()))

    max=0
    # for x in range(N+1):
    #     # ans=int(A*x/B)-A*int(x/B)
    #     min,_=math.modf(x/B)
    #     # ans=int(A*min)
    #     # print(min)
    #     if x==0:
    #         max=min
    #     elif min > max:
    #         max=min
    #     else:
    #         break

    # max=0
    # max_x=0
    # first=0
    #
    # for x in range(N+1):
    #     rem = x%B
    #     if x == 0:
    #         first=rem
    #     elif rem == first:
    #         break
    #     if rem > max:
    #         max=rem
    #         max_x=x

    if N<B:
        max_x=N
    else:
        max_x=B-1

    # min,_=math.modf(max_x/B)

    print((int(A*max_x/B)-A*int(max_x/B)))

if __name__ == '__main__':
    main()
# Original solution
from copy import deepcopy

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

score = 0
if a * n / b < 1:
    print((0))
    exit()

for i in range(n+1):
    tmp = int(a * i / b) - a * int(i / b)
    if score <= tmp:
        score = deepcopy(tmp)
    else:
        print(score)
        exit()
print(score)

# Optimized solution

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

score = 0

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

ans = 0

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

print(ans)

# Optimized solution
def f(a, b, n):
    return int(a*n/b) - a*int(n/b)

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

print((f(a, b, b-1) if n >= b-1 else f(a, b, n)))
# Original solution
a, b, n = list(map(int, input().split()))
 
tmp = 0
for x in (list(range(1, b+1, 2)) if b<=n else list(range(1, n+1, n-1))):
#for x in range(1, n+1):
    calc = a*x//b - a*(x//b)
    if calc > tmp:
        tmp = calc
 
print(tmp)

# Optimized solution
a, b, n = list(map(int, input().split()))
 
tmp = 0
for x in (list(range(1, b+1, b-2)) if b<=n else list(range(1, n+1, n-1))):
#for x in range(1, n+1):
    calc = a*x//b - a*(x//b)
    if calc > tmp:
        tmp = calc
 
print(tmp)
# Original solution
# -*- coding: utf-8 -*-

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

if N > B:
    for x in range(1,B+1):
        ans = (x % B) / B * A
        if ans > z:
            z = ans
else:
    for x in range(1,N+1):
        ans = (x % B) / B * A
        if ans > z:
            z = ans

print((int(z)))

# Optimized solution
# -*- coding: utf-8 -*-

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

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

print((int(z)))
# Original solution
a,b,n = list(map(int,input().split()))
ma = 0

if(n<b):
    ma = (a*n)//b - (a* (n//b))
else:
    ma = (a*(b-1))//b - (a*((b-1)//b))
    for x in range(b,n+1):
        
        num = (a*x)//b - (a*(x//b))
        if(ma > num):
            break
        ma = num
        

print(ma)

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

if(n<b):
    ma = (a*n)//b - (a* (n//b))
else:
    ma = (a*(b-1))//b - (a*((b-1)//b))
    """
    for x in range(b,n+1):
        
        num = (a*x)//b - (a*(x//b))
        if(ma > num):
            break
        ma = num
    """

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

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

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

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

x=min(n,b-1)
print(((a*x)//b-a*(x//b)))

# Optimized solution
"""
- floor function
- xは(0<=x<=B-1 && x<=N)を満たす最大数
"""
a,b,n=list(map(int,input().split()))
 
x=min(n,b-1)
print(((a*x)//b-a*(x//b)))
# Original solution
# coding: utf-8
import math
A, B, N = list(map(int, input().split()))
tmp = 0
ans = 0
for i in range(1, N+1):
    tmp = math.floor(A * i / B) - A * math.floor(i / B)
    ans = max(tmp, ans)
print(ans)

# Optimized solution
# coding: utf-8
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()))
ans=-10**9
if a==1 or b==1:
    print((0))
else:
    for i in range(1,n+1):
        tmp=int(a*i/b)-a*int(i/b)
        if tmp<ans:
            break
        else:
            ans=tmp
    print(ans)

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

ans = 0
zero_cnt = 0
for i in range(n+1):
    tmp = int(a*i/b) - a*int(i/b)
    if ans != 0 and tmp == 0:
        break
    ans = max(ans, tmp)
print(ans)

# Optimized solution
a, b, n = list(map(int, input().split()))
x = min(b-1, n)
print((int(a*x/b)))
# Original solution
a,b,n = list(map(int, input().split()))
ans = 0
p = int(pow(n,0.5))
for x in range(n,p,-1):
    ans = max(int(a*x/b) - (a*int(x/b)),ans)
print(ans)

# Optimized solution
a, b, n = list(map(int,input().split()))
x = min(n,b-1)
print((int(a*(x%b) / b)))
# Original solution
A, B, N = list(map(int,input().split()))
List = [int(A*i/B)-A*int(i/B) for i in range(N+1)]
print((max(List)))

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



# Optimized solution
A, B, N = list(map(int,input().split()))
print((int(A*min([N,B-1])/B)))
# Original solution
import math
a,b,n=list(map(int,input().split()))
l=[i/b for i in range(1,n+1)]
m=[math.floor(a*s)-a*math.floor(s) for s in l]

print((max(m)))

# Optimized solution

a,b,n=list(map(int,input().split()))
m=0
for i in range(1,n+1):
    s=i/b
    num=int(a*s)
    num-=a*int(s)
    if num>=m:
        m=num
    
print(m)
# Original solution

a,b,n=list(map(int,input().split()))
m=0
for i in range(1,n+1):
    s=i/b
    num=int(a*s)
    num-=a*int(s)
    if num>=m:
        m=num
    
print(m)

# 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
#!/usr/bin python3
# -*- coding: utf-8 -*-

import sys
input = sys.stdin.readline

def main():
    A, B, N = list(map(int, input().split()))
    N = min(B-1, N)
    ret = 0
    for x in range(N+1):
        ret = max(ret, (x * A)//B - A * (x//B))

    print(ret)



if __name__ == '__main__':
    main()

# Optimized solution
#!/usr/bin python3
# -*- coding: utf-8 -*-

import sys
input = sys.stdin.readline

def main():
    A, B, N = list(map(int, input().split()))
    N = min(B-1, N)
    ret = (N * A)//B - A * (N//B)
    print(ret)



if __name__ == '__main__':
    main()
# 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()))

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()))
import math
ans=[]
for i in range(1,N+1):
    ans.append(math.floor(A*i/B)-A*math.floor(i/B))
print((max(ans)))

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

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


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

ans=0
t=min(b,n)
for i in range(t,max(t-3,-1),-1):
    ans=max(ans,((a*i)//b-(a*(i//b))))
print(ans)
# Original solution
# -*- coding: utf-8 -*-

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

ans_list = []

for i in range(int(b / 10), n + 1):
  #print(int((a * i) / b), a * int(i / b), int((a * i) / b) - a * int(i / b))
  ans = int((a * i) / b) - a * int(i / b)
  ans_list.append(ans)
print((max(ans_list)))



# Optimized solution
# -*- coding: utf-8 -*-
# x = p * b + q
# 0 <= q < b
# int(a * p + a * q / b) - a * int(p - q / b)
# = a * p + int(a * q / b) - a * p
# = int(a * q / b)

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

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

a,b,n = list(map(int, input().split()))
mx = 0
for i in range(n+1):
  v = floor(a*i/b) - a*floor(i/b)
  if v < mx:
    break
  else:
    mx = v
print(mx)


# Optimized solution
from math import floor

a,b,n = list(map(int, input().split()))
i = min(n,b-1)
print((floor(a*i/b) - a*floor(i/b)))
# Original solution
a,b,n=list(map(int,input().split()))
def f(x):
    y=(a*x)//b-a*(x//b)
    return y
print((f(min(b-1,n))))


# Optimized solution
a,b,n=list(map(int,input().split()))
def f(x):
    y=((a*x)//b)-a*(x//b)
    return y
print((f(min(b-1,n))))
# Original solution
A, B, N = list(map(int, input().split()))

if B > N:
    ans = int(A*N/B)
    print(ans)
else:
    t = int(A*N/B)- A*int(N/B)
    ans = 0
    x = (N//B)*B - 1
    while True:
        temp = int(A*x/B) - A*int(x/B)
        # if ans > temp:
        #     break
        # ans = temp
        ans = max(ans, temp)
        x -= B
        if x < 0:
            break
    print((max(ans, t)))

# 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)))

# if B > N:
#     ans = floor(A*N/B)
#     print(ans)
# else:
#     ans = floor(A*N/B) - A*floor(N/B)
#     ans_2nd = 0
#     x = (N//B)*B - 1
#     temp = floor((A*x)/B) - A*floor(x/B)
#     # while ans <= temp and x >= 0:
#     #     ans = temp
#     #     temp = floor(A*x/B) - A*floor(x/B)
#     #     x -= B
#     # while ans_2nd <= temp and x >= 0:
#     #     ans_2nd = temp
#     #     temp = floor(A*x/B) - A*floor(x/B)
#     #     x -= B
#     # prfloor(max(ans, ans_2nd))
#     print(max(temp, ans))
# Original solution
import math
a, b, n = list(map(int, input().split()))
def f(x):
    return math.floor(a * x / b) - a * math.floor(x // b)
print((f(min(b - 1, n))))

# Optimized solution
import math

a, b, n = list(map(int, input().split()))
def f(x):
    return (a * x) // b - a * (x // b)

left, right = 0, n
# 答えが整数になる場合このrightとleftの幅を3未満にするとバグる
while abs(right - left) > 3:
    mid1 = (right * 2 + left) // 3 + 1
    mid2 = (right + left * 2) // 3
    if f(mid1) <= f(mid2):
        # 上限を下げる（最小値をとるxはもうちょい下めの数だな）
        right = mid1
    else:
        # 下限を上げる（最小値をとるxはもうちょい上めの数だな）
        left = mid2
ans = 0
for i in range(left, right + 1):
    ans = max(ans, f(i))
print((max(ans, f(0), f(n))))
# Original solution
import math

a, b, n = list(map(int, input().split()))
def f(x):
    return (a * x) // b - a * (x // b)

left, right = 0, n
# 答えが整数になる場合このrightとleftの幅を3未満にするとバグる
while abs(right - left) > 3:
    mid1 = (right * 2 + left) // 3 + 1
    mid2 = (right + left * 2) // 3
    if f(mid1) <= f(mid2):
        # 上限を下げる（最小値をとるxはもうちょい下めの数だな）
        right = mid1
    else:
        # 下限を上げる（最小値をとるxはもうちょい上めの数だな）
        left = mid2
ans = 0
for i in range(left, right + 1):
    ans = max(ans, f(i))
print((max(ans, f(0), f(n))))

# Optimized solution
import math

a, b, n = list(map(int, input().split()))
def f(x):
    return (a * x) // b - a * (x // b)

left, right = 0, n
# 答えが整数になる場合このrightとleftの幅を3未満にするとバグる
while abs(right - left) > 3:
    mid1 = (right * 2 + left) // 3 + 1
    mid2 = (right + left * 2) // 3
    if f(mid1) <= f(mid2):
        # 上限を下げる（最小値をとるxはもうちょい下めの数だな）
        right = mid1
    else:
        # 下限を上げる（最小値をとるxはもうちょい上めの数だな）
        left = mid2
ans = 0
for i in range(left, right + 1):
    ans = max(ans, f(i))
# f(0), f(x)もジャッジしないとバグる
print((max(ans, f(0), f(n))))
# Original solution
from math import floor

A,B,N = list(map(int,input().split()))
Max = -100000000000000
for i in range(1,N+1):
    Max = max(Max,floor(A*i/B)-A*floor(i/B))

print(Max)

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

ans = 0
lenge = min(b-1, n)
for x in range(lenge+1):
    y = int((a*x)/b) - a * int(x/b)
    ans = max(y, 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
def f(a,b,x):
	return int(a*x/b) - a*int(x/b)

a,b,n = list(map(int,input().split()))
print((max([f(a,b,x) for x in range(1,n+1)])))



# Optimized solution

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

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

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

# Optimized solution
A, B, N = list(map(int, input().split()))
Smx = 0
if B<N:
    N = B
for i in range(N,0,-1):
    if i<N-A:
        break
    S = int((A*(i % B) - ((A*i) % B))/B)
    if Smx<S:
        Smx = S
print(Smx)
# Original solution
import math

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

max_num = 0
for x in range(1, N+1):
    t = math.floor(A * x / B) - A * math.floor(x / B)
    if t > max_num:
        max_num = t

print(max_num)

# Optimized solution
def main():
    A, B, N = list(map(int, input().split()))
    x = min(B-1, N)
    ans = int((A*x)/B) - A*int(x/B)
    print(ans)


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

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

R = f(N)
for xb in range(N//B):
    x = (xb+1) * B - 1
    R = max(R,f(x))
print(R)

# Optimized solution
A,B,N = [int(x) for x in input().split()]

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

print((f(min(B-1,N))))
# Original solution
import sys
a, b, n = list(map(int, input().split()))

if n < b:
    ans = a * n // b  
    print(ans)
    sys.exit()  
elif n == b:
    ans = a * (b-1) // b
    print(ans)
    sys.exit()

# n == 1のときは0 問題なし
r = n // b
ans = 0
for i in range(1, r + 1):
    t = i * b - 1
    ans_t = a * t // b - (a * (i - 1))
    ans = max(ans, ans_t) 
    # print(i, t, ans)

t = r * b - 1
ans_t = a * t // b - (a * (r - 1))
ans = max(ans, ans_t) 

ans_t = a * n // b - (a * (n // b))
ans = max(ans, ans_t) 

print(ans)

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

if n < b:
    ans = a * n // b  
    print(ans)
    sys.exit()  
elif n == b:
    ans = a * (b-1) // b
    print(ans)
    sys.exit()

# n == 1のときは0 問題なし
r = n // b
ans = 0
# for i in range(1, r + 1):
#     t = i * b - 1
#     ans_t = a * t // b - (a * (i - 1))
#     ans = max(ans, ans_t) 
    # print(i, t, ans)

t = r * b - 1
ans_t = a * t // b - (a * (r - 1))
ans = max(ans, ans_t) 

ans_t = a * n // b - (a * (n // b))
ans = max(ans, ans_t) 

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


# Optimized solution
A,B,N = list(map(int,input().split()))
S = 0
n = N // B
r = N % B
if B > N:
    S = (A*N)//B
else:
    if  r == 0:
        S = (A*(N-1))//B - A * ((N-1)//B)
    elif r == B - 1:
        S = (A*N)//B - A * (N//B)
    else:
        S = (A*(n*B-1))//B - A * ((n*B-1)//B)

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

if B < N:
    Max = int(A*(B-1)/B)
    for x in range(B,1+N):
        fx = int(A*x/B) - A * int(x/B)
        Max = max(Max,fx)
elif B == N:
    Max = int(A*(B-1)/B)
else:
    Max = int(A*N/B)
print(Max)


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


if B < N:
    Max = int(A*(B-1)/B)
    X = int(N/B)
    fx = int(A*(B*X-1)/B) - A * int((B*X-1)/B)
    # Max = max(fx,Max)
    # for x in range(1,X):
    #     fx = int(A*x/B) - A * int(x/B)
    #     Max = max(Max,fx)
elif B == N:
    Max = int(A*(B-1)/B)
else:
    Max = int(A*N/B)
print(Max)
# Original solution
import math

A, B, N = list(map(int, input().split(' ')))
ans = 0
for x in range(min(B, N + 1)):
    res = math.floor((A * x) / B) - A * (math.floor(x / B))
    ans = max(res, ans)
print((int(ans)))


# Optimized solution
import math

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

A, B, N = list(map(int, input().split(' ')))
ans = 0
x = min(B, N + 1) - 1
ans = math.floor((A * x) / B) - A * (math.floor(x / B))
print((int(ans)))


# Optimized solution
import math

A, B, N = list(map(int, input().split(' ')))
x = min(B, N + 1) - 1
print((math.floor((A * x) / B) - A * (math.floor(x / B))))
# Original solution
#!/usr/bin/env python3
import sys
import math

def solve(A: int, B: int, N: int):
    max_b = 0

    k = min(N,B-1)
    # print(k)
    # for x in range(min(N+1,1000000)):
    max_b = math.floor(A*k/B)
    print(max_b)

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(A, B, N)

if __name__ == '__main__':
    main()


# Optimized solution
A,B,N = list(map(int, input().split()))
 
C = N - N%B
ans = A*(C-1)//B - A*((C-1)//B)
if B > N:
  ans = (A*N//B) - A*(N//B)
print(ans)
# Original solution
# coding:utf-8
def main():
    import math

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

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

    print(ans)


if __name__ == "__main__":
    main()


# Optimized solution
# coding:utf-8

import math

a, b, n = list(map(int, input().split()))
x = min(b - 1, n)

ans = math.floor((a * x) / b) - a * (math.floor(x / b))

print(ans)
# Original solution
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import math as mt

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

    maxn = 0
    
    if N > B:
        for x in range(B-1, N+1, B):
            temp = mt.floor(A*x/B) - A*mt.floor(x/B)
            if temp >= maxn:
                maxn = temp
            else:
                break
    elif N == B:
        maxn = mt.floor(A*(N-1)/B) - A*mt.floor((N-1)/B)
    else:
        maxn = mt.floor(A*N/B) - A*mt.floor(N/B)
    
    print(maxn)


if __name__ == '__main__':
    main()

# Optimized solution
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import math as mt

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

    maxn = 0
    
    if N >= B:
        maxn = mt.floor(A*(B-1)/B) - A*mt.floor((B-1)/B)
    else:
        maxn = mt.floor(A*N/B) - A*mt.floor(N/B)
    
    print(maxn)


if __name__ == '__main__':
    main()
# Original solution
A, B, N = list(map(int, input().split()))
answer = 0

if B / 2 > N:
    num = reversed(list(range(1, N + 1)))
else:
    num = list(range(1, N + 1))

for x in num:
    value = int(A * x / B) - A * int(x / B)
    if answer <= value:
        answer = value
    
    if x == B:
        break

print(answer)

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

if N < B:
    x = N
else:
    x = B - 1

value = int(A * x / B) - A * int(x / B)
print(value)
# Original solution
a,b,n=list(map(int,input().split()))
x=0
for i in range(n+1):
  if x<=((a*i)//b)-a*(i//b):
    x=((a*i)//b)-a*(i//b)
print(x)

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

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