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 bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub


input = sys.stdin.buffer.readline
INF = 2**62-1

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


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(A, B, N):
    x = min(B - 1, N)
    ans = A*x//B - A*(x//B)
    return ans


def main():
    A, B, N = read_int_n()
    print(slv(A, B, N))


if __name__ == '__main__':
    main()

Solution (Python):
import math

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

def a():
    global A,B,N,x
    print(math.floor(A*x/B)-A*math.floor(x/B))

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

Solution (Python):

"""
Created on Sat May  2 20:59:19 2020
"""

import sys


sys.setrecursionlimit(10 ** 9)


mod = 10**9+7


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

Solution (Python):






import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache

import heapq






MOD = 10**9+7
INF = float('inf')






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


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(a, b):
    return a * b // gcd (a, b)





A,B,N = inputIL()

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

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

Solution (Python):
import sys
import math
import collections
from collections import deque
from functools import reduce
import heapq

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



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

    
if b > n:
    print(calc(n))
else:
    print(calc(b-1))

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

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

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


	

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

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

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

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

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

if n >= b-1 != 0:
    ans = int((a*(b-1))/b)
else:
    ans = int((a*n/b))

if b == 1:
    ans = 0

print(ans)

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

import math

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

Solution (Python):
from sys import stdin
def main():
    
    readline=stdin.readline
    A,B,N=map(int,readline().split())

    if N>=B:
        x=B-1
        print(A*x//B)
    else:
        x=N
        print(A*x//B)
if __name__=="__main__":
    main()

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

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

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

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

print(ans)

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

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

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

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

Solution (Python):
"""n,m,q = (int(i) for i in input().split())
a = []
ans = 0

for i in range(q):
	a.append(list(map(int,input().split())))

for i in range(q):
	if
		ans+=a[i][3]

print(ans)
"""

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

Solution (Python):

import sys
input = sys.stdin.readline

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

Solution (Python):

import sys
import math

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

if __name__ == '__main__':
    main()

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,N = map(int,(input().split()))
if B-1 <= N:
    print(A*(B-1)//B)
else:
    print(A*(N%B)//B)

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

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

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

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

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

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

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

Solution (Python):
import bisect
import collections
import sys

sys.setrecursionlimit(100000)
input = sys.stdin.readline
ACMOD = 1000000007
INF = 1 << 62


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


def llmi(n):
    return [lmi() for _ in range(n)]


A, B, N = lmi()









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

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

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

Solution (Python):

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

t = A // B
p = A % B

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

print (t*q + p*q//B)

Solution (Python):


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

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

ans = int(a*c/b)
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

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

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

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

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())
print((min(B-1,N)*A)//B)

Solution (Python):
from math import floor
import sys
input = sys.stdin.readline
A,B,N=(int(x) for x in input().rstrip('\n').split())
if N < B:
  print(floor(A*N/B))
else:
  print(floor(A*(B-1)/B))

Solution (Python):
from collections import defaultdict,deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp():
    '''
    一つの整数
    '''
    return int(input())
def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


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

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

if n < b:
  x = n
  print(int(a*x/b) - a * int(x/b))
  exit()
elif n >= b:
  x = b-1
  print(int(a*x/b) - a * int(x/b))
  exit()

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,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 operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]




a,b,n=mii()

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

Solution (Python):


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

if n >= b:
    n = b - 1

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

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

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

print(ret)

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):
a,b,n = (int(i) for i in input().split())
ans = 0
if n >= b:
  ans = a*(b-1)//b
else:
  ans = a*(n)//b
print(ans)

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    a, b, n = list(map(int, readline().split()))

    x = min(b - 1, n)

    ans = int(a*x/b)

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import sys

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 LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

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

    a,b,n=MI()
    x=min(b-1,n)
    print(f(a,b,x))

main()

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

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

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

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

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

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

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

Solution (Python):
inf = 10**15
mod = 10**9+7
a,b,n = map(int, input().split())
x = 0
if n >= b:
    x = b-1
else:
    x = n
print((x*a)//b)

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

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

print(int(func(a,b,x)))

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

Solution (Python):
import math

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

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

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

print(max)
"""

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

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

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

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

def main():
    mod=10**9+7
    a,b,n=MI()
    x=min(n,b-1)
    if b==1:
        x=1
    print((a*x)//b - a*(x//b))

main()

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

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

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

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

Solution (Python):

from math import *

mod = (10**9) + 7


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


if __name__ == "__main__":
    a, b, n = _in()
    x = b - 1
    if(n < b):
        x = n
    ans = ((a * x) // b) - (a * (x // b))
    print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10000000)
import math


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



if __name__ == '__main__':
    main()

Solution (Python):
import sys


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


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


if __name__ == "__main__":
    main()

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

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

Solution (Python):

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

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


main()

Solution (Python):
from math import floor

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

Solution (Python):
from math import floor as f

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

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())
A = []




x = 0
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())

x=min(N,B-1)

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

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

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

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

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())
def calc(a, b, n):
    x = min(b-1, n)
    return a * x // b - a * (x // b)
print(calc(A, B, N))

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())
if N >= B:
    print(int(A * (B-1)/B))
else:
    print(int(A * N / B))

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]





A, B, N = mi()

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

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

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

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

Solution (Python):
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

a,b,n = mi()
if n >= (b-1):
    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:
    print((A*(B-1))//B)
else:
    print((A*N)//B)

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

if B == 1:
  ans = 0
  print(ans)
  quit()

x = min(N, B - 1)

ans = (A * x / B) // 1 + A * ((x / B) // 1)

print(int(ans))

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

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

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

Solution (Python):
import sys
input=lambda: sys.stdin.readline().rstrip()
a,b,n=map(int,input().split())
print((a*min(b-1,n)//b))

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

s = min(N,B-1)

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

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

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

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

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

A, B, N = list(map(int, input().split()))
if B == N:
  print(nasu(A, B, N - 1))
elif B > N:
  print(nasu(A, B, N))
else:
  print(nasu(A, B, B - 1))

Solution (Python):
s=list(map(int,input().split()))
a=s[2]%s[1]
d=s[2]//s[1]
if a==s[1]-1:
  b=int((s[0]*a)//s[1])
  c=int(a//s[1])*s[0]
  print(b-c)
else:
  if d==0:
    b=int((s[0]*a)//s[1])
    c=int(a//s[1])*s[0]
    print(b-c)
  else:
    a=s[2]-a-1
    b=int((s[0]*a)//s[1])
    c=int(a//s[1])*s[0]
    print(b-c)

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

X = min(B-1,N)

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

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


def solve(n):
    return (a*n)//b - a*(n//b)


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

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

Solution (Python):
from math import gcd

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

yes = "Yes"
no = "No"

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



main()

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

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

Solution (Python):
import math





def main():
    print(solve())


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

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

    return v


if __name__ == "__main__":
    main()

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

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

Solution (Python):
import math

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

if n >= b-1:
    print(math.floor(a*(b-1)/b))
else:
    print(math.floor(a*n/b) - a*math.floor(n/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 = list(map(int,input().split()))
if b<=n:
    print(int(a*(b-1)/b))
else:
    print(int(a*n/b))

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

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

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

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

print(A*x//B)

Solution (Python):
A, B, N = map(int, input().split())
alpha = A // B
beta = A % B
q = min(N, B - 1)

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

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

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

x = 0

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

ans = (a * x) // b

print(ans)

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

Solution (Python):
def F(A, B, X):
    p = (A * X) // B
    q = A * (X // B)
    return p - q


if __name__ == "__main__":
    A, B, N = map(int, input().split())
    
    if N >= B - 1:
        ans = F(A, B, B - 1)
    else:
        ans = F(A, B, N)
    print(ans)

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

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

Solution (Python):
import sys

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

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

Solution (Python):
import math

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

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

Solution (Python):
import random
import math
LI = lambda: list(map(int,input().split()))
MI = lambda: map(int,input().split())
yes = lambda: print("Yes")
no = lambda: print("No")
I = lambda: list(input())
J = lambda x: "".join(x)
II = lambda: int(input())
SI = lambda: input()

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

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

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

a,b,n = inpl()
x = min(b-1,n)
print(int((a*x)/b) - a*int(x/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,c=map(float,input().split())
x=min(b-1,c)
import math
print(int(math.floor(a*x/b)-a*math.floor(x/b)))

Solution (Python):

import os
import sys
from io import BytesIO, IOBase


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



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


if __name__ == "__main__":
    main()

Solution (Python):
a,b,n=map(int,input().split())
ans=a*n//b-a*(n//b)
if b>=10**6:
    if n>=b-1:
        ans=max(ans,a*(b-1)//b)
else:
    for i in range(1,min(b,n)+1):
        ans=max(ans,a*i//b-a*(i//b))
print(ans)

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

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

print(ans)

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

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

if B > N:
    tmp = N / B
else:
    tmp = (B - 1) / B

ans = tmp * A
print(int(ans))

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

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

Solution (Python):
FAST_IO = 0
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()
    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())



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

def solve(A, B, N):
    
    
    q,r = divmod(N, B)
    ans = 0
    if q:
        ans = max(ans, f(q*B-1, A,B))
    ans = max(ans, f(N, A, B))
    return ans

def brute(A, B, N):
    ans = -1e9
    for x in range(0, N+1):
        ans = max(ans, f(x, A, B))
    return ans


    
print solve(*rrm())

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

Solution (Python):


import sys
sys.setrecursionlimit(300000)


def solve(A: int, B: int, N: int):
    if N < B:
        ret = A * N // B - A * (N // B)
    else:
        a = A * (B - 1) // B
        m = (N // B) * B - 1
        b = A * m // B - A * (m // B)
        c = A * N // B - A * (N // B)
        ret = max(a, b, c)
    print(ret)
    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 - 1:
    N = B - 1
print((A * N) // B - (N // B) * A)

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

Solution (Python):
def main():
    a,b,n = tuple([int(t)for t in input().split()])
    
    if b-1<=n:
        ans = (a*(b-1))//b
        print(ans)
    else:
        ans = (a*n)//b
        print(ans)

if __name__ == "__main__":
    main()

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

    x = (n - (b - 2) + (b - 1)) // b
    y = max(0, b * x - 1)
    ans = max((a * y) // b - a * (y // b), (a * n) // b - a * (n // b))

    print(ans)

if __name__ == '__main__':
    main()

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

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

Solution (Python):
line = [int(x) for x in input().split()]

a = line[0]
b = line[1]
c = line[2]

x = min([c, b-1])

import math

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

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