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

if B > N:
    ans = (A*N)//B - (A * (N//B))
else:
    moge = B*2 - 1
    ans = (A*moge)//B - (A*(moge//B))
    
print(ans)

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6) 
import math
from math import floor
from copy import copy, deepcopy
from operator import itemgetter

from bisect import bisect_left, bisect, bisect_right

from collections import deque 



from collections import Counter

from itertools import accumulate

from heapq import heapify,heappop,heappush


def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds





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




if floor(N/B)==0:
    print(floor(N*A/B))
    exit()
if B==1:
    print(0)
    exit()

X=min(B-1,N)

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

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

Solution (Python):
import random

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

for i in range(10 ** 6):
    num = random.randint(0,n)
    ans = max(ans,(a * num)//b - a * (num//b))
print(ans)

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

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

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

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

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

if N>B:
    x = B -1
else:
    x = N
D = []

if N > 20:
    w = N % 15 + 5
elif N > 4:
    w = N-1
else:
    w = N
for i in range(w):
    F1 = (A*(x-i))//B
    F2 = A * ((x-i)//B)
    S = F1 - F2
    D.append(S)

ans = max(D)
print(ans)

Solution (Python):
import math

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

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())
ans = 0
if n >= b:
    ans = (a*(b-1))//b
else:
    ans = (a*n)//b
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) 
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    


MOD = 10**9 + 7
INF = 2**31  

from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  
from math import gcd


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

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

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math
    

    
    

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

if __name__ == '__main__':
    main()

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())
c=min(b-1,n)
print(int((a*c/b)//1))

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


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

print(ans)

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

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

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

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

Solution (Python):
a,b,n=[int(x) for x in input().split()]

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

Solution (Python):
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))

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



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

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

Solution (Python):
import sys
import math


def main():
    input = sys.stdin.readline
    a, b, n = (int(i) for i in input().split())

    x = min(b - 1, n)

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

    print(res)


main()

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

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

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

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

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

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

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

Solution (Python):
A, B, N=map(int, input().split())
if N<=5:
  print(max([int(A*i/B)-A*int(i/B) for i in range(N+1)]))
  exit()
  
if B==1:
  print(0)
  exit()
            
