Problem:
 Score : 400 points    Problem Statement Given are integers A , B , and N .  Find the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N .  Here floor(t) denotes the greatest integer not greater than the real number t .      Constraints  1 ≤ A ≤ 10^{6}  1 ≤ B ≤ 10^{12}  1 ≤ N ≤ 10^{12}  All values in input are integers.         Input Input is given from Standard Input in the following format:  A  B  N       Output Print the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N , as an integer.        Sample Input 1 5 7 4      Sample Output 1 2  When x=3 , floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2 . This is the maximum value possible.       Sample Input 2 11 10 9      Sample Output 2 9

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


ans = (a*n)//b-a*(n//b)
if n >= 1:
    ans2 = (a*(n-1))//b - a*((n-1)//b)
else:
    ans2 = 0
if n >= 2:
    ans3 = (a*(n-2))//b - a*((n-2)//b)
else:
    ans3 = 0
if n >= 3:
    ans4 = (a*(n-3))//b - a*((n-3)//b)
else:
    ans4 = 0

if b <= n:
    ans5 = (a*(b-1))//b - a*((b-1)//b)
else:
    ans5 = 0
print(max(ans,ans2,ans3,ans4,ans5))

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

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

Solution (Python):
import math

a,b,n=map(int,input().split(' '))
ans=0
x=min(n,b-1)
q=math.trunc(a*x/b)-a*math.trunc(x/b)
if ans<q:
    ans=q
print(int(ans))

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

if n >= b:
    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())

def f(t):
    return int(A*t)-A*int(t)

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

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

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

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

Solution (Python):
import math
a,b,c = map(int,input().split())
maxcnt = -99999
if c <= b-1:
	x = c
	cnt = (a*x)//b - a*(x//b)
	if cnt > maxcnt:
		maxcnt = cnt
else:
	x = b-1
	maxcnt = math.floor(a*x/b) - a* math.floor(x/b)
print(maxcnt)

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

ans = 0
for i in range(1, a+1):
    x = math.ceil(i*b/a)-1
    if x <= n:
        diff = math.floor(a*x/b) - a*math.floor(x/b)
        ans = max(ans, diff)
    elif n < x:
        diff = math.floor(a*n/b) - a*math.floor(n/b)
        ans = max(ans, diff)
        break
print(ans)

Solution (Python):
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))



A,B,N = LI()

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

d,m = divmod(N+1,B)
x1 = max(d*B-1,0)
x2 = N

print(max(calc(x1),calc(x2)))

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

def calc(a, b, x):
    
    return math.floor(a*x/b) - a * math.floor(x/b)
    
ans = 0
max_x = b
if b > n:
    max_x = n
for x in range(1, max_x+1)[::-1]:
    r = calc(a, b, x)
    if r > ans:
        ans = r
        break

print(ans)

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






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

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

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

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

Solution (Python):
from math import ceil,floor

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

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

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

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

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

t1 = f(a, b, n)
t2 = f(a, b, max(1, n - n%b - 1))
t = max(t1, t2)

print(t)

Solution (Python):
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import permutations,combinations
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right
from math import gcd,ceil,floor,factorial

from functools import reduce
from pprint import pprint

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

def mylistinput(n):
    return [ list(myinput()) for _ in range(n) ]

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

a,b,n = myinput()

if b==1:
    print(0)
    exit()
    
def mycalc(a,b,x):
    return floor((a*x)/b) - a*floor(x/b)

if n<b:
    ans = mycalc(a,b,n)
else:
    ans = mycalc(a,b,b-1)

print(ans)

Solution (Python):

import sys


