Problem:
 Score : 400 points    Problem Statement 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 1 5 7 4      Sample Output 1 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.       Sample Input 2 11 10 9      Sample Output 2 9

Solution (Python):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

a,b,n = na()

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

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

print(ans)

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

x = min(n, b - 1)

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

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

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

if n >= b - 1:
  print(f(a, b, b - 1))
else:
  print(f(a, b, n))

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

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

Solution (Python):
a,b,n = list(map(int, input().split()))
if b<=n:
    z=b-1
    ans=(a*z)//b
else:
    ans=(a*n)//b
print(ans)

Solution (Python):
A,B,N = map(int,input().split())
x = min(N,B-1)

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

Solution (Python):
abn=list(map(int, input().split()))
a=abn[0]
b=abn[1]
n=abn[2]
if n>=b:
    n=b-1
axb=(a*n)//b
print(axb)

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

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

Solution (Python):

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

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

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

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

Solution (Python):


def input_one_number():
    return int(input())

def input_multiple_number():
    return map(int, input().split())

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

A,B,N = input_multiple_number()


ans = 0

x = (min(B-1,N))


wk = A*x//B - x//B*A
ans = max(ans,wk)
print(ans)

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

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

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

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

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

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

Solution (Python):
import math

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


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

Solution (Python):
a,b,n=map(int,input().split())
def calc(a,b,x):
    return (a*x)//b-a*(x//b)

ans1=calc(a,b,min(b-1,n))
print(ans1)

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

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

Solution (Python):
def main():
    A, B, N = map(int, input().split())
    x = (N+1) // B * B - 1
    if x <= 0:
        x = N
    ans = (A*x)//B - A * (x//B)
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import math

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

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

ans = 0

if A == 1 or B ==1:
  ans = 0
else:
  ans = cal_ans(min(N,B-1))

print(ans)

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

Solution (Python):
A, B, N = map(int,input().split())
def f(x):
    return (A*x)//B-A*(x//B)
"""
for x in range(N+1):
    print(x,f(x))
"""
if B-1 <= N:
    print(f(B-1))
else:
    print(f(N))

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

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

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

Solution (Python):
a,b,n = (int(x) for x in input().split())
x = 0
if b<=n:
    x = b-1
else:
    x = n
print(int(a*x/b))

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

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

print(left - right)

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

x = min(b-1, n)

