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 numpy as np
import math
import scipy
import itertools

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

if __name__ == "__main__":
    solve()

Solution (Python):




import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    a,b,n=map(int, readline().rstrip().split())

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

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

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

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

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


if __name__ == "__main__":
    main()

Solution (Python):


from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

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

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

print(int(a))

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

x=n
ans=0
if n >= b-1:
    x=b-1
ans=a*(x%b)//b
print(ans)

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

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

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

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

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

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

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

Solution (Python):
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

A, B, N = rl()

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

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

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

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

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

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

Solution (Python):
import math
a, b, n = map(int, input().split())
x = min(b-1, n)
print(math.floor(a*(x%b)/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):
A, B, N = list(map(int, input().split()))

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

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

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

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

Solution (Python):
import math
A, B, N = list(map(int, input().split()))
ans = 0
if B+1 < N:
    C = B+1
else:
    C = N
if B//A == 0:
    D = 1
else:
    D = B//A

for i in range(1, C+D, D):
    val = math.floor(A*i/B) - A*math.floor(i/B)
    
    ans = max(ans, val)

print(ans)

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

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

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


if __name__ == '__main__':
    main()

Solution (Python):
import math

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

x = (n//b)*b-1
if(x<=0):
  x=n
t= (a*x)//b - a*(x//b)

print(t)

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

Solution (Python):





import sys,os
from io import BytesIO, IOBase
import collections,itertools,bisect,heapq,math,string


BUFSIZE = 8192

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = 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(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")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

def main():
    abn=list(map(int,input().split()))
    a,b,n=abn[0],abn[1],abn[2]
    
    mn=min(b-1,n)
    print (a*mn//b-a*(mn//b))
if __name__ == "__main__":
    main()

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


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


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

Solution (Python):

import sys


def solve(A: int, B: int, N: int):
    
    
    
    r = B-1 if B < N else N - 1 if B == N else N
    ans = (r * A) // B
    print(ans)
    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):
def f(x):
	return ((A*x)//B)-(A*(x//B))

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

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

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

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

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

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

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

Solution (Python):
import math

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

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

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

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

def solve(i):
  return A * i // B - A * (i // B)

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

Solution (Python):
A, B, N =map(int, input().split())
"""直感的にはAxがちょうどBの倍数になった時　or　超えた時が大きくなりそう？それだけで探索する
ほとんどは同じ値になる A,Bの値が小さくNがでかい時、死ぬ
xの増加による挙動は 4パターンしかない
不等式から最大値は高々Aであるとわかる　それで探索する？"""
"""解説：
f (x) = f loor(Ax/B) − A × f loor(x/B) とします。
f(x + B) = f(x) であることは実際に代入することで容易に分かります。なので、0 ≤ x ≤ B − 1 の場合のみを考えます。
このとき、f (x) = f loor(Ax/B) − A × f loor(x/B) = f loor(Ax/B) で、f loor(Ax/B) は広義単 調増加なので、与えられた制約 (0 ≤ x ≤ B − 1, 0 ≤ x ≤ N) の中で最も大きい x について、f(x) が求める最大値です。
よって、答えは f (min(B − 1, N )) です。
単純に数学的事実を使うだけの問題"""

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

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

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

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

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

Solution (Python):
'''
参考
https://drken1215.hatenablog.com/entry/2020/05/02/225600

int(A*x/B) - A * int(x/B) の値は、Bごとに周期的になる
よって、x = 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))

Solution (Python):
import math
A, B, N = list(map(int, input().split()))
ans = 0
if B+1 < N:
    C = B+1
else:
    C = N
if B//A == 0:
    D = 1
elif B//A > 1:
  	D = B//A-1
else:
    D = B//A
for i in range(1, C+1, D):
    val = math.floor(A*i/B) - A*math.floor(i/B)
    
    ans = max(ans, val)

print(ans)

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

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

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

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


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

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

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

Solution (Python):


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

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

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

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1
def II(): return int(input())

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

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

INF = float('inf')

from math import floor

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

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


if __name__ == '__main__':
    solve()

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

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

ans_N = (A * N) // B - A * (N // B)

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

print(max(ans_N, ans_X))

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

tmp = min(B-1,N)

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

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

Solution (Python):
from __future__ import print_function

import sys
sys.setrecursionlimit(500000)

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


















def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


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


if __name__ == '__main__':
    main()

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

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

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

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

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

print(ans)

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

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

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


print(ans)

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

Solution (Python):
import math

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

Solution (Python):
A,B,N=map(int,input().split())
if N>=B:
    print(int(A*(B-1)/B))
else:
    print(int(A*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):
from math import floor

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

x = min(B - 1, N)

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

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

Solution (Python):
"""
 floor(a/b) 
=(a-a%b)/b
上を利用して与えられた式を変形すると
max (A(x%B)-(Ax%B)) / B
ここで
Ax%B = A(x%B)%B
つまり、AxをBで割った余りは、xをBで割った余りにAをかけたものを、Bで割った余り
を利用すると
max (A(x%B)-A(x%B)%B) / B
つまりA(x%B)、さらに言えばx%Bを最大化すれば良い

x%Bを最大化するには
N>=B-1 のときは　x=B-1
N<B-1　のときは x=N
"""

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
A,B,N = [int(i) for i in readline().split()]

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

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

print(ans)

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

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

ans =0


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

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

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

Solution (Python):



import sys
input = sys.stdin.readline

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



if __name__ == '__main__':
    main()

Solution (Python):
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:(input())

"""========main code==============="""

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

Solution (Python):
from sys import setrecursionlimit, exit
setrecursionlimit(1000000000)

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

main()

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


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

if n >= b:
	n = b - 1

print((a*n)//b)

Solution (Python):
import math

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

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

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

Solution (Python):

"""
Created on Sun May  3 11:14:35 2020

@author: ab
"""
import math
import sys
input = sys.stdin
output = sys.stdout
while True:
    lineElements = input.readline().rstrip("/n").split(" ")
    if(lineElements[0] == ''):
        break;
    a,b,n = lineElements
    a,b,n = int(a),int(b),int(n)
    if n==1:
        x = 0
    elif n<b-1:
        x = n
    else:
        x = b-1
    result = math.floor((a*x)/b)-a*math.floor(x/b)
    print(str(result)+'\n')

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

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

Solution (Python):
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
from operator import mul
import bisect
import sys
import logging
import heapq
import itertools

logging.basicConfig(level=logging.ERROR)



setrecursionlimit(1000000)


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

main()

Solution (Python):
from math import floor

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

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

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

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

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

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

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

Solution (Python):
from math import floor


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


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

print(func(A, B, min(B - 1, N)))

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

Solution (Python):


import math

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

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

print(ans)

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

Solution (Python):







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

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

Solution (Python):
a=input().split()
A=int(a[0])
B=int(a[1])
N=int(a[2])
if N>=B-1 :
  print(int(A*(B-1)/B))
else :
  print(int(A*N/B))

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

from math import gcd, floor

g = A * B // gcd(A, B)
if N >= g:
    N = g

if N < B:
    n = N
else:
    n = N // B * B - 1

result = floor(A * n / B) - A * floor(n / B)

print(result)

Solution (Python):
import sys
a, b, n, = map(int, input().split())
if n < b:
    print(int(a*(n)/b)-a*int((n)/b))
    sys.exit(0)
max = 0
if b == 1:
    print(0)
    sys.exit(0)
row, up = n-b, n
while row <= up:
    mid = (row+up)//2
    if n//b == mid//b:
        up = mid-1
    elif n//b > mid//b:
        row = mid+1
if int((a*up)/b)-a*int((up)/b) > int((a*n)/b)-a*int((n)/b):
    print(int((a*up)/b)-a*int((up)/b))
else:
    print(int((a*n)/b)-a*int((n)/b))

Solution (Python):
import math

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

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

print(m)

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

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

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

Solution (Python):

import sys
 
 
def solve(A: int, B: int, N: int):
    x = min(B - 1, N)
    print(A * 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())

from math import floor

x = min(b-1, n)

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

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

Solution (Python):
import math

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

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

print(ans)

Solution (Python):



def main():
    from math import floor
    import sys
    input = sys.stdin.readline

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

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


if __name__ == '__main__':
    main()

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

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

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

def f(n):
    d = int(A*n/B) - A*int(n/B)
    return d

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

Solution (Python):
import numpy as np
def main():
    A, B, N = map(int, input().split())
    max_value = 0
    x = np.min([B-1, N])
    max_value = int(np.floor(A*x/B))
    print(max_value)
    
if __name__ == '__main__':
    main()

Solution (Python):
N = [int(e) for e in input().split()]
t = N[1] - 1
if(t > N[2]):
    t = N[2]
ans = (N[0]*t)//N[1] - N[0]*(t//N[1])
print(ans)

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

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

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

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

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

Solution (Python):

import sys
import itertools
import fractions
import copy
import bisect
import math
import numpy as np



from operator import itemgetter
from sys import stdin

from operator import mul
from functools import reduce
from collections import Counter





j=0
k=0
n=3
r=1
a=[0]*5
b=[]






"1行1つの整数を入力を取得し、整数と取得する"




"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

for i in number_list:
    print(number_list[i-1])

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''



"正方行列にstr型の値を入力"
'''




'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"


'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''











'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''




"aという変数に入っているものを大文字にして出力"















'''
コンビネーションの組み合わせの中身を出力する形式
for i in itertools.combinations(brray, 2)
combinationsをpermutationsにすれば順列になる
今回なら(abc133B)
入力
1 2
5 5
-2 8
出力
[[1, 2], [5, 5], [-2, 8]]
もちろん一次元リストでも使えるし
何よりiもリストのように使えるので便利
'''


'''
def cmb(n,r):
    
    r= min(n-r,r)
    
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    
    
    

    under = reduce(mul, range(1, r+1))
    
    
    
    

    return over // under
    
    
    
    
a = cmb(n, r)

'''

'''




for i in a.most_common(n):print(i)





 


'''









'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''















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

'''
脳筋ゴリ押し蛮族中尾君に下る数学の鉄槌

f(x) = floor(Ax/B) − A × floor(x/B) とします。
f(x + B) = f(x) であることは実際に代入することで容易に分かります。なので、0 ≤ x ≤ B − 1
の場合のみを考えます。
このとき、f(x) = floor(Ax/B) − A × floor(x/B) = floor(Ax/B) で、floor(Ax/B) は広義単
調増加なので、与えられた制約 (0 ≤ x ≤ B − 1, 0 ≤ x ≤ N) の中で最も大きい x について、f(x)
が求める最大値です。
よって、答えは f(min(B − 1, N)) です
'''

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


if __name__ == "__main__":
    main()

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

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

Solution (Python):
import math

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

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

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

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

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):
import math

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

ans = 0

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

print(ans)

Solution (Python):
import math

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

ans_x = min(N, B - 1)
ans = math.floor(A * ans_x / B) - A * math.floor(ans_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):
import math
A, B, N = map(int, input().split())
def kansu(x):
  S = math.floor(A*x/B)
  return S
print(min(kansu(N), kansu(B-1)))

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

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

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


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

Solution (Python):
import math

if __name__ == '__main__':
    def solve(a, b, x):
        return math.floor(a * x / b) - a * math.floor(x / b)


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

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

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

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

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

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

Solution (Python):
import math
A, B, N = list(map(int, input().split()))
if B-1 >= N:
  num = N
else:
  num = B-1
  
print(math.floor(A*num/B)-A*math.floor(num/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) - a*math.floor((b-1)/b))

Solution (Python):

import math

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


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

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

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

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

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

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

def f(a, b, n):
    fl1 = (a * n) // b
    fl2 = n // b
    fl = fl1 - (a * fl2)
    return fl
   

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

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

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

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

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

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

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

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

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

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

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

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

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

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

if n >= b-1:
    ans = floor(b-1)
else:
    ans = floor(n)

print(ans)

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):
import sys
import math

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


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


A, B, N = map(int, input().split())
x = N
if N >= B - 1:
    x = B - 1
print(f(A, B, x))

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

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


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


print(func(min(N, B-1), A, B))

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

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