Given are integers A, B, and N.
Find the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.
Here floor(t) denotes the greatest integer not greater than the real number t.

-----Constraints-----
 - 1 ≤ A ≤ 10^{6}
 - 1 ≤ B ≤ 10^{12}
 - 1 ≤ N ≤ 10^{12}
 - All values in input are integers.

-----Input-----
Input is given from Standard Input in the following format:
A B N

-----Output-----
Print the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.

-----Sample Input-----
5 7 4

-----Sample Output-----
2

When x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.

Difficulty: interview

Starter code:

Solutions:

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

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


A, B, N = [int(_) for _ in input().split()]

i = min(N, B-1)
ans = (A * i) // B - A * (i // B)

print(ans)


import math

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

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

ans = math.floor(A*x/B) - A*math.floor(x/B)

print(ans)


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


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

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

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

import math

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

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

x = min(n, b-1)

print(f(x, a, b))

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

if b == 1:
  print (0)
  return
else:
  x = min(b-1,n)
  ans = (a*x)//b-a*(x//b)
print (ans)

import math

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

if N < B:
    temp1 = math.floor(A*1/B) - A*math.floor(1/B)
    temp2 = math.floor(A*N/B) - A*math.floor(N/B)
    ans = max(temp1, temp2)

if N >= B:
    temp1 = math.floor(A*1/B) - A*math.floor(1/B)
    temp2 = math.floor(A*(B-1)/B) - A*math.floor((B-1)/B)
    ans = max(temp1, temp2)

print(ans)

import sys
def input(): return sys.stdin.readline().rstrip()
 
 
def main():
    a,b,n=map(int, input().split())
    if b<=n:
        n=b-1
    print(((a*n)//b) - (a*(n//b)))
    

    
 
def __starting_point():
    main()
__starting_point()

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

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

A,B,N=map(int,input().split());f=lambda x:int(A*x/B)-A*int(x/B);print((A>1)*(B>1)*f(min(N,B-1)))

from math import floor
a, b, n = map(int, input().split())
x = min(n, b-1)
print(floor(a * x / b) - a * floor(x / b))

A,B,N=map(int,input().split())
def f(x):return int(A*x/B)-A*int(x/B)
print(f(min(B-1,N)))

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

A, B, N = map(int,input().split())
x = min(B-1, N)
print((A * x) // B)

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

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

A,B,N = 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)

import sys
#import time
from collections import deque, Counter, defaultdict
#from fractions import gcd
import bisect
import heapq
import math
import itertools
import numpy as np
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))
mod = 998244353

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

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

Q = A // B
R = A % B

if R == 0:
    ans = Q * (B - 1)
elif B <= N:
    ans = R - 1 + Q * (B - 1)
else:
    ans = int(A * N / B) - A * int(N / B)

print(ans)

import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    a,b,n = LI()
    ans = 0
    def f(a,b,x):
        ans = (a*x)//b - a*(x//b)
        return ans
    if b-1<=n:
        ans = f(a,b,b-1)
    else:
        ans = f(a,b,n)
    print(ans)
main()

A, B, N = map(int, input().split())
#たしかに周期性があるため、この例でいえばx=1~6 (B-1)までで試せばよい。
#また、その数は増えていくのだから、
#NがB-1を超えた場合はB-1の値、NがB-1以下であればxの最大値で計算すればよい。

min = N
if N > B-1:
  min = B-1
