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):
if __name__ == '__main__':
    A, B, N = map(int, input().split())
    C = B - 1
    D = min(C, N)
    print((A*D) // B)

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

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

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

Solution (Python):
from math import floor
A, B, N = list(map(int, input().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))

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

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

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()

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

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

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

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

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

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

num = min(b-1,n)

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

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

Solution (Python):
import math

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


if __name__ == '__main__':
    main()

Solution (Python):
import math

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

n = min(N, B-1)

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

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

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

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

Solution (Python):

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

if __name__ == "__main__":
    main()

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


if __name__ == '__main__':
    main()

Solution (Python):
import math

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

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

x = min(n, b-1)

print(f(x, a, b))

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

x = min(N, B-1)

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

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

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

Solution (Python):
import math

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

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

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

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

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

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

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

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


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

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

    print(f(a, b, x))


if __name__ == "__main__":
    main()

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

Solution (Python):
def inN():
    return int(input())
def inL():
    return list(map(int,input().split()))
def inNL(n):
    return [list(map(int,input().split())) for i in range(n)]

a,b,n = inL()

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

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

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

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

x=min(n,b-1)

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

print(ans)

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 n < b:
  ans = (a*n)//b - a*(n//b)
else:
  m = b-1
  ans = (a*m)//b - a*(m//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,N=map(int,input().split())

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

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

Solution (Python):

import sys
from itertools import chain










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

    return (A * x2) // B


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


if __name__ == "__main__":
    main()

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

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

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

	return n[head_zeros:]



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



def bigint_plus(a, b):
	a = str(a)
	b = str(b)

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

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

	return ans



def bigint_minus(a, b): 
	a = str(a)
	b = str(b)
	M = []
	m = []
	sign = ""

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

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

	return sign + delete_head_zeros(ans)



def bigint_multiply(a, b):
	a = str(a)
	b = str(b)

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

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

	return ans




def bigint_divide(a, b, d = 0):
	a = str(a)
	b = str(b)
	d = int(d)
	if d < 0:
		d = 0

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

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

	return delete_head_zeros(ans)

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

main()

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

x = min(b-1, n)

print((a*x)//b)

Solution (Python):
import sys
import itertools
import math

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

i = min(B-1,N)


print(math.floor(A*i/B) - A * math.floor(i/B))

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

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

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

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

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

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

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

print(ans)

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

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

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

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

print(ans)

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

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

Solution (Python):
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy


import heapq
sys.setrecursionlimit(10**6)

INF = 10**18
import bisect
import statistics
mod = 10**9+7


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

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

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

x = min(B - 1, N)

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

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

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

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

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

import math

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

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

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

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

print(ans)

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

Solution (Python):
import math


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


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


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

Solution (Python):
'''
Created on 2020/08/29

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

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

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


if '__main__' == __name__:
    resolve()

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

abc165d_floor_function()

Solution (Python):

import math
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")

A,B,N = LI()








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

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

Q = A // B
R = A % B

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

print(ans)

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate, product 

from collections import deque,defaultdict,Counter
import decimal
import re
import math















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


from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
  return int(readline())
a,b,n = readInts()
th = b-1
if n >= th:
    print(int(math.floor(a*th/b) - a * math.floor(th/b)))
else:
    print(int(math.floor(a*n/b) - a * math.floor(n/b)))

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

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

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

else:
  x=decimal.Decimal(a*n/b)
  c=math.floor(x)
  print(c)

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

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

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

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

main()

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

    
 
if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):

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




if __name__ == "__main__":
    main()

Solution (Python):
import math

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

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

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

print(ans)

Solution (Python):









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





















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

print(int(A*x/B))

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

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

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

if __name__ == '__main__':
    main()

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

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    A,B,N=mi()

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

if __name__ == "__main__":
    main()

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

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

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

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

print(ans)

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

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

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

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


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

print(result)

Solution (Python):
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
sys.setrecursionlimit(500*500)
import itertools
from collections import Counter,deque

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

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

if __name__=="__main__":
    main()

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

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

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

Solution (Python):
a, b, n = map(int, input().split())
print(a * ((b - 1, n)[n <= b - 1] % b) // 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):
A, B, N = map(int, input().split())


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

Solution (Python):










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

if b>n:
    x=n
    ans=(a*x)//b -a*(x//b)

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

print(ans)

Solution (Python):

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

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

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

print(max_L)

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

Solution (Python):
def solve():
    A,B,N = [int(i) for i in input().split()]
    x = min(B-1,N)
    print(int(A*x/B)-A*int(x/B))

if __name__ == "__main__":
    solve()

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

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

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

Solution (Python):
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

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

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

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

print(calc)

Solution (Python):
import math

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

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

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

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

print(int(ans))

Solution (Python):
a,b,n = map(int,input().split())
if b-1 <= n:
    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())

c = min(b - 1, n)

print(int(((a * c) / b) // 1 - (a * ((c / b) // 1))))

Solution (Python):
import math

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

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

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

print(ans)

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

Solution (Python):

def main():
    import sys

    input = sys.stdin.readline

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

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


if __name__ == '__main__':
    main()

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

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from math import floor
def main():
    a, b, n = map(int, input().split())
    if n < b:
        x = n
    else:
        x = b - 1
    r = floor(a * x / b) - a * floor(x / b)
    print(r)

if __name__ == '__main__':
    main()

Solution (Python):

def main():
    import sys

    input = sys.stdin.readline

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

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


if __name__ == '__main__':
    main()

Solution (Python):
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)
ans=int(x*A/B)-int(x/B)
print(ans)

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

def Calcf(i):
  return math.floor((a * i) / b) - a * math.floor(i / b)
    
print (Calcf(min(b - 1, n)))

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

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

Solution (Python):

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

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

Solution (Python):
import math
import sys
import collections
import bisect


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


if __name__ == '__main__':
    main()

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

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

term1 = (a * x) // b
term2 = a * (x // b)

print(term1 - term2)

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

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

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

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

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

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

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

Solution (Python):
from math import floor

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

a, b, n = (int(x) for x in input().split())
if n < b:
    print(f(n))
else:
    print(f(b - 1))

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

Solution (Python):

import collections as cl
import sys


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

    print(ans)


main()

Solution (Python):
A, B, N = map(int, input().split())
Ans = []
X = B * (N // B)
if X != 0:
    ans_1 = (A * (X - 1) // B) - A * ((X - 1) // B)
else:
    ans_1 = 0
ans_2 = (A * N // B) - A * (N // B)
Ans.append(ans_1)
Ans.append(ans_2)

print(max(Ans))

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

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

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

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

print((a*x)//b)

Solution (Python):
from math import floor

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

max_v = 0
if n < b:
  max_v = floor(a * n / b)
else:
  if b != 1:
    for i in range(b - 1, n + 1, b):
      j = 0
      t = floor(a * i / b) - a * j
      if t > max_v:
        max_v = t
      j += 1
print(max_v)

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

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

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

Solution (Python):
import math

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

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

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

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

Solution (Python):
import math

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

result=-1

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

Solution (Python):
import math
A,B,N=map(int,input().split())
han=0
kot=0
i=0
if B==1:
    print(0)
    exit()
if B-1>=N:
    print(math.floor(A*N/B)-A*math.floor(N/B))
    i=1
else:
    for a in range(B-1,N,B):
        if han<(math.floor(A*a/B)-A*math.floor(a/B)):
            han=(math.floor(A*a/B)-A*math.floor(a/B))
            kot=a

if i==0:
    print(han)

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

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

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

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

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

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

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


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

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


if(__name__ == '__main__'):
  main()

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

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

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

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

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

def resolve(in_):
    a, b, n = map(int, next(in_).split())
    x = min(b - 1, n)
    return math.floor(a * x / b) - a * math.floor(x / b)


def main():
    answer = resolve(sys.stdin.buffer)
    print(answer)


if __name__ == '__main__':
    main()

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

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

ans_1 = (A*x)//B
ans_2 = A*(x//B)

ans=ans_1-ans_2
print(ans)

Solution (Python):
import sys
import math
from collections import defaultdict,deque
from itertools import permutations
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()
sys.setrecursionlimit(10**6)
"""========main code==============="""

t=1
for _ in range(t):
    a,b,c=ml()
    d=(c+1)//b
    d*=b
    if(d!=0):
        d-=1
    else: d=c    
    print((a*d)//b-a*(d//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())

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

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

print(ans)

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

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

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

print(ans)

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

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

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

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

print(f)

Solution (Python):
import math

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

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