CodeEff/ECCO huggingface dataset:
# Original solution
import math


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

    def target(x):
        # print(math.floor(A * x / B))
        # print(A * math.floor(x / B))
        return math.floor(A * x / B) - A * math.floor(x / B)

    max_value = -1
    for i in range(1, min(N+1, B + 1)):
        v = target(i)
        # print(f'x={i} f(x)={v}')
        if v > max_value:
            max_value = v
    print(max_value)


if __name__ == '__main__':
    main()


# Optimized solution
import math


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

    def target(x):
        # print(math.floor(A * x / B))
        # print(A * math.floor(x / B))
        return math.floor(A * x / B) - A * math.floor(x / B)

    print((target(min(N, B-1))))

    # B_A = 1.0 * B / A
    #
    # max_value = -1
    # for i in range(1, int(B / B_A) + 3):
    #     x = int(B_A * i)+1
    #     if x > N:
    #         break
    #     v = target(x)
    #     # print(f'x={i} f(x)={v}')
    #     if v > max_value:
    #         max_value = v
    #
    #     x_2 = int(B_A * i)
    #     if x_2 > N:
    #         break
    #     v = target(x_2)
    #     # print(f'x={i} f(x)={v}')
    #     if v > max_value:
    #         max_value = v
    #
    #     x_3 = int(B_A * i) -1
    #     if x_3 > N:
    #         break
    #     v = target(x_3)
    #     # print(f'x={i} f(x)={v}')
    #     if v > max_value:
    #         max_value = v
    #
    # print(max_value)


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

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