def solve(A: int, B: int, N: int):

    if N >= B-1:
        x = B-1
        print(A*x//B-A*(x//B))
        return
    else:
        x = N
        print(A*x//B-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())
if B == 1:
    print(0)
else:
    ans = (A * N) // B - A * (N // B)
    for a in range(A):
        x = B * a + (B - 1)
        if x > N:
            break
        test = (A * x) // B - A * (x // B)
        ans = max(ans, (A * x) // B - A * (x // B))
    print(ans)

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

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

Solution (Python):
import math
A,B,N= map(int,input().split())
x=[]
AB=A/B
if B==1:
    print("0")
elif N<B:
    
    print(math.floor(AB*N))
else:
    x=[math.floor(AB*N)-A*(N//B)]
    for i in range(N//B):
        x.append(math.floor(AB*((i+1)*B-1))-i)
    print(max(x))

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

ans = 0
if b > n:
    x = n
    ans = int(a * x // b) - int(a * (x // b))
else:
    x = n
    ans1 = int(a * x // b) - int(a * (x // b))
    x = (n//b)*b-1
    ans2 = int(a * x // b) - int(a * (x // b))
    ans = max(ans1,ans2)
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 n < b-1:
  ans = (a * n) // b
else:
  ans = (a * (b-1)) // b
  
print(ans)

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

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

answer = 0
temp = 0

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

else:
    answer = A*N //B - A * (N//B)

print(answer)

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

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

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

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

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

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


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

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

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

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

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

if A % B == 0:
    print(0)

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

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

def tgt(A,B,d):
    return math.floor(A * d / B)

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

ret = tgt(A,B,d_max)

print(ret)

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

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

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

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

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

Solution (Python):

    
a,b,n = [int(s) for s in 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)

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

print(f(x))

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

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

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

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

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

left = -1
right = N
def check(x):
    global A, B
    return math.floor(A * x / B) - A * math.floor(x / B)

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

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






if a <= b:
    if n >= b - 1: print(a - 1)
    else:
        x = n - 1
        t1 = (a * x) // b
        t2 = a * (x // b)
        print(t1 - t2)
else:
    ans = -1
    for x in range(min(n + 1, a + 1)):
        t1 = (a * x) // b
        t2 = a * (x // b)
        ans = max(ans, t1 - t2)
    print(ans)

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

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

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

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

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

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

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 sys
import math
import fractions
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(10**7)

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







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

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





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

ans1 = (A*x) // B    
ans2 = A*((x) // B)

ans = ans1 - ans2    



print(ans)

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



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

Solution (Python):
s = list(map(int, input().split()))
a = s[0]
b = s[1]
n = s[2]

if n >= b:
    n = b - 1

kotae = round(a * ((n / b) - (n // b)) - ((a * n / b) - ((a * n) // b)))

print(kotae)

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

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

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

Solution (Python):

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

    print(ans)

main()

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

if B > N:
    tmp = N

else:
    tmp = B -1

ans = int(A * tmp / B) - A * int(tmp/B)

print(ans)

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

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

Solution (Python):

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

min_x = 1
max_x = N

def f(x):
    y = (A*x)//B - A*(x//B)
    return y
    
ans=f(min(B-1,N))
print(ans)

Solution (Python):















mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

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

def main():
    a,b,n = readInt()
    x = min(b-1,n)
    ans = a * x // b - a * (x // b)
    print(ans)
    return

if __name__=='__main__':
    main()

Solution (Python):


iim = lambda: map(int, input().rstrip().split())

def resolve():
    A, B, N = iim()

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

if __name__ == "__main__":
    resolve()

Solution (Python):
import sys
from random import choice,randint
inp=sys.stdin.readline
out=sys.stdout.write
flsh=sys.stdout.flush
 
sys.setrecursionlimit(10**9)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
 
def MI(): return map(int, inp().strip().split())
def LI(): return list(map(int, inp().strip().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]
def LI_(): return [int(x)-1 for x in inp().strip().split()]
def LF(): return [float(x) for x in inp().strip().split()]
def LS(): return inp().strip().split()
def I(): return int(inp().strip())
def F(): return float(inp().strip())
def S(): return inp().strip()
def pf(s): return out(s+'\n')
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)

def main():
    from math import floor
    a,b,n=MI()
    if b>n:
        ans = floor((a*n)/b)
        print(ans)
    else:
        ans = floor((a*(b-1)/b))
        print(ans)
        
        
        

if __name__ == "__main__":
    main()

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

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

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

print(ans)

Solution (Python):
import math
import sys
sys.setrecursionlimit(10**9)
A,B,N= map(int,input().split())


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


ans = (A*x)//B

print(ans)

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

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

Solution (Python):
from math import floor

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

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

result = 0
for x in range(min(A + 1, N + 1)):
    result = max(result, f(x))

if B > A:
    for i in range(10 ** 20):
        x = (i * B + A - 1) // A
        if x > N:
            break
        result = max(result, f(x))

print(result)

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

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

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

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

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

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


if __name__ == '__main__':
    main()

Solution (Python):

import math

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

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

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

if __name__ == '__main__':
    main()

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

x = min(N,B-1)

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

print(ans)

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

if N // B == 0:
    f, _ = math.modf(N / B)
    ans = math.floor(A * f)
else:
    n = (N // B) * B - 1
    f1, _ = math.modf(n / B)
    f2, _ = math.modf(N / B)
    f = max(f1, f2)
    ans = math.floor(A * f)

print(ans)

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





res = (A*N // B) - A * (N // B)
if N >= B:
    t = N // B * B - 1
    tmp = (A*t // B) - A * (t // B)
    res = max(res, tmp)
print(res)

Solution (Python):
import math
a,b,n=map(int, input().split())
x=n%b
if n==0:
    print(0)
else:
    if x==0 or n>=b:
        x=b-1
    num1=math.floor((a*x)/b)
    num2=a*math.floor(x/b)
    print(num1-num2)

Solution (Python):
import math

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

result = -1

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

x = min([n, b - 1])
result = f(a, b, x)
print(result)

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

possible_num = B-1

if possible_num > N:
    possible_num = N
possible_ans = (A*possible_num)//B - A * (possible_num//B)

print(possible_ans)

Solution (Python):

import sys

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip() 


def floor(a,b):
    return int(a//b)


def main():
    a,b,n = na()
    if n >= b-1:
        x = b-1
    else:
        x = n
    print(floor(a*x,b) - a*floor(x,b))
    return


if __name__ == '__main__':
    main()

Solution (Python):
import sys;input=lambda:sys.stdin.readline().rstrip();aint=lambda:int(input());ints=lambda:list(map(int,input().split()))
import math;floor,ceil=lambda x:int(math.floor(x)),lambda x:int(math.ceil(x))

def main():
  a,b,n=ints()
  flr=lambda a,b,x:floor(a*x/b)-a*floor(x/b)
  if n>=b:
    print(flr(a,b,b-1))
  else:
    print(flr(a,b,n))

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 = (int(val) for val in input().split(' '))

x = b-1 if b-1 < n else 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):
import math
A, B, N = map(int,input().split())

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

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

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

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

Solution (Python):
from math import floor

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

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

    print(floor(a*x/b))

if __name__ == '__main__':
    main()

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

Solution (Python):

from collections import deque, defaultdict
from itertools import combinations, combinations_with_replacement
import bisect
from math import factorial, sqrt, log, ceil, floor

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

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys;input=lambda:sys.stdin.readline().rstrip();aint=lambda:int(input());ints=lambda:list(map(int,input().split()))
import math;floor,ceil=lambda x:int(math.floor(x)),lambda x:int(math.ceil(x))
from functools import reduce;gcd=lambda*x:reduce(math.gcd,x);lcm=lambda*x:reduce(lambda x,y:(x*y)//gcd(x,y),x,1)
from collections import deque
Yes=lambda b:print("Yes"if b else"No");YES=lambda b:print("YES"if b else"NO")
is_even=lambda x:True if x%2==0 else False

def is_palindrome(s):
  n=len(s);b=True
  for i in range(int(0.5*n)):
    if s[i]!=s[n-i-1]:b=False
  return b

def main():
  a,b,n=ints()
  flr=lambda a,b,x:floor(a*x/b)-a*floor(x/b)
  if n>=b:
    print(flr(a,b,b-1))
  else:
    print(flr(a,b,n))


if __name__ == '__main__':
    main()

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

Solution (Python):
from sys import stdin
from sys import setrecursionlimit
import math

a,b,n = map(int,stdin.readline().rstrip().split())
if n >= b:
    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):
import sys
import math
import itertools 
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

A,B,N=nm()

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

Solution (Python):
def input_int_list():
    return [int(thing) for thing in input().split(" ")]

def int_input():
    return int(input())


def print_ans(string):
    print(string)
    exit()

def yes():
    print("Yes")
    exit()

def no():
    print("No")
    exit()

if __name__ == '__main__':
    A,B,N=input_int_list()
    x=min(B-1,N)
    ans=A*x//B-A*(x//B)
    print_ans(ans)

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

Solution (Python):
import sys
sys.setrecursionlimit(700000)

def s_in():
    return input()

def n_in():
    return int(input())

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

def print_l(l):
    print(' '.join(map(str, l)))

class Interval():
    def __init__(self, li):
        self.li = li
        self.n = len(li)
        self.sum_li = [li[0]]
        for i in range(1, self.n):
            self.sum_li.append(self.sum_li[i-1] + li[i])

    def sum(self, a, b=None):
        if b is None:
            return self.sum(0, a)

        res = self.sum_li[min(self.n-1, b-1)]
        if a > 0:
            res -= self.sum_li[a-1]
        return res

a,b,n = l_in()

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

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


def calc(a, b, input):
    return (a * input) // b - a * (input // b)


if n >= b:
    print(calc(a, b, b - 1))
    exit(0)
else:
    print(calc(a, b, n))
    exit(0)

Solution (Python):
import math

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

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

c = x / b - math.floor(x / b)

print(math.floor(a * c))

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


def solve(A: int, B: int, N: int):
    
    
    x = min(B - 1, N)
    print(math.floor(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):
from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations
from math import pi, ceil, floor
import numpy as np
from collections import defaultdict, deque,Counter
from operator import itemgetter
from bisect import bisect_left, bisect_right, insort_left, insort_right
import sys
input = sys.stdin.readline





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


if __name__ == '__main__':
    main()

Solution (Python):
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

a,b,n=n1()

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

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

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

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

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

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

print(ans)

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

Solution (Python):
a,b,n=map(int,input('').split(' '))
r=0
m=0
r=b-1
if r>=n:
    r=n
else:
    r=r

s=int(a*r/b)
print(int(a*r/b))

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

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

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

Solution (Python):
from math import floor

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

if __name__ == '__main__':
    resolve()

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

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

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

m = A - 1
for i in range(A):
    lim = [B*(A-i-1)/A, B*(A-i)/A]
    if lim[0] > N:
        m -= 1
        continue
    else:
        num = int(lim[0])
        is_found = False
        while True:
            if num >= lim[0] and num < lim[1]:
                is_found = True
                break
            elif num >= lim[1]:
                break
            else:
                num += 1
        if is_found:
            break
        else:
            m -= 1
            continue
print(m)

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

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

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

Solution (Python):


ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]
mp = lambda :map(int,input().split())

a,b,n = mp()
x = max(n,min(n,b-1))
ans1 = a*x//b - a*(x//b)

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

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

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

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

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

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

Solution (Python):
def main(a: int, b: int, n: int):
    ans = 0
    for i in (1, min(n, b - 1)):
        f = int((a * i) / b) - a * int(i / b)

        if ans < f:
            ans = f

    print(ans)


if __name__ == "__main__":
    a, b, n = map(int, input().split())
    main(a, b, n)

Solution (Python):


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







q = min(b-1,n)
ni = int(a*q/b)
if ni > nmax:
        nmax = ni
print(nmax)

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

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

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

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

if b == 1:
    print(0)
    exit()

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

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