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

print((int((a * n) / b) - a * int(n / b)))

# Optimized solution
a, b, n = list(map(int, input().split()))
syou = n // b
if syou >= 1:
    n = b * 1 - 1
 
print((int((a * n) / b) - a * int(n / b)))
# Original solution
a,b,n = [int(i) for i in input().split()]
 
ans = [0 for _ in range(b)]
 
for i in range(b):
    ans[i] = (a*i // b - a * (i // b))
    
ans = ans[:n+1] if n < b else ans
 
print((max(ans)))

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


ans = 0
for i in range(1, n+1):
  t = (a*i//b) - a*(i//b)
  ans = max(ans,t)
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()))

if n >= b-1:
  print((a*(b-1)//b - a*((b-1)//b)))
else:
  ans = 0
  for x in range(1,n+1):
    ans = max(ans, int(a*x/b) - a*int(x/b))
  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()))

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

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

x = min(n, b-1)
print((int(a*x//b) - a*(x//b)))
# Original solution
import math
a,b,n = list(map(int,input().split()))
max = 0
x = 0
while math.floor(a*x/b) - a*math.floor(x/b) <= a and x <= n:
	if max < math.floor(a*x/b) - a*math.floor(x/b):
		max = math.floor(a*x/b) - a*math.floor(x/b)
	x += 1
print(max)

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

# Optimized 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))))
# Original solution
import math
a,b,n=list(map(int,input().split()))
max=-2
if n<b:
    max=math.floor(a*n/b)
else:
    #b<=n
    max=math.floor(a*(b-1)/b)
    for i in range(b,n+1):
        s2=math.floor(a*((1/b)-i//b))
        if max<s2:
            max=s2

print(max)

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

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

# Optimized solution
import math
A,B,N = list(map(int,input().split()))
m = min(B-1,N)
num = math.floor((A*m)/B) - A * math.floor(m / B)
print(num)
# Original solution
import math
A,B,N=list(map(int,input().split()))
start=0
for i in range(1,N+1):
    K=math.floor(((i/B)-(i//B))*A)
    if start<=K:
        start=K
print(start)

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

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

print(ans)


# Optimized solution
#n=int(input())
a,b,n=list(map(int,input().split()))
#hl=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

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


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

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

X = N
Y = min(B-1,N)

print((f(Y)))


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

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

X = N
Y = min(B-1,N)

print((max(f(X),f(Y))))
# Original solution
a,b,n=list(map(int,input().split()))
m=0
if n<b:
	m=(a*n)//b
elif n==b:
	m=max((a*(n-1))//b,(a*n)//b-a*(n//b))
else:
	m=(a*(n-1))//b
	for i in range(b,n+1):
		m=max(m,(a*n)//b-a*(n//b))
print(m)


# Optimized solution
a,b,n=list(map(int,input().split()))
m=0
if n<b:
	m=(a*n)//b
elif n==b:
	m=max((a*(n-1))//b,(a*n)//b-a*(n//b))
else:
	m=max((a*(b-1))//b,(a*n)//b-a*(n//b))
print(m)
# Original solution
#!/usr/bin/env python3
def main():
    import sys

    input = sys.stdin.readline

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

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


if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python3
def main():
    import sys

    input = sys.stdin.readline

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

    x = min(B - 1, N)
    print(((A * x) // B - A * (x // B)))


if __name__ == '__main__':
    main()
# Original solution
import math
a,b,n=list(map(int,input().split()))
li=[]
for i in range(n+1):
    c=math.floor((a*i)/b)-(a*math.floor(i/b))
    li.append(c)
print((max(li)))

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

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

n = min(n, b)


mem = {}
m = 0
for x in range(1, n + 1):
    if mem.get(((a * x) % b, x % b)) is not None:
        break    
    else:
        c = math.floor(a * x / b) - a * math.floor(x / b)
        mem[((a * x) % b, x % b)] = 1
        m = max(m, c)
print(m)


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

n = min(n, b-1)

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

mod = a % b / b
ans = int(a*n/b)-a*int(n/b)
for i in range(n)[::-1]:
    tmp = int(a * i / b) - a * int(i / b)
    ans = max(ans, tmp)


print(ans)


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

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

# Optimized solution
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
# D - Floor Function

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

# max(floor(a * x / b) - a * floor(x / b) for 0 <= x <= n)
# x = k * b のとき, 第1項 == 第2項
# k * b <= x < (k+1) * b のとき, 第1項は単調増加, 第2項は一定

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


# Optimized solution
# D - Floor Function

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

# max(floor(a * x / b) - a * floor(x / b) for 0 <= x <= n)
# x = k * b のとき, 第1項 == 第2項
# k * b <= x < (k+1) * b のとき, 第1項は単調増加, 第2項は一定

x = min(n, b - 1)
print((a * x // b))
# Original solution
import sys
input = sys.stdin.readline

import math

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

    max_ans = 0

    for x in range(n+1):
        buff = math.floor(a*x/b) - a*math.floor(x/b)
        if buff > max_ans:
            max_ans = buff

    print(max_ans)

if __name__ == '__main__':
    main()


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

import math

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

    if b > n:
        print((math.floor(a*n/b) - a*math.floor(n/b)))

    else:
        print((math.floor(a*(b-1)/b) - a*math.floor((b-1)/b)))

if __name__ == '__main__':
    main()
# Original solution
A,B,N=list(map(int,input().split()))
x=0
while A*int(x/B)<1 and x<=N:
    x+=1
print((int((A*(x-1))/B)))

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

print(Max)
  



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

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

# Optimized solution
a,b,n = list(map(int,input().split()))
x=min(b-1,n)
ans=a*x//b-a*(x//b)
print(ans)
# Original solution
def main():
    import sys
    input = sys.stdin.readline

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

    num = N//B

    score = 0
    for x in range(1, N+1):
        tmp = int(A*x/B) - A*int(x/B)
        if score <= tmp:
            score = tmp
    print(score)


if __name__ == "__main__":
    main()


# Optimized solution
def main():
    import sys
    input = sys.stdin.readline

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

    x = min(B-1, N)
    print((int(A*x/B)-A*int(x/B)))


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

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

maxresult = 0


#for x in range(n+1):
#    if (a * x * 1.0 // b) - a * (x * 1.0 // b) >= maxresult:
#        maxresult = int((a * x * 1.0 // b) - a * (x * 1.0 // b))

for x in range(n+1):
    if a * math.modf(x*1.0/b)[0] >= maxresult:
        maxresult = a * math.modf(x*1.0/b)[0]

print((int(maxresult)))

# Optimized solution
import math

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

maxresult = 0

#これはタイムオーバー
#for x in range(n+1):
#    if (a * x * 1.0 // b) - a * (x * 1.0 // b) >= maxresult:
#        maxresult = (a * x * 1.0 // b) - a * (x * 1.0 // b)

#これもタイムオーバー
#for x in range(n+1):
#    if a * math.modf(x*1.0/b)[0] >= maxresult:
#        maxresult = a * math.modf(x*1.0/b)[0]

"""
解説動画を見て、再考
x = pB + qと変形する。（https://twitter.com/chokudai/status/1256806061194874881）
floor[Ax / B]
=floor[(APB+Aq) / B]
=Ap + floor[Aq / B]

A * floor[x / B]
= A * floor[(pB+q) / B]
= A * (p + floor[q/B])

よって、
floor[Ax / B] - A * floor[x / B]
=Ap + floor[Aq / B] - Ap - A * floor[q / B]
=floor[Aq / B] - A * floor[q / B]
  #x = pB + qであるため、floor[q/B] = 0
=floor[Aq / B]
  #q = (x % B)なので
=floor[A/B * (x % B)]
この値が最大になればよく、xは整数なので、
x = B-1の時が最大となる。

ただしN < B-1の場合は、x = B-1を取れないので、
そのときにはxの最大値x=Nとなる。
"""

if n < b-1:
    x = n
else:
    x = b-1
maxresult = a * (x%b) // b

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

# Optimized solution
a,b,n = list(map(int, input().split()))
if n >= b-1:
    print((int(a*(b-1)/b)-a*int((b-1)/b)))
else:
    print((int(a*n/b)-a*int(n/b)))
# Original solution
import math
A,B,N=list(map(int,input().split()))
maxi = min(A,N)
ans = 0
for i in range(1,maxi+1):
    ans = max(ans,math.floor((A*i)/B)-A*math.floor(i/B))
if A<N:
    for i in range(A,B+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()))
maxi=min(B-1,N)
print((math.floor((A*maxi)/B)-A*math.floor(maxi/B)))
# Original solution
import math
s = list(map(int,input().split()))
n=s[0]
m=s[1]
q=s[2]
x=0
for i in range(1,q+1):
    re=math.floor(n*i/m)-math.floor(i/m)*n
    if x<re:
        x=re
print(x)

# Optimized solution
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
    ans = math.floor(a*x/b)-n*math.floor(x/b)
print(ans)
# Original solution
import sys
a,b,n = list(map(int,input().split()))
d = 0
i = 0
for i in range(1,n+1):
    c = int(a*i/b)-a*int(i/b)
    if c >= d:
        d = c
    else:
        i += 1
        if i > 1:
            print((int(a*(i-2)/b)-a*int((i-2)/b)))
            sys.exit()
print(d)

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

l = []
if N < B:
    for x in range(N+1):
        l.append(math.floor(A*x/B) - A*math.floor(x/B))
else:
    for x in range(B):
        l.append(math.floor(A*x/B) - A*math.floor(x/B))

print((max(l)))
# print(l)


# 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
a,b,n = [int(x) for x in input().split()]

ans = 0

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

print(ans)

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


x = min(n,b-1)
print(((a*x//b)-(x//b)*a))
# Original solution
A, B, N = [int(i) for i in input().split()]
ans = 0
if N < B:
    ans = int(( A * (N % B) - (A * N) % B) / B)
else:
    for x in range(B-1, N+1, B):
        tmp = int(( A * (x % B) - (A * x) % B) / B)
        if tmp >= ans:
            ans = tmp
print(ans)

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


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

temp = 0

for x in range(abn[2] + 1):
    m = math.floor(abn[0] * x / abn[1]) - abn[0] * math.floor(x / abn[1])

    if m > temp:
        temp = m

print(temp)


# Optimized solution
import math
abn = list(map(int,input().split()))

x = min(abn[1] - 1, abn[2])
m = math.floor(abn[0] * x / abn[1]) - abn[0] * math.floor(x / abn[1])
print(m)
# Original solution
from math import floor

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

max_x = 0
x     = 0
a_b   = a / b

while n > 0:
    x = floor(a_b * (n % b))

    max_x = x if x > max_x else max_x

    n -= 1

print(max_x)

# 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
import math
A,B,N= list(map(int,input().split()))

list=[]
for i in range(N+1):
    list.append(math.floor((A*i)/B)-A*(math.floor(i/B)))

print((max(list)))


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

if B<=N:
    lista=(math.floor((A*(B-1))/B)-A*(math.floor((B-1)/B)))
    print(lista)
else:
    list=(math.floor((A*N)/B)-A*(math.floor(N/B)))
    print(list)
# Original solution
import math

bl=input().split()
A=int(bl[0])
B=int(bl[1])
C=int(bl[2])
m=0
for x in range(C+1):
  y=math.floor(A*x/B)-A*math.floor(x/B)
  if y>m:
    m=y
print(m)

# Optimized solution
import math

bl=input().split()
A=int(bl[0])
B=int(bl[1])
C=int(bl[2])

if C<B:
  m=math.floor(A*C/B)-A*math.floor(C/B)
else:
  m=math.floor(A*(B-1)/B)

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

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

c = int(a*n/b) - a*int(n/b)

if n < b:
    print(c)
else:
    c = int(a*(b-1)/b) - a*int((b-1)/b)
    print(c)
# Original solution
a,b,n=list(map(int,input().split()))
x_kouho=[]
count=1
while count<=n//b:
  x_kouho.append(b*count-1)
  count+=1
if not x_kouho:
  x_kouho.append(n)

res=0
for i in range(0,len(x_kouho)):
  keep=x_kouho[i]
  kept=(a*keep)//b-a*(keep//b)
  if kept>res:
    res=kept
print(res)

# Optimized solution
a,b,n=list(map(int,input().split()))
x_kouho=[]
count=1
if b==1:
  res=0
else:
  while count<=n//b:
    x_kouho.append(b*count-1)
    count+=1
  if not x_kouho:
    x_kouho.append(n)

  res=0
  for i in range(0,len(x_kouho)):
    keep=x_kouho[i]
    kept=(a*keep)//b-a*(keep//b)
    if kept>res:
      res=kept
print(res)
# Original solution
a, b, n = list(map(int, input().split()))

if b < n:
    n = b

ans_lst = []
for x in range(1, n+1):
    y = x / b
    ans = int(a*y) - a*int(y)
    ans_lst.append(ans)
print((max(ans_lst)))


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

y = n//b
if y == 0:
    x = n
else:
    x = b - 1
print((int(a*x/b) - a*int(x/b)))
# Original solution
a, b, n = list(map(int, input().split()))
c = [0 for i in range(n+1)]
x = 0
while x <= b and x <= n:
  c[x] = (a*x)//b - a*(x//b)
  x += 1
print((max(c)))

# 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()))
ans = 0
for x in range(1,n+1):
    B = x/b
    f = B - int(B) 
    if ans <= f:
        ans = f
print((int(ans * a)))

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

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

if n < b - 1:
    max = f(n)
else:
    x = b - 1
    max = f(x)
    while x <= n:
        if max < f(x):
            max = f(x)
        x += b

print(max)

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

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

if n < b - 1:
    max = f(n)
elif b == 1:
    max = 0
else:
    x = b - 1
    max = f(x)
    while x <= n:
        if max < f(x):
            max = f(x)
        x += b

print(max)
# Original solution
a, b, n = list(map(int, input().split()))
Max = 0
e = 1/b
for i in range(n):
  i += 1  
  Max = max(Max, int(a*i*e)-a*int(i*e))
  if Max != int(a*i*e)-a*int(i*e):
    print(Max)
    break
else:
  print(Max)

# 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()))
ans = 0
for i in range(n+1):
    temp = (a*i)//b - a * (i // b)
    if temp > ans:
        ans = temp
print(ans)

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

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

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

ans = 0
for i in range(1, min(B, N)+1):
    ans = max(ans, f(i))
print(ans)


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

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

if B > N:
    print((f(N)))
elif B == N:
    print((f(N-1)))
else:
    print((f(B-1)))
# Original solution

import math



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

x = 1

num = math.floor(n/b)

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

# Optimized solution

import math



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

x = 1

num = math.floor(n/b)

if num == 0:
    x = n
    print((math.floor(a*x/b)-a*math.floor(x/b)))
    exit()
if num >= 100000:
    print((b-1))
    exit()
else:
    ans = 0
    for i in range(1,num+1):
        x = b*i-1
        ans = max(ans,math.floor(a*x/b)-a*math.floor(x/b))
print(ans)
# Original solution
import math
a, b, n = list(map(int, input().split()))
m = 0
t = min(b, n)
for i in range(b//a, t+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)

# Optimized solution
import math
a, b, n = list(map(int, input().split()))
if n < b: print((math.floor((a*n)/b) - a*math.floor(n/b)))
else: print((math.floor((a*(b-1))/b) - a*math.floor((b-1)/b)))
# Original solution
from math import *
A,B,N=[int(i) for i in input().split()]
f = lambda k:floor(A*k/B)
k=0
mx=f(k)
while k<=B-1 and k<=N:
    if f(k)>mx:
        mx=f(k)
    k+=1
print(mx)


# Optimized solution
from math import *
A,B,N=[int(i) for i in input().split()]
f = lambda k:floor(A*k/B)
if B-1 < N:
    print((f(B-1)))
else:
    print((f(N)))
# Original solution
A, B, N = list(map(int, input().split()))
ans_dict = {}
for x in range(N + 1):
    if (A * x) // B >= (A * (x // B)):
        ans_dict.setdefault((((A * x) // B) - (A * (x // B))), x)
    else:
        break


print((max(ans_dict)))

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

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


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

max = num = int(a*n/b) - a * int(n/b)

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

print(max)


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

if n<b:
    print((((a*n)//b) - a * (n//b)))
else:
    print((((a*(b-1))//b) - a * ((b-1)//b)))
# Original solution
import math
A, B, N = list(map(int, input().split()))
x = N // 2
def floor(t):
    return math.floor(t)
li = []
if B > N:
    for i in range(1, N + 1):
        li.append(floor((A*i) / B) - A * floor(i/B))
else:
     for i in range(1, B + 1):
        li.append(floor((A*i) / B) - A * floor(i/B))
print((max(li)))

# Optimized solution
import math
A, B, N = list(map(int, input().split()))
x = N // 2
def floor(t):
    return math.floor(t)
li = []
if B < N:
    print((floor((A*(B - 1)) / B) - A * floor((B - 1)/B)))
elif B == N:
    print((floor((A*(N - 1)) / B) - A * floor((N - 1)/B)))
else:
    print((floor((A*(N)) / B) - A * floor((N)/B)))
# Original solution
a, b, n = list(map(int, input().split()))
t = n // b
if t == 0:
    ans = int(a * n / b) - a * int(n / b)
else:
    ans = 0
    for i in range(t):
        x = b * i + (b - 1)
        if x > n:
            x = n
        else:
            pass
        
        tmp = int(a * x / b) - a * int(x / b)
        if tmp > ans:
            ans = tmp
        else:
            pass

print(ans)

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

if t == 0:
    ans = int(a * n / b) - a * int(n / b)
else:
    ans = 0
    for i in range(t):
        x = b * i + (b - 1)
        if x > n:
            x = n
        else:
            pass
        
        tmp = int(a * x / b) - a * int(x / b)
        
        if tmp > ans:
            ans = tmp
        else:
            break

print(ans)
# Original solution
import sys
input = sys.stdin.readline

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

ans = 0
if N >= B-1:
    for i in range(B-1,N,B):
        ans = max(ans, ((A*i)//B) - A * (i//B))

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


print(ans)

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

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

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


print(ans)
# Original solution
a, b, n= [int(i) for i in input().split()]

ans = 0

for i in range(min(n, b-1), 0, -1):
  ans = max(ans, int((a*i)/b))
  if int((a*i)/b) < ans:
    break
  
print(ans)

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

if int(n/b) == 0:
  print((int((a*n)/b)))
else:
  print((int((a*(b-1))/b)))
# Original solution
l=list(map(int,input().split()))
a=l[0]
b=l[1]
n=l[2]
x=0
for i in range(1,n+1):
  y=(((a*i)/b)//1)-(a*((i/b)//1))
  if(y>x):
    x=y
print((int(x)))

# Optimized solution
l=list(map(int,input().split()))
a=l[0]
b=l[1]
n=l[2]
if b-1<=n:
  i=b-1
else:
  i=n
y=(((a*i)/b)//1)-(a*((i/b)//1))
print((int(y)))
# Original solution
import math
a, b , n = list(map(int, input().split()))

max = -1
x = 0

while(x < n):
    x += 1
    new = math.floor(a*x/b) - a * math.floor(x/b)
    #print(math.floor(a*x/b), " - ",  a * math.floor(x/b))
    #print(new)
    if max < new:
        max = new


print(max)


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

if b <= n:
    x = b-1

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