# Optimized solution
A,B,N=list(map(int,input().split()))
x=(N//B)*B-1
ans=(A*N)//B - A*(N//B)
if N>=B:
    ans=max(ans, (A*x)//B - A*(x//B))
print(ans)
# 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()))
def f(x):
  return int(A*x/B)-A*int(x/B)

print((f(min(N,B-1))))
# Original solution
import sys
from math import sqrt, floor
from collections import Counter, defaultdict, deque

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


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


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


def LI():
    return list(MI())


def LIN(n: int):
    return [I() for _ in range(n)]


inf = float("inf")
mod = 10 ** 9 + 7


def main():
    a, b, n = MI()
    max = 0
    for x in range(1, n + 1):
        r = floor((a * x) / b) - a * floor(x / b)
        if max < r:
            max = r

    print(max)


if __name__ == "__main__":
    main()


# Optimized solution
import sys
from math import sqrt, floor

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


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


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


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

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


if __name__ == "__main__":
    main()
# Original solution
A,B,N = list(map(int,input().split()))
def floor(x):
  return int(x//1)
list = []
if N >= B:
  for x in range(B+1):
    list.append(floor((A*x)/B)-(A*floor(x/B)))
else:
    list.append(floor((A*N)/B)-(A*floor(N/B)))
print((max(list)))


# Optimized solution
A,B,N = list(map(int,input().split()))
def floor(x):
  return int(x//1)
list = []
if N >= B:
    list.append(floor((A*(B-1))/B)-(A*floor((B-1)/B)))
else:
    list.append(floor((A*N)/B)-(A*floor(N/B)))
print((max(list)))
# Original solution
import math

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

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

i = 1
max_x = -9999999
max = -9999999
while (i <= N):
    ans =func(A, B, i) 
    if (ans > max):
        max = ans
        max_x = i
    i += 1

print(max)

# Optimized solution
import math

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

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

"""
i = 1
max_x = -9999999
max = -9999999
while (i <= N):
    ans =func(A, B, i) 
    if (ans > max):
        max = ans
        max_x = i
    i += 1

print(max)
"""

print((func(A, B, min(B-1, N))))
# Original solution
import math

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

maxVal = 0

for i in range(b):
    if i > n:
        break
    val = math.floor(a*i/b)-a*math.floor(i/b)
    if val > maxVal:
        maxVal = val

print(maxVal)

# Optimized solution
import math

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

if b <= 10**6:
    maxVal = 0

    for i in range(b):
        if i > n:
            break
        val = math.floor(a*i/b)-a*math.floor(i/b)
        if val > maxVal:
            maxVal = val

    print(maxVal)
elif n > b:
    print((a-1))
elif n == b:
    m = n - 1
    print((math.floor(a*m/b)-a*math.floor(m/b)))
else:
    print((math.floor(a*n/b)-a*math.floor(n/b)))
# Original solution
def f(x):
    return (a * x) // b - a * (x // b)


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

k = (n + 1) // b

ans = 0
for x in range(max(0, k * b - 1), n + 1):
    ans = max(ans, f(x))

print(ans)


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


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

k = (n + 1) // b

x = max(k * b - 1, 0)
ans = f(x)
ans = max(ans, f(n))
print(ans)
# Original solution
import math

def main(A, B, N):
    answer = 0
    for x in range(N + 1):
        cand = math.floor(A * x / B) - A * math.floor(x / B)
        answer = max(answer, cand)
    print(answer)



if __name__ == '__main__':
    A, B, N = list(map(int, input().split()))
    # A, B, N = 5, 7, 4
    main(A, B, N)


# Optimized solution
import math

def main(A, B, N):
    x = min(B-1, N)
    answer = math.floor(A * x / B) - A * math.floor(x / B)
    print(answer)

if __name__ == '__main__':
    A, B, N = list(map(int, input().split()))
    main(A, B, N)
# Original solution
from math import floor

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

a,b,n = list(map(int,input().split()))
ans = 0
for i in range(min(b-1,n)):
  ans = max(ans,f(i+1))
  
print(ans)  

# Optimized solution
from math import floor

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

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

A, B, N = list(map(int, input().split()))
max = 0
i = 1
while True:
  x = i * B -1
  if x > N:
    if i == 1:
      x = N
    else:
      break
  k = int(((x / B) - (x // B)) * A)
  if k > max:
    max = k
  i +=1
print(max)

# Optimized solution
A, B, N = list(map(int, input().split()))
max = 0
i = 1
p = int((N + 1) / B)
if p == 0:
  x = N
else:
  x = B * p -1
print((int(((x / B) - (x // B)) * A)))
# Original solution
def main():
    A, B, N = (int(x) for x in input().split())
    mini = 0
    if N >= B:
        for x in range(B-1, N+1, B):
            k = x / B
            ans = int(A*k) - int(k)
            if ans > mini:
                mini = ans
    else:
        ans = int(A*(N)/B)
    print(ans)


if __name__ == "__main__":
    main()


# Optimized solution
def main():
    A, B, N = (int(x) for x in input().split())
    mini = 0
    if N >= B:
        ans = int(A*(B-1)/B)
    else:
        ans = int(A*(N)/B)
    print(ans)


if __name__ == "__main__":
    main()
# Original solution
def main():
    a, b, n = list(map(int, input().split()))
    x = min(b-1, n)
    print(((a*x)//b - a*(x//b)))
    
if __name__ == "__main__":
    main()

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

if __name__ == "__main__":
    main()
# Original solution
def main():
    a, b, n = list(map(int, input().split()))
    x = min(b-1, n)
    print(((a*x)//b-a*(x//b)))

if __name__ == "__main__":
    main()

# Optimized solution
def main():
    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
A,B,N=list(map(int,input().split()))
max_L=0
x=0
while x<B and x<=N:
	L=int(A*x/B)-A*int(x/B)
	if max_L<=L:
		max_L=L
		x+=1
	else:
		break

"""
if B>N:
	while x<=N:
		L=int(A*x/B)-A*int(x/B)
		if x<N:
			if max_L<=L:
				max_L=L
				x+=1
			else:
				break
		else:
			if max_L<=L:
				max_L=L
				break
			else:
				x-=1
				break
else:
	while x<B:
		L=int(A*x/B)-A*int(x/B)
		if max_L<=L:
			max_L=L
			x+=1
		else:
			break
"""
print(max_L)

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

print(max_L)
# Original solution
import math

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)))
print(ans)

# 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
a,b,n=list(map(int,input().split()))

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

while x <= n:
    tmp = (a * x // b) - a * (x // b)
    if max < tmp: max = tmp
    x += b

print(max)

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

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

max = (a * x // b) - a * (x // b)

print(max)
# Original solution
#!/usr/bin/env python3
import sys
import math

def solve(A: int, B: int, N: int):
    print((max([math.floor(A*x/B) - A*math.floor(x/B) for x in range(1, min(B+1, N+1))])))
    return


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
#!/usr/bin/env python3
import sys
import math

def solve(A: int, B: int, N: int):
    x = min(B-1, N)
    print((math.floor(A*x/B) - A*math.floor(x/B)))
    return


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()
# Original solution
import math
A, B, N = (int(i) for i in input().split())  
ans = 0
for x in range(N+1):
  ans = max(ans, math.floor(A * x / B) - A * math.floor(x/B))
    
print(ans)



# Optimized solution
import math
A, B, N = (int(i) for i in input().split())  

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

print((func(A, B, min(N, B-1))))
# Original solution
import math


nums = [int(e) for e in input().split()]

a = nums[0]
b = nums[1]
n = nums[2]

max_score = -1
score = -1

for x in range(1, n+1):
    score = math.floor(a*x/b) - a* math.floor(x/b)
    if max_score < score:
        max_score = score
        x += 1
    elif x > b:
        break

print(max_score)


# Optimized solution
import math


nums = [int(e) for e in input().split()]

a = nums[0]
b = nums[1]
n = nums[2]

max_score = -1
score = -1

# for x in range(1, n+1):
#     score = math.floor(a*x/b) - a* math.floor(x/b)
#     if max_score < score:
#         max_score = score
#     elif x > b:
#         break

if b > n:
    max_score = math.floor(a*n/b)
else:
    max_score = math.floor(a*(b-1)/b)

print(max_score)
# Original solution
a, b, n = list(map(int, input().split()))
max_int = 0
if a != b:
    if n < b:
        max_int = int((a*n)/b) -a * int(n/b)
    else:
        #for i in range(n, n-max(int(b/a), int(a/b), int(a%b), int(b%a))-1, -1):
        for i in range(1, n):
            tmp = int((a*i)/b) -a * int(i/b)

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

print(max_int)

# Optimized solution
a, b, n = list(map(int, input().split()))
i = min(b-1, n)
print((int((a*i)/b) -a * int(i/b)))
# Original solution
a,b,n=list(map(int,input().split()))
import math
x=b-1
if n<b-1:
    m=[math.floor(a*n/b)]
else: m=[0]
while x<=n:
    f=math.floor(a*x/b)-a*(math.floor(x/b))
    m.append(f)
    x+=b
print((max(m)))

# Optimized solution
a,b,n=list(map(int,input().split()))
import math
if n<b:
    m=math.floor(a*n/b)
else:
    e=b-1
    m=math.floor(a*e/b)
print(m)
# Original solution
import math
A,B,N = list(map(int,input().split()))
ans = 0
flag = False
for i in range(1,N+1):
    t = math.floor(A*i/B)
    s = A*math.floor(i/B)
    if t-s >= 1:
        flag = True
    if flag and t-s == 0:
        break
    ans = t-s
print(ans)

# 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
A, B, N = list(map(int, input().split()))
f = [int(A*x/B) - (A * int(x/B)) for x in range(N+1)]
print((max(f)))

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

ans = alpha * q + (beta*q//B)
print(ans)

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

# Optimized solution
a,b,n=list(map(int,input().split()))
x=min(b-1,n) #上記よりxとしてmin(B-1,N)を選ぶのが最善
print(((a*x)//b-a*(x//b)))
# Original solution
import math
A ,B ,N = list(map(int,input().split()))
l = 0
t = A/B
for x in range(1,N+1):
    if math.floor(t * x)-A*math.floor(x/B) > l:
        l=math.floor(t * x)-A*math.floor(x/B)
print(l)

# Optimized solution
A , B , N = list(map(int,input().split()))
x = min(B-1,N)
print(((A*x)//B))
# Original solution
import math
S =  list(map(int,input().split()))
A = S[0]
B = S[1]
N = S[2]
d = []
for i in range(1,N+1):
    t = math.floor(A*i/B)-math.floor(i/B)*A
    d.append(t)
print((max(d)))


# Optimized solution
import math
S =  list(map(int,input().split()))
A = S[0]
B = S[1]
N = S[2]
if N<B:
    print((math.floor(A*N/B)-math.floor(N/B)*A))
else:
    print((math.floor(A*(B-1)/B)-math.floor((B-1)/B)*A))
# Original solution
A,B,N=list(map(int,input().split()))
list_ans=[]
minimum=min(N-3,0)
for i in range(minimum,N+1):
  list_ans.append(int(A*i/B)-A*int(i/B))
print((int(max(list_ans))))

# Optimized solution
A,B,N=list(map(int,input().split()))
list_ans=[]
minimum=min(B-1,N)
print((int(A*minimum/B)-A*int(minimum/B)))
# Original solution
A, B, N = list(map(int,input().split()))
max = 0
x = 0
n = int(B/A)
if(n < 1):n=1
if(A == 1 or B == 1):
  print(max)
else:
  while(x <= N):
    f = (A*x)//B - A*(x//B)
    #x += n
    x += 1
    #print(f)
    if(max <= f):
      max = f
    if(max != 0 and f == 0):
      break
  print(max)

# Optimized solution
A,B,N = list(map(int,input().split()))
def f(x):
  f = int((A*x)/B)-A*int(x/B)
  return f
if(B-1 < N):
  print((f(B-1)))
else:
  print((f(N)))
# Original solution
import math

n = list(map(int,input().split()))
hikaku = 0

for x in range(1,n[2]+1):
    m = math.floor(n[0] * x // n[1]) - n[0] * math.floor(x // n[1])
    if hikaku < m:
        hikaku = m

print(hikaku)


# Optimized solution
import math

n = list(map(int,input().split()))
x = min(n[1]-1 , n[2])
if n[2] >= n[2]:
    print((math.floor(n[0] * x / n[1])))
# Original solution
import math

def bisearch(function, ok, ng):
    tmp = 0
    while abs(ok-ng) > 1:
        mid = (ok + ng)//2
        ans = function(mid)
        if ans > tmp:
            ok = mid
        else:
            ng = mid
        print(("mid:{}".format(mid)))
        tmp = ans
    return ok

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

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

# print(bisearch(calc, ok, ng))
ans = []
tmp = calc(1)
for i in range(1, N+1):
    a = calc(i)
    ans.append(a)
    if tmp > a:
        break
    tmp = a

print((max(ans)))

# Optimized solution
import math

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

A, B, N = list(map(int, input().split()))
print((calc(min(B-1, N))))
# Original 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)))

# Optimized solution
a,b,n=list(map(int,input().split()))
if b-1<=n:
  x=b-1
  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
a, b, n = list(map(int, input().split()))
arr = []
ans = 0
for i in range(min(b, n)):
  x = i + 1
  arr.append(math.floor(a * x / b) - a * math.floor(x / b))
ans = max(arr)
print(ans)

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

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


def main():
    
    ans = 0
    i = 0
    while B > i and i <= N:
        fi = f(i)
        ans = f(i) if ans < fi else ans
        i += 1 
    
    print(ans)


if __name__ == "__main__":
    main()


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


def main():
    if N >= B:
        print((f(B-1)))
    else:
        print((f(N)))

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

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

c = a/b
p = []

for x in range(n + 1):
    d = math.floor(c * x) - a * math.floor(x / b)
    p.append(d)
    p.sort()
    if len(p) == 2:
        del p[0]


print((p[0]))


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

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

if __name__ == '__main__':
    main()
# Original solution
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return eval(input())

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

  # right=n
  # ans=math.floor(a*right/b)-a*math.floor(right/b)
  # left=0
  # while left<=right:
  #   half=(left+right)//2
  #   _ans=math.floor(a*half/b)-a*math.floor(half/b)
  #   if _ans==ans:
  #     return ans
  #   elif _ans>ans:
  #     right=half-1
  #     ans=_ans
  #   else:
  #     left=half+1

  ans=int(a*1/b)-a*int(1/b)
  x=int(math.sqrt(n))
  for i in range(max(0,n-x-100000000),n+1):
    ans=max(ans,int(a*i//b)-a*int(i//b))
  return ans

# main()
print((main()))


# Optimized solution
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return eval(input())

def main():
  # floor(x/b)がギリギリ割り切れない辺りが一番大きくなりそう
  # -> 実験してみるとmath.floor(a*x/b)-a*math.floor(x/b)はループしてそう
  # -> 答えはfloor(x/b)がギリギリ割り切れないときの値に決め打つぜ！
  a,b,n=LI()
  x=min(n,b-1)
  return math.floor(a*x/b)-a*math.floor(x/b)

# main()
print((main()))
# Original solution
A,B,N=input().split()
A=int(A)
B=int(B)
N=int(N)

ans=0
for x in range(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()))

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()))
maxn = 0
sec =False
pp =False
for x in range(1,N+1):
    tmp = math.floor((A*x)/B)-A*(math.floor(x/B))
    if maxn < tmp:
        maxn = tmp
    if sec == True and tmp != 0:
        pp =True
    if tmp == 0:
        if sec ==True and pp ==True:
            break
        else:
            sec =True
    
print(maxn)

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

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

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


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

d = 0
ans = 0

mid = N//2
if (math.floor((A*mid)/B) - A*math.floor(mid/B)) < (math.floor((A*(mid+1))/B) - A*math.floor((mid+1)/B)):
    for i in range(mid, N+1):
        d = math.floor((A * i) / B) - A * math.floor(i / B)
        if ans <= d:
            ans = d
        else:
            print(ans)
            exit()
else:
    for i in range(0, mid+1):
        d = math.floor((A * i) / B) - A * math.floor(i / B)
        if ans <= d:
            ans = d
        else:
            print(ans)
            exit()

print(ans)

# Optimized solution
import math

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

x = min(b - 1, n)

max_num = (a * x) // b - a * (x // b)
print(max_num)

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

x = min(b - 1, n)

max_num = (a * x) // b - (a * (x // b))
print(max_num)
# Original solution
import math

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

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

print(ans)

# Optimized solution
import math

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

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

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

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

ans = -float("inf")
for x in range(n):
    #print(a*((x+1)%b)//b)
    if a*((x+1)%b)//b > ans:
        ans = a*((x+1)%b)//b

#print("----------")
print(ans)

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

if n < b-1:
    print((a*(n%b)//b))
else:
    print((a*((b-1)%b)//b))
# Original solution
a,b,n = list(map(int, input().split()))
com = 0
if n < b:
    x = n
else:
    x = b-1
while x >= 0:
    val = (a*x)//b-a*(x//b)
    if val < com:
        pass
    else:
        com = val
    x -= 1
print(com)

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