if N>=B-1:
  x=((N+1)//B)*B-1
  print(int(A*x/B)-A*int(x/B))
else:
  x=N
  print(int(A*x/B)-A*int(x/B))

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

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

Solution (Python):

import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def solve():
    A, B, N = Scanner.map_int()

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


def main():
    
    solve()


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
import math

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

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

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


x = B -1 ; 
if x > N :
	x = N ; 
y = int ( ( A * x ) // B ) - A * int ( x //B ) ;
print ( y ) ;

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

x = min(b-1, n)

print(a*x//b)

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

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

print(max)

Solution (Python):
a, b, n = map(int, input().split())
x = min(n, b)
while x % b == 0 and b != 1:
    x -= 1
if b == 1:
    print(0)
else:
    i = x
    
    print(a * x // b)

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

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

x = min(N, B-1)
ans = f(x)
if N >= B-1:
    ans = A + (-A//B)

print(ans)

Solution (Python):

import numpy as np

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

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

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

Solution (Python):
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect



mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]


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


a, b, n = sp()
low, high = 1, n
answer, index = -inf, 0
while low <= high:
    mid = (low + high) // 2
    temp = calc(mid)
    if temp > answer:
        answer = temp
        low = mid + 1
    else:
        high = mid - 1
if n > pow(10, 7):
    for i in range(1, pow(10, 5)):
        answer = max(answer, calc(i))
    for i in range(n, n-pow(10, 5)-1, -1):
        answer = max(answer, calc(i))
out(answer)

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

a = A // B 
b =  A % B
c = N % B if N < B else B-1
print(a * c + int(b*c/B))

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

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

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

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

Solution (Python):
import math

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

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

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

Solution (Python):
list=input().split(" ")
A=int(list[0])
B=int(list[1])
N=int(list[2])

if N>=B:
    N=B-1

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

Solution (Python):
A, B, N = 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))

Solution (Python):

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

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

if B-1<=N:
  print(function(B-1))
else:
  print(function(N))

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

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

Solution (Python):
import math
def D():
    A, B, N = map(int, input().split())
    if N >= B:
        print(A*(B-1)//B - A*((B-1)//B))
        return
    x = N % B
    print(A*x//B - A*(x//B))
D()

Solution (Python):
def main():

    from bisect import bisect_left as bl, bisect_right as br, insort
    import sys,heapq,math
    from collections import defaultdict as dd, deque
    def data(): return sys.stdin.readline().strip()
    def mdata(): return list(map(int, data().split()))
    out = sys.stdout.write
    
    INF = int(1e9)
    mod = int(1e9)+7

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



if __name__ == '__main__':
    main()

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


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

Solution (Python):
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

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

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

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
def read_int():
    return int(input())

def read_int_map():
    return map(int,input().split(' '))

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

def read_s_list_loop(n):
    return [input() for _ in range(n)]
import math
A,B,N = read_int_map()

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

'''
for i in range(1,N+1):
    print(i, math.floor(A*i/B)-A*math.floor(i/B))
'''

Solution (Python):

import sys
import math

def solve(A: int, B: int, N: int):
    x = min(N, B - 1)
    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))  
    B = int(next(tokens))  
    N = int(next(tokens))  
    solve(A, B, N)

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
import math

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

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

Solution (Python):
import math


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


def solve(A, B, N):
    if N >= B-1: 
        x = max(B - 1, 0)
    else:
        x = N
    y = math.floor(A * x / B) - A * math.floor(x / B)
    return y

if __name__ == '__main__':
    inputs = read()
    print("{}".format(solve(*inputs)))

Solution (Python):


def solve(a: int, b: int, n: int) -> int:
    x = min(n, b - 1)
    return (a * x) // b - a * (x // b)


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

if __name__ == '__main__':
    main()

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

Solution (Python):
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

from collections import defaultdict
from sys import exit
import math


def main():
    a,b,x = getList()
    if x < b:
        print(math.floor( (a*x) / b) - a * math.floor(x/b) )
    else:
        k = b - 1
        print(math.floor( (a * k) / b) - a * math.floor(k / b) )
        
if __name__ == "__main__":
    main()

Solution (Python):
import sys
import math

sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

ans = 0

if N < B - 1:
    ans = math.floor(A * N / B) - A * math.floor(N / B)
else:
    c = B - 1
    cnt = 1
    while c <= N:
        cnt += 1
        t = math.floor(A * c / B) - A * math.floor(c / B)
        ans = max(ans, t)
        c += B
        if B < cnt:
            break

print(ans)

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

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

Solution (Python):
from collections import *
a,b,n = map(int,input().split())
ans = a*n//b - a*(n//b)
mb = (n//b)*b-1
if(mb > 0):
	ans = max(ans,a*mb//b - a*(mb//b))
mbb = min(n,b-1)
ans = max(ans,a*mbb//b - a*(mbb//b))
print(ans)

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

Solution (Python):
from collections import deque, Counter, defaultdict
from itertools import chain, combinations
import json

import bisect
import sys
import math
import bisect
from functools import lru_cache
import itertools

sys.setrecursionlimit(10 ** 8)

M = 10 ** 9 + 7
INF = 10 ** 17


def main():
    
    A, B, N = [int(a) for a in input().split()]

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

    if N < B:
        print(f(N))
        return

    print(f(B-1))




if __name__ == "__main__":
    main()

Solution (Python):



                            
                            
                            
                            



import sys
import math


def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))

def printwsp(*args): return print(*args, end="")
def printsp(*args): return print(*args, end=" ")
def printchk(*args): return print(*args, end="tst, ")

MOD = int(1e9+7); BABYMOD = 998244353;



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



'''
THE LOGIC AND APPROACH WAS DEVELOPED BY ME @luctivud.
SOME PARTS OF THE CODE HAS BEEN TAKEN FROM WEBSITES LIKE::
(I Own the code if no link is provided here or I may have missed mentioning it)
PLEASE DO NOT PLAGIARISE.
'''

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    A,B,N=MI()
    y = (N+1)//B
    x = y*B-1
    
    x = min(x,N)    

    def f(x):
        
        return (A*x)//B - A*(x//B)
    
    x=max(0,x)
    print(max(f(x),f(N),f(N-1)))
if __name__ == '__main__':
    main()

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

if N < B:
  print(fl(N))
  exit()
print(fl(B-1))

Solution (Python):

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

A, B, N = lr()
if B <= N:
    answer = A * (B-1) // B
else:
    answer = A * N // B - A * (N // B)

print(answer)

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):
a, b, n = map(int, input().split())
x = min(n, b - 1)
print(int((a * x) / b) - a * int(x / b))

Solution (Python):
import sys
import math
input = lambda:sys.stdin.readline().strip()
def f(a,b,x):
    return (a*x)//b-(a*(x//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):
import math

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

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

Solution (Python):
inpl = lambda: list(map(int,input().split()))
A, B, N = inpl()
if B-1 > N:
    x = N
else:
    x = B-1

print(x*A//B)

Solution (Python):
import math
A, B, N = 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))

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

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

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


if __name__ == "__main__":
    main()

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

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

Solution (Python):
import math

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

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

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


if __name__ == '__main__':
    solve()

Solution (Python):
A,B,N=map(int,input().split())
ans=0
if N<B:
    for i in range(N,N+1):
        if ((A*i)//B)-A*(i//B)>ans:
            ans=((A*i)//B)-A*(i//B)
else:
    if ((A*(B-1))//B)-A*((B-1)//B)>ans:
            ans=((A*(B-1))//B)-A*((B-1)//B)
print(ans)

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

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

print(ans)

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

Solution (Python):
import math

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

x = b - 1
if n < x:
    x = n

ans = 0

while x > 0:
    l = (a * x) // b
    r = a * (x // b)
    ans = max(ans, l - r)
    x -= b

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
INF = 10**10
MOD = 10**9 + 7
A, B, N = map(int,input().split())





def test():
    mx = 0
    for x in range(1,B):
        v = (A*x)//B - A * (x//B)
        print (v)
        mx = max(mx,v)

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

Solution (Python):
import math
def floorm(a, b, n):
  ans = math.floor((a*n)/b) - a*(math.floor(n/b))
  return ans

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

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

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

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


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

k = (n + 1) // b

x = max(k * b - 1, 0)
ans = f(x)
ans = max(ans, f(n))
print(ans)

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

Solution (Python):
import sys

def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def input(): return sys.stdin.readline().strip()

a, b, n = get_ints()
if n>=b:
  x = b-1
else:
  x = n

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

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

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

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

Solution (Python):
import math

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

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

x = min(b-1,n)

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

Solution (Python):
from math import floor
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

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

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


if __name__ == "__main__":
    main()

Solution (Python):

import sys


def solve(A: int, B: int, N: int):
    def f(x):
        return int(A * x / B) - A * int(x / B)
    x = min(N, B-1)
    return f(x)



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    N = int(next(tokens))  
    print(solve(A, B, N))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    
    main()

Solution (Python):
import sys
import re
import random

from math import sqrt,log
from fractions import gcd  
from collections import Counter, defaultdict

def lcm(a,b):
  return a // gcd(a,b) * b



def read_int():
  return int(input())

def read_ints():
  
  return [int(x) for x in input().split()]

def read_field():
  return input().rstrip()

def read_fields():
  return input().rstrip().split()

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

a,b,n = read_ints()
print(solve(a,b,n))

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

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

Solution (Python):
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())
x=min(B-1,N)
print((A*x)//B-A*(x//B))

Solution (Python):
a,b,m = map(int,input().split())
best = min(b-1,m)

ans = a*(best/b)//1
print(int(ans))

Solution (Python):
import math
ABN = list(map(int,input().split()))

A = ABN[0]
B = ABN[1]
N = ABN[2]

    

if (N < B):
    max_value = int(math.floor(A*N/B))

else:
    max_value = int(math.floor(A*(B-1)/B))
    
print(max_value)

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

from math import floor

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

Solution (Python):
def calc(a, b, x):
    return (a * x) // b - a * (x // b)

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

if n < b:
    print(calc(a, b, n))
else:
    print(calc(a, b, b-1))

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

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math
import sys
import collections

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

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

A, B, N = LI()
if N < B:
    ans = math.floor(A * N / B)
elif N >= B:
    ans = math.floor(A * (B - 1) / B)
print(ans)

Solution (Python):
from sys import stdin


def input():
    return stdin.readline().strip()


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

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

    print(ans)


if __name__ == "__main__":
    main()

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())
if (n >= b):
    x = n*(b//n)-1
else:
    x = n
ans = (a*x)//b - a*(x//b)
print(ans)

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

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

print(ans)

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

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

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

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

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

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

Solution (Python):


A, B, N = map(int,input().split())
'''
A = random.randint(1, 10**4)
B = random.randint(1, 10**4)
N = random.randint(1, 10**4)


'''
'''
maxi = -1
for x in range(1, N+1):
    p = int(A*x/B)
    m = A * int(x/B)
    
    if(p-m>maxi):
        maxi = p-m
        max_index = x
print(max_index)
print(maxi)
'''

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

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

Solution (Python):
def Int():
    return int(input())
def Ints():
    return map(int,input().split())
def IntList():
    return list(Ints())
def IntMat(N):
    return [IntList() for i in range(N)]

A,B,N = Ints()

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


ans = 0
n = 1
x = -(-(B*n)//A)

while x<=N and n <= A-1:
    ans = max(ans, (A*x)//B-A*(x//B))
    n += 1
    x = -(-(B*n)//A)
print(ans)

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

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

Solution (Python):
import math

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

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