print(A*min//B - A*(min//B))

A, B, N = map(int, input().split())
x = min(B - 1, N)
ans = A * x // B - A * (x// B)
print(ans)

A, B, N = map(int, input().split())
ans = (A*min(N, B-1))//B
print(ans)

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

num = min(b-1,n)

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

'''
Created on 2020/08/29

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write

  A,B,N=list(map(int,pin().split()))
  x=min(B-1,N)
  ans=int(A*x/B)-A*int(x/B)
  print(ans)
  return
main()
#解説AC


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

from math import floor
if B - 1 <= N:
    x = B - 1
else:
    x = N

print(floor(A*x/B) - A*floor(x/B))

import sys
from collections import deque, defaultdict, Counter
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush
from math import ceil, floor, sqrt, gcd, inf
from copy import deepcopy
import numpy as np
import scipy as sp

INF = inf
MOD = 1000000007

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

tmp = 0
res = 0

for x in range(min(b, n), -1, -1):
    res = floor(a * x / b) - a * floor(x / b)
    if res > 0:
        break

print(res)


def delete_head_zeros(n):
	n = str(n)
	l = len(n)
	if "." in n:
		l = n.find(".")
	head_zeros = 0
	for i in range(l - 1):
		if n[i] == "0":
			head_zeros += 1
		else:
			break

	return n[head_zeros:]

# compare a, b
# a, b: int or string
def bigint_compare(a, b):
	a = delete_head_zeros(a)
	b = delete_head_zeros(b)
	if len(a) > len(b):
		return 1
	elif len(a) < len(b):
		return -1
	else:
		if a > b:
			return 1
		elif a < b:
			return -1
		else:
			return 0

# calculate a + b
# a, b: int or string
def bigint_plus(a, b):
	a = str(a)
	b = str(b)

	d = max([len(a), len(b)])
	a = '0' * (d - len(a)) + a
	b = '0' * (d - len(b)) + b

	ans = ""
	carry = 0
	for i in range(d):
		s = int(a[-i-1]) + int(b[-i-1]) + carry
		carry = s // 10
		ans = str(s % 10) + ans
	else:
		if carry:
			ans = str(carry) + ans

	return ans

# calculate a - b
# a, b: int or string
def bigint_minus(a, b): 
	a = str(a)
	b = str(b)
	M = []
	m = []
	sign = ""

	if len(a) > len(b) or (len(a) == len(b) and a >= b):
		[M, m] = [a, b]
	else:
		[M, m] = [b, a]
		sign = "-"
	m = '0' * (len(M) - len(m)) + m

	ans = ""
	borrow = 0
	for i in range(len(M)):
		s = int(M[-i-1]) - int(m[-i-1]) - borrow
		if s < 0:
			borrow = 1
			s += 10
		else:
			borrow = 0
		ans = str(s) + ans

	return sign + delete_head_zeros(ans)

# calculate a * b
# a, b: int or string
def bigint_multiply(a, b):
	a = str(a)
	b = str(b)

	md = []
	for j in range(len(b)):
		carry = 0
		mj = ""
		for i in range(len(a)):
			m = int(a[-i-1]) * int(b[-j-1]) + carry
			carry = m // 10
			mj = str(m % 10) + mj
		else:
			if carry:
				mj = str(carry) + mj
		md.append(mj)

	ans = 0
	for k in range(len(md)):
		ans = bigint_plus(md[k] + "0" * k, ans)

	return ans


# calculate a / b to d digits after decimal point
# a, b, d: int or string
def bigint_divide(a, b, d = 0):
	a = str(a)
	b = str(b)
	d = int(d)
	if d < 0:
		d = 0

	ans = ""
	r = ""
	for i in range(len(a) + d):
		q = 0
		if i < len(a):
			r += a[i]
		elif i == len(a):
			ans += "."
			r += "0"
		else:
			r += "0"

		if bigint_compare(r, b) == -1:
			ans += str(q)
		else:
			while bigint_compare(r, b) >= 0:
				r = bigint_minus(r, b)
				q += 1
			ans += str(q)

	return delete_head_zeros(ans)

def main():
	A, B, N = [int(x) for x in input().split(" ")]
	r = min([N, B - 1])
	print(bigint_divide(bigint_multiply(A, r), B))

main()

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

if n<b :
    ans=math.floor(a*n/b)

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

print(ans)

import math
A, B, N = map(int, input().split())
x = min(N, B - 1)
print(math.floor((A * x) / B) - A * math.floor(x / B))

import math
a,b,n = map(int,input().split())
if n < b-1:
    x = n
else:
    x = b-1
ans = math.floor(a*x/b) - a * math.floor(x/b)
print(ans)

#!/usr/bin/env python3
import sys
from itertools import chain

# floor(A x / B) - A * floor(x / B)
#
# x = B * x1 + x2  : (x2 < B) とする
#
# = floor(A (B*x1+x2) / B) - A floor((B*x1+x2) / B)
# = A x1 + floor(A x2 / B) - A x1
# = floor(A x2 / B)


def solve(A: int, B: int, N: int):
    if N >= B:
        x2 = B - 1
    else:
        x2 = N

    return (A * x2) // B


def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    answer = solve(A, B, N)
    print(answer)


def __starting_point():
    main()

__starting_point()

a, b, n = map(int, input().split())
  
if n >= b:
    x = (a*(b-1))//b - a * ((b-1)//b)
 
else:
    x = (a*n)//b - a * (n//b)
 
print(x)

A,B,N = map(int,input().split())
x = min(N,B-1)
print( int(A*x/B))

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

x = min(b-1, n)

print((a*x)//b)

import math

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

ans = math.floor(a*min(b-1, n)/b)

print(ans)

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

# floor(a/b)=(a-(a%b))/b
# ax%b=a(x%b)%b
a,b,n=map(int,input().split())
if(n>=b-1):
    print(a*(b-1)//b)
else:
    print(a*n//b)

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


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

x = min(B - 1, N)

print((math.floor(A * x / B)))


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

min = N
if N > B-1:
  min = B-1
print(A*min//B - A*(min//B))

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

if B > N:
  ans = math.floor(A * N / B)
else:
  ans = math.floor(A * (B - 1) / B)
  
print(ans)

# import itertools
# import math
# import sys
# sys.setrecursionlimit(500*500)
# import numpy as np

# N = int(input())
# S = input()
# n, *a = map(int, open(0))
A, B, N = map(int, input().split())
# A = list(map(int, input().split()))
# B = list(map(int, input().split()))
# tree = [[] for _ in range(N + 1)]
# B_C = [list(map(int,input().split())) for _ in range(M)]
# S = input()

# B_C = sorted(B_C, reverse=True, key=lambda x:x[1])
# all_cases = list(itertools.permutations(P))
# a = list(itertools.combinations_with_replacement(range(1, M + 1), N))
# itertools.product((0,1), repeat=n)

# A = np.array(A)
# cum_A = np.cumsum(A)
# cum_A = np.insert(cum_A, 0, 0)

# def dfs(tree, s):
#     for l in tree[s]:
#         if depth[l[0]] == -1:
#             depth[l[0]] = depth[s] + l[1]
#             dfs(tree, l[0])
# dfs(tree, 1)
x = 0
if N >= B:
    x = B - 1
else:
    x = N

print(int(A*x/B))

import math
import sys
input = sys.stdin.readline

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

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

main()

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time, copy,bisect
#from operator import itemgetter
#from heapq import heappush, heappop
#import numpy as np
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
#from scipy.sparse import csr_matrix
#from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
import sys

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
nf = lambda: float(ns())
na = lambda: list(map(int, stdin.readline().split()))
nb = lambda: list(map(float, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

A, B, N = na()
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))

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

k = max(0,(n - b + 1) // b)
k = min(n,k * b + b - 1)

print((a * k) // b - a * (k // b))

A,B,N = map(int,input().split())
if N >= B - 1:
    x = B - 1
else:
    x = N 
print(A*(x%B)//B)

import math
a,b,n = map(int,input().split())
i = b -1 
if i > n:
    i = n
print(math.floor(a*i/b) - a*math.floor(i/b))

import math
ini = lambda : int(input())
inm = lambda : map(int,input().split())
inl = lambda : list(map(int,input().split()))
gcd = lambda x,y : gcd(y,x%y) if x%y else y
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
 
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
 
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
 
        if x == y:
            return
 
        if self.parents[x] > self.parents[y]:
            x, y = y, x
 
        self.parents[x] += self.parents[y]
        self.parents[y] = x
 
    def size(self, x):
        return -self.parents[self.find(x)]
 
    def same(self, x, y):
        return self.find(x) == self.find(y)
 
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
 
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
 
    def group_count(self):
        return len(self.roots())
 
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
 
    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
mod = 10**9 + 7

#--maincode----------------

a,b,n = inm()
ans = 0

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

print(ans)

import math
def __starting_point():

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

    ans = 0
    lp = min(b-1,n)
    ans = math.floor((a*lp)/b) - a*math.floor(lp/b)
    print(ans)

__starting_point()


def main():
    a, b, n = map(int, input().split(" "))
    x = min(b-1,n)
    print(a*x//b - a*(x//b))

def __starting_point():
    main()
__starting_point()

import numpy as np
a,b,n= map(int,input().split())

if b-1 <=n:
    value = np.floor(a*(b-1)/b) - a * np.floor((b-1)/b)
else:
    value = np.floor(a*n/b) - a * np.floor(n/b)
print(int(value))

A, B, N = list(map(int,input().split()))
x = min(B-1, N)
print(((A * x) // B - A * int(x // B)))


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

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

def f(x):
    return int(x)
from decimal import Decimal


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

ans=0
if N>=B:
    X=[1,B-1,N]
else:
    X=[1,N]
for x in X:
    if x == B:
        culc = 0
    elif x < B:
        culc = f(A*Decimal(x/B))
    else:
        culc = f(A*Decimal(x/B)) - A * f(Decimal(x/B))
        
    if culc > ans:
        ans = culc
    # print(culc)

print(ans)


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

from decimal import Decimal
A=Decimal(A)
B=Decimal(B)

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

A,B,N = map(int,input().split())
if B-1 <= N:
    print((A*(B-1))//B)
else:
    print((A*N)//B)

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


import math
import collections
import itertools
import copy

def YesNo(Bool):
    if(Bool):
        print("YES")
    else:
        print("NO")
    return

def resolve():

    A,B,N=list(map(int,input().split()))
 
    X=min(N,B-1)

    ans=math.floor(A*X/B)

    print(ans)

resolve()


A,B,N=map(int,input().split())
if B==1:print(0);return
if N<=B:
  print(max((A*(N-1))//B-A*((N-1)//B),(A*N)//B-A*(N//B)))
else:print(A-1)

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

ans = 0
if N < B:
  ans = int(A*N/B)-A*int(N/B)
elif N == B:
  ans = int(A*(N-1)/B)-A*int((N-1)/B)
else:
  ans = int(A*(B-1)/B)-A*int((B-1)/B)
print(ans)


def main():
    a, b, n = map(int, input().split())
    x = min(b-1, n)
    ans = a * x // b - a * (x // b)
    print(ans)
    
def __starting_point():
    main()
__starting_point()

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

x = min(b-1, n) * 1.0

print(int(1.0 * a * x / b) - a * int(1.0 * x / b))

import math


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


def main(A, B, N):
    if N < B:
        return f(A, B, N)
    else:
        return f(A, B, B - 1)


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


#!/usr/bin/env python3

#import
#import math
#import numpy as np
A, B, N = map(int, input().split())

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

from math import *
A,B,N = map(int,input().split())
print(floor(A*min(N,B-1)/B))

a, b, n = list(map(int, input().split()))
print((int((a*(min(n,b-1)%b)-(a*min(n,b-1))%b)/b)))


import math
import decimal

a,b,n=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)

from math import floor

A, B, N = map(int, input().split())
f = lambda x: floor(A*x/B) - A*floor(x/B)

if A==1 or B==1: print(0);return
if N < B: print(f(N));return
print(f(B-1))

A,B,N = map(int,input().split())
if N<B:
    print(int(A*N/B)-A*int(N/B))
if B<=N:
    print(int(A*(B-1)/B)-A*int((B-1)/B))

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

if N<B:
    print((int(((A*N)/B)-((A*N)/B)%1-A*(N/B-(N/B)%1))))
else:
    print((int(((A*(B-1))/B)-((A*(B-1))/B)%1-A*((B-1)/B-((B-1)/B)%1))))



def solve(A, B, N):
    #for x in range(1, N+1): print(f"{x=:2}  {A*x//B=:3} {A*(x//B)}  {A*x//B-A*(x//B)}")
    x = min(B-1, N)
    a = A*x//B-A*(x//B)
    return a

#solve(10, 12, 25)
A, B, N = list(map(int, input().split()))
#solve(5, 7, 4)
print((solve(A, B, N)))


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

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

print(ans)

a, b, n = map(int, input().split())
print((a * min(n, b - 1)) // b - a * (min(n, b - 1) // b))

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

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

import numpy as np
A,B,N = map(int,input().split())
if B <= N:
    x = B-1
    print(int(np.floor(A*x/B)))
else:
    print(int(np.floor(A*N/B)))

def f(a, b, n):
    if b == 1:
        print((0))
    else:
        Max = 0
        step = 1 if b // a ==  0 else b // a
        for x in range(b // a, n + step, step):
            res = (a * x) // b - a * (x // b)
            if res > Max:
                Max = res
        print(Max)

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


A,B,N=map(int,input().split())
print(int(A*min(B-1,N)/B))

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

if b > n :
  x = n

else:
  x = b-1
  
ans = int(a*x/b)
print(ans)


A, B, N = map(int, input().split())
if N < B:
    ans = int(A*N/B)
else:
    ans = int(A*(B-1)/B)
print(ans)

a, b, n = map(int, input().split())
x = b - 1 if n >= b - 1 else n
print((a * x) // b - x // b)

A,B,N=map(int,input().split())
#if B==1:print(0);return
if N>=B:print((A*(B-1))//B)
else:
  print((A*N)//B-A*(N//B))

A,B,N = list(map(int,input().split()))
if B <= N:
    a = int(A*(B-1)/B)
    b = 0
    print((max(a,b)))
else:
    a = int(A*N/B)
    b = 0
    print((max(a,b)))


import math

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

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

def abc165d_floor_function():
    a, b, n = map(int, input().split())
    i = min(n, b-1)
    max_val = a*i//b - a*(i//b)
    # for i in range(1, n+1):
    #     v = a*i//b - a*(i//b)
    #     max_val = max(max_val, v)
    print(max_val)

abc165d_floor_function()

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

k = min(n, b-1)
print(math.floor(a/b*k))

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


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

else:
  print( (a*n) // b - a * (n//b))

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

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


a, b, n = map(int, input().split())
  
if n >= b:
    x = (a*(b-1))//b - a * ((b-1)//b)

else:
    x = (a*n)//b - a * (n//b)

print(x)

#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math

#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
  return int(readline())
a,b,n = readInts()
th = b-1
if n >= th:
    print((int(math.floor(a*th/b) - a * math.floor(th/b))))
else:
    print((int(math.floor(a*n/b) - a * math.floor(n/b))))


a, b, n = map(int, input().split())
print((a * min(n, (b - 1)) // b))

[A, B, N] = [int(i) for i in input().split()]
u = 0
s = float('inf')
if B-1 <= N:
    t = (A * (B-1)) // B - A * ((B-1)//B)
else:
    u += 1
if 2*B - 1 <= N:
    s = (A * (2*B-1)) // B - A * ((2*B-1)//B)
else:
    u += 1

print(min(s, t) if u != 2 else (A*N)//B - A*(N//B))

from math import floor
a,b,n=map(int,input().split())
x=min(b-1,n)
print(floor(a*x/b)-a*floor(x/b))

from math import floor
def f(x):
    return floor(a*x/b)-a*floor(x/b)
a, b, n = map(int, input().split())
print(f(min(b-1, n)))

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

def main():
    a, b, n = map(int, input().split())
    x = min(b - 1, n)
    floor1 = int(a * x / b)
    floor2 = int(x / b)
    print(floor1 - floor2)


def __starting_point():
    main()
__starting_point()

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

import math

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

A,B,N=list(map(int,input().split()))
x=min(B-1,N)
print((A*x//B-A*(x//B)))


import math
a,b,n=map(int,input().split())
d=min(b-1,n)
print(math.floor(a*d/b)-a*math.floor(d/b))