print((a * x)//b)

Solution (Python):
from math import floor
import sys
a,b,n = map(int,sys.stdin.readline().split())
d = 1
if n<b:
	d = b-n
print(floor(a - (a*d)/b))

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7


a,b,n=MI()
s=min(n,b-1)
ans=floor(a*s/b)-a*floor(s/b)
print(ans)

Solution (Python):
from itertools import count

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

n = (N+1)//B
if n == 0:
    print((A*N)//B - A*(N//B))
else:
    print((A*(n*B-1))//B - A*(n-1))

Solution (Python):
A, B, N = map(int, input().split())
alpha = B - 1
if alpha > N:
    alpha = N
print(int(A*alpha / B))

Solution (Python):
import math
import sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from functools import lru_cache, reduce
from heapq import heapify, heappop, heappush
from itertools import chain, combinations, permutations, product
from typing import List, Dict



sys.setrecursionlimit(10**5 + 1)
input = sys.stdin.readline
write = sys.stdout.write


def read_item(cls=int):
    return cls(input())


def read_n_item(cls=int) -> list:
    return [cls(s) for s in input().split()]


def list2d(row, col, init_val=0) -> List[list]:
    return [[init_val] * col for _ in range(row)]


MOD = 10**9 + 7



A, B, N = read_n_item()

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

Solution (Python):
import math

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

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

Solution (Python):

MOD = 10 ** 9 + 7

def main():
    for _ in inputt(1):
        A, B, N = inputi()
        N = min(N, B - 1)
        print(N * A // B)






from math import *
from heapq import *
from itertools import *
from functools import reduce, lru_cache, partial
from collections import Counter, defaultdict
import re, copy, operator, cmath
import sys, io, os, builtins
sys.setrecursionlimit(1000)





BUFSIZE = 8192
class FastIO(io.IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = io.BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(io.IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
def print(*args, **kwargs):
    if args:
        sys.stdout.write(str(args[0]))
        split = kwargs.pop("split", " ")
        for arg in args[1:]:
            sys.stdout.write(split)
            sys.stdout.write(str(arg))
    sys.stdout.write(kwargs.pop("end", "\n"))
def debug(*args, **kwargs):
    print("debug", *args, **kwargs)
    sys.stdout.flush()
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip()
inputt = lambda t = 0: range(t) if t else range(int(input()))
inputs = lambda: input().split()
inputi = lambda k = int: map(k, inputs())
inputl = lambda t = 0, k = lambda: list(inputi()): [k() for _ in range(t)] if t else list(k())





def len(a):
    if isinstance(a, range):
        return -((a.start - a.stop) // a.step)
    return builtins.len(a)
def bisect_left(a, x, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    if key == None: key = do_nothing
    while lo < hi:
        mid = (lo + hi) // 2
        if key(a[mid]) < x: lo = mid + 1
        else: hi = mid
    return lo
def bisect_right(a, x, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    if key == None: key = do_nothing
    while lo < hi:
        mid = (lo + hi) // 2
        if x < key(a[mid]): hi = mid
        else: lo = mid + 1
    return lo
def insort_left(a, x, key = None, lo = 0, hi = None):
    lo = bisect_left(a, x, key, lo, hi)
    a.insert(lo, x)
def insort_right(a, x, key = None, lo = 0, hi = None):
    lo = bisect_right(a, x, key, lo, hi)
    a.insert(lo, x)
do_nothing = lambda x: x
bisect = bisect_right
insort = insort_right
def index(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    if key == None: key = do_nothing
    i = bisect_left(a, x, key, lo, hi)
    if lo <= i < hi and key(a[i]) == x: return a[i]
    if default != None: return default
    raise ValueError
def find_lt(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    i = bisect_left(a, x, key, lo, hi)
    if lo < i <= hi: return a[i - 1]
    if default != None: return default
    raise ValueError
def find_le(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    i = bisect_right(a, x, key, lo, hi)
    if lo < i <= hi: return a[i - 1]
    if default != None: return default
    raise ValueError
def find_gt(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    i = bisect_right(a, x, key, lo, hi)
    if lo <= i < hi: return a[i]
    if default != None: return default
    raise ValueError
def find_ge(a, x, default = None, key = None, lo = 0, hi = None):
    if lo < 0: lo = 0
    if hi == None: hi = len(a)
    i = bisect_left(a, x, key, lo, hi)
    if lo <= i < hi: return a[i]
    if default != None: return default
    raise ValueError






class Tree:
    def __init__(n):
        self._n = n
        self._conn = [[] for _ in range(n)]
        self._list = [0] * n
    def connect(a, b):
        pass





class Sieve:
    def __init__(self):
        self._n = 6
        self._list = [2, 3, 5, 7, 11, 13]
    def extend(self, n):
        if n <= self._list[-1]: return
        maxbase = int(n ** 0.5) + 1
        self.extend(maxbase)
        begin = self._list[-1] + 1
        newsieve = [i for i in range(begin, n + 1)]
        for p in self.primerange(2, maxbase):
            for i in range(-begin % p, len(newsieve), p):
                newsieve[i] = 0
        self._list.extend([x for x in newsieve if x])
    def extend_to_no(self, i):
        while len(self._list) < i: 
            self.extend(int(self._list[-1] * 1.5))
    def primerange(self, a, b):
        a = max(2, a)
        if a >= b: return
        self.extend(b)
        i = self.search(a)[1]
        maxi = len(self._list) + 1
        while i < maxi:
            p = self._list[i - 1]
            if p < b:
                yield p
                i += 1
            else: return
    def search(self, n):
        if n < 2: raise ValueError
        if n > self._list[-1]: self.extend(n)
        b = bisect(self._list, n)
        if self._list[b - 1] == n: return b, b
        else: return b, b + 1
    def __contains__(self, n):
        if n < 2: raise ValueError
        if not n % 2: return n == 2
        a, b = self.search(n)
        return a == b
    def __getitem__(self, n):
        if isinstance(n, slice):
            self.extend_to_no(n.stop + 1)
            return self._list[n.start: n.stop: n.step]
        else:
            self.extend_to_no(n + 1)
            return self._list[n]

sieve = Sieve()
def isprime(n):
    if n <= sieve._list[-1]:
        return n in sieve
    for i in sieve:
        if not n % i: return False
        if n < i * i: return True
prime = sieve.__getitem__
primerange = lambda a, b = 0: sieve.primerange(a, b) if b else sieve.primerange(2, a)
def factorint(n):
    factors = []
    for i in sieve:
        if n < i * i: break
        while not n % i:
            factors.append(i)
            n //= i
    if n != 1: factors.append(n)
    return factors
factordict = lambda n: Counter(factorint(n))





if __name__ == "__main__":
    main()

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

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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







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

Solution (Python):
import math
a,b,n=map(int,input().split())
l=[]
if n>=b:
    x=b-1
else:
    x=n
print(math.floor((a*x)/b)-a*math.floor(x/b))

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

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

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

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

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


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


if B == 1:
    print(0)
elif B > N:
    print(calc(N))
else:
    print(calc(B - 1))

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from math import floor

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

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

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

Solution (Python):
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd
from functools import lru_cache, reduce
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)


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


def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d


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 lcm(x, y):
    return (x * y) // gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm, numbers, 1)


def gcd_list(numbers):
    return reduce(gcd, numbers)


def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True



def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P


def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret



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

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

Solution (Python):
import sys
a, b, n = map(int, sys.stdin.readline().split())
if b-1 >= n:
  s = (a*n)//b - a*(n//b)
else:
  s = (a*(b-1))//b - a*((b-1)//b)
print(s)

Solution (Python):
from math import floor
a, b, n = map(int, input().split())
if b == 1:
	print(0)
else:
	x = min(b-1, n)
	print(floor(a*x/b) - a * floor(x/b))

Solution (Python):
a,b,n=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)

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

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

print(f(min(b-1, n)))

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

ans = 0

i = min(b-1,n)

ans = a*i//b - a*(i//b)

print(ans)

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

x=min(B-1,N)

print(int((A*(x))/B))

Solution (Python):
a,b,n=map(int,input().split())
p=a//b
q=a%b
if n<b-1:
  z=n
else:
  z=b-1
print(p*z+(q*z//b))

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

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

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

Solution (Python):
import time
start=time.time()
A,B,N=[int(s) for s in input().split()]
x=((N+1)//B)*B-1
ans=set()
ans.add((A*N)//B-A*(N//B))
while x>0:
  ans.add((A*x)//B-A*(x//B))
  x-=B
  if (time.time()-start)>1.7:
    break
print(max(ans))

Solution (Python):
import math
A,B,N=map(int,input().split())
ans=0
if N<B:
    print(math.floor(A*N/B))
if N>=B:
    print(math.floor(A*(B-1)/B))

Solution (Python):
mod = 10**9+7
import sys
from collections import Counter, defaultdict, deque
from itertools import product, permutations, combinations
from itertools import accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from math import ceil,floor
from copy import deepcopy
from heapq import heappop,heappush,heapify
import heapq







sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1


p2D = lambda x: print(*x, sep="\n")

def II(): return int(sys.stdin.readline())

def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())




def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI(): return list(map(lambda x:int(x), sys.stdin.readline().split()))
def HI(): return list(map(lambda x:int(x)*(-1), sys.stdin.readline().split()))



a,b,n = MI()
i = min(n,b-1)
tmp = floor((a*i)/b) - a*floor(i/b)
print(tmp)

Solution (Python):
import sys
input = sys.stdin.readline


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


if __name__  == '__main__':
    main()

Solution (Python):
A,B,N=[int(i) for i in input().split(" ")]

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

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

Solution (Python):
def main():
    A, B, N = map( int, input().split())
    def calc(x):
        return A*x//B-x//B*A

    if N < B:
        print(calc(N))
    else:
        print(calc(B-1))
if __name__ == '__main__':
    main()

Solution (Python):
import math
A,B,N =map(int,input().split())
x = 0
r = 0
if N<B:
	x=N
else:x=B-1
r = x%B/B
print(math.floor(A*r))

Solution (Python):
from math import floor

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

a,b,n = map(int, input().split())
res = -10**9
for x in range(max(min(n,b)-100,0),min(n,b)+1):
    res = max(res, f(a,b,x))
print(res)

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


if __name__ == '__main__':
    resolve()

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

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

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

if b>n:
    print(f(n))
    exit()

print(f(b-1))

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

x = min(N, B - 1)

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

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

Solution (Python):
def f(a,b,n):
    return ((a*n)//b) - a*(n//b)

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

if(N < B-1):
    print(f(A,B,N))
else:
    print(f(A,B,B-1))

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

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

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



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

print( A*r // B )

Solution (Python):
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)


def get_nums_l():
    return [ int(s) for s in input().split(" ")]


def get_nums_n(n):
    return [ int(input()) for _ in range(n)]


def get_all_int():
    return map(int, open(0).read().split())

def rangeI(it, l, r):
    for i, e in enumerate(it):
        if l <= i < r:
            yield e
        elif l >= r:
            break

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

MOD = 10**9+7

a,b,n = get_nums_l()

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

def solve(a,b,n):
    m = -999999999999
    mi = 0
    for x in range(n+1):
        y = f(a,b,x)
        if m < y:
            m = y
            mi = x
    return m,mi

print(f(a,b,min(n,b-1)))

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


if B > N:
    result = int(A * N / B) - A * int(N / B)
    
else:
    result = int(A * (B - 1) / B) - A * int((B - 1) / B)
    
print(result)

Solution (Python):
from math import floor

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

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

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

ans = 0

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

print(ans)

Solution (Python):

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline

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

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

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

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

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

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

Solution (Python):
from math import floor

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

Solution (Python):
import math

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




if (ABN[2] >= ABN[1]):
    print(math.floor(ABN[0] * (ABN[1] - 1) / ABN[1]))
else:
    print(math.floor(ABN[0] * ABN[2] / ABN[1]) - ABN[0] * math.floor(ABN[2] / ABN[1]))

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

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

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

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

Solution (Python):
import sys
from math import floor

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


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


if __name__ == '__main__':
    solve()

Solution (Python):
import sys
input = sys.stdin.buffer.readline

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict
from itertools import combinations, permutations
from itertools import accumulate
from math import ceil, sqrt, pi

MOD = 10 ** 9 + 7
INF = 10 ** 18


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

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


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

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

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")


def solve():
    a, b, n = LI()
    print(min(b - 1, n) * a // b)
    return



if __name__ == '__main__':
    solve()

Solution (Python):
[A,B,N] = [int(s) for s in input().rstrip().split(' ')]
if B == 1:
    print(0)
elif N < B:
    print(A*N//B)
else:
    print((A*(B-1))//B)

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

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

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

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

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

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

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

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

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

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

def main():
    a, b, n = LI()
    print(a*min((b-1), n) // b)


main()

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

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

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

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

i = (N+1)//B
x = max(0,i*B - 1)
print(max((A*x)//B - A * (x//B), (A*N)//B - A * (N//B)))

Solution (Python):
import sys

def solve():
    input = sys.stdin.readline
    A, B, N = map(int, input().split())
    print(A * min(N, B - 1) // B)
    return 0

if __name__ == "__main__":
    solve()

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

if B <= N + 1:
  print( A * (B-1) // B )
else:
  print( A * N // B)

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

Solution (Python):
a,b,n = map(int,input().split())
if b ==1:
  print(0)
  exit()
if n >= b-1:
  ans = int(a*(b-1)/b)
  print(ans)
  exit()
  
else:
  print(int(a*n/b))