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):
INT_MAX=10**19+7
MOD=10**12+7
def INPUT():return list(int(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]

import math as M
a,b,n=INPUT()
i=min(b-1,n)
ans=int(a*i/b)-a*int(i/b)
print(ans)

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

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

x = b - 1

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

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

Solution (Python):
import math

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

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

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

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

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

nb=n//b


if n<b:
    xmax=a*n//b
else:
    xmax=0



    xb=nb-1
    xv=(a*xb*b+a*(b-1))//b-a*xb
    xmax=max(xmax,xv)
    xb=nb
    xv=(a*xb*b+a*n%b)//b-a*xb
    xmax=max(xmax,xv)

print(xmax)

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

f = lambda x: (A * x) // B - A * (x // B)
print(f(min((B - 1), n)))

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())
def f(x):
    return ((a*x)//b)-a*(x//b)
if n<b:
    print(f(n))
elif n==b:
    print(f(n-1))
elif n>b:
    t = n
    u = b - 1
    print(max(f(t),f(u)))

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

Solution (Python):

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

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

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

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

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

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


print(ans)

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

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

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

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())
def f(x):
    return (a*x)//b-a*(x//b)
if n<b:
    ans =f(n)
else:
    t = n
    u = b - 1
    ans=max(f(t),f(u))
print(ans)

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

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

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

nb=n//b


if n<b:
    xmax=a*n//b
else:
    xmax=0



    xb=nb-1
    xv=(a*xb*b+a*(b-1))//b-a*xb
    xmax=max(xmax,xv)
    xb=nb
    xv=(a*xb*b+a*n%b)//b-a*xb
    xmax=max(xmax,xv)

print(xmax)

Solution (Python):
import math

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

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

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

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

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

Solution (Python):
from sys import stdin
import math

[A, B, N] = [float(x) for x in input().rstrip().split()]


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

print(int(math.floor(A*x/B)-A*math.floor(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):
import numpy as np

ABN=np.array(input().split(" "),dtype=np.int64)
A=ABN[0]
B=ABN[1]
N=ABN[2]

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

print(calc)

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

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

piv=B/A  













cnt=0

"""
if A<=B:
    if N>=B-1:
        print(A-1)
    else:
        if ceil(piv)*(B%A)>N:
            print(floor(N/ceil(piv)))
        else:
            N=N-ceil(piv)*(B%A)
            
            cnt=(B%A)
            print(cnt+N//floor(piv))
else:  
    l=[0]
    for i in range(1,B):
        l.append(max(l[i-1],floor(A*i/B)-A*floor(i/B)))
    
    if N>=len(l):
        print(l[len(l)-1])
    else:
        print(l[N])
"""
def f(A,B,N):
    return floor(A*N/B)-A*floor(N/B)
print(f(A,B,min(B-1,N)))

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

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

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

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

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

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

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

Solution (Python):
A, B, N = map(int, input().split())
from math import floor
from math import gcd
from math import ceil
k = gcd(A, B)

As = A // k
Bs = B // k

Q = min(N, B-1)
R = ceil(Bs / As)
res = []
for b in range(Q, Q - R, -1):
    res.append(round(floor(b*As/Bs) - A*floor(b/B)))

print(max(res))

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

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

print(max(A*a//B-A*(a//B),A*b//B-A*(b//B)))

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

Solution (Python):
import math

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

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

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

Solution (Python):


import math


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


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



result = f(min(B-1, N))


print(result)

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

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

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

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

Solution (Python):
import math

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

if __name__ == '__main__':
    main()

Solution (Python):
A, B, N = map(int, input().split())
t = N // B
if N % B == 0:
    a = max(0, N-1)
    b = N
    d = max(0,t*B-1)
    e = 1
    f = 0
else:
    a = max(0, t * B - 1)
    b = N
    d = max(0,N-1)
    e = 1
    f = 0

k = A * N // B
if A * N % B == 0:
    case = [a, b, max(min(B-1,N),0),d,e,f]
else:
    c = max(0,k*B//A+1)
    g = max(0,k*B//A)
    case = [a,b,max(min(B-1,N),0),d,e,f,g]

ans = 0
for i in case:
    ans = max(ans,A*i//B-A*(i//B))

print(ans)

Solution (Python):

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

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


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

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

if N<B:
    print(math.floor(A*N/B)-A*math.floor(N/B))
else:
    print(math.floor(A*(B-1)/B)-math.floor((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):
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
ans=-100000000
a,b,n=map(int,input().split())
i=min(n,b-1)
keep=math.floor(a*i/b)-a*math.floor(i/b)

print(keep)

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

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


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

    print(fs(A, B, min(N, B-1)))
    return 0

if __name__ == '__main__':
    main()

Solution (Python):


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

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

print(int(z))

Solution (Python):
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def resolve():
    A, B, N = lr()
    print((A*min(N, B-1))//B)
resolve()

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

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

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

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

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

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

Solution (Python):
import sys

input = sys.stdin.readline
MOD = 1000000007

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


    

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


x = min(B-1,N)

print(f(x))

Solution (Python):
from math import floor

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

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

print(ans)

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

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

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

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

x = min(b-1,n)

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

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

Solution (Python):
import math


def main():
    a,b,n = map(int,input().split())
    
    
    
    
    i = min(b-1,n)
    m = a*i//b - a*(i//b)
    
    print(m)
if __name__ == "__main__":
    main()

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

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

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

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

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

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

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

if __name__ == '__main__':
    main()

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

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

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

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


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

if __name__ == '__main__':
    main()

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

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 sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from math import floor

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

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

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

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

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

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

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

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

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

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

cnt = 1
buf = []
if n < b:
    buf.append(int(a * n / b) - a * (int(n / b)))
else:
    buf.append(int(a * (b - 1) / b) - a * (int((b - 1) / b)))
    

while True:
    if n / b > 10 ** 6:
        break
    x = cnt * b - 1
    if n < x :
        break
    calc = int(a * x / b) - a * (int(x / b))
    if calc > max(buf):
        buf.append(calc)
    cnt += 1
    
if n / b > 10 ** 6 and n >= b:
    buf.append(int(a * (b - 1) / b) - a * (int((b - 1) / b)))

ans = max(buf)
print(ans)

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

print(max)

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

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

x = min(B-1,N)

print(floor_calc(x))

Solution (Python):
import random
a,b,n=map(int,input().split())
def f(x):
    return int(a*x/b)-a*int(x/b)
if n<b:
    ans =f(n)
else:
    t = n
    u = b - 1
    v=min(t,u)
    ans=f(v)
print(ans)

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

x3 = min(N,B-1)
def f(x): 
    t = math.floor((A*x)/B) - A * math.floor(x/B)
    return int(t)
print(f(x3))

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

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

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

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

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
from collections import Counter
import itertools
import fractions



def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, 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 SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'


p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")


 
A,B,N = MI()

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

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

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

Solution (Python):


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



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


    


if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

if(b-1<=n):
    i = b-1
else:
    i = n

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

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

Solution (Python):
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()
import math
if b<=n:
    i=b-1
else:
    i=n
m=math.floor((a*i)/b)-a*math.floor(i//b)
print(m)

Solution (Python):
import math

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

c = 0
ans = -1
for i in range(1,n//b+2) :
    x = b*i-1
    if x > n :
        x = n
        c = 1
    if ans >= math.floor((a*x)/b)-a*math.floor(x/b) :
        break
    ans = math.floor((a*x)/b)-a*math.floor(x/b)
    if c == 1 :
        break

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


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



a, b, n = [int(s) for s in input().split(" ")]
solve()

Solution (Python):


from math import floor

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

    if N >= B-1:
        x = B-1
    else:
        x = N
    return str(floor(A/B*x))


if __name__ == '__main__':
    print(solve())

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

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

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

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

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

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

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

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

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


if __name__ == '__main__':
    main()

Solution (Python):


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

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

X = N
Y = min(B-1,N)

print(f(Y))

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

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

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

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

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

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

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

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

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

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




print(ans)

Solution (Python):
import math
import random

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

def quick(x):
  pri = (A * x // B)
  lat = A * (x // B)
  return math.floor(pri - lat)

max = quick(N)
for i in range(8000000):
  ran = math.floor(random.uniform(0, N))
  tem = quick(ran)
  if(max < tem):
    max = tem

print(max)

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

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

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

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

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

Solution (Python):
import math
A,B,N=map(int,input().split())
start=0
i=min(B-1,N)
K=math.floor((A*i)/B)-A*(math.floor(i/B))
if start<=K:
    start=K
print(start)

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

Solution (Python):


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

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

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

Solution (Python):
import math
A,B,N=map(int,input().split())
D=int(A*B/math.gcd(A,B))
maxi=0
if B-1<=N:
  print(int((B-1)%B*A/B-(A*(B-1))%B/B))
else:
  print(int(N%B*A/B-(A*N)%B/B))

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

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

def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))

def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]

def to_bin(x: int) -> str: return format(x, 'b') 
def to_oct(x: int) -> str: return format(x, 'o') 
def to_hex(x: int) -> str: return format(x, 'x') 
MOD=10**9+7
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(MAX_NUM+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(MAX_NUM**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, MAX_NUM+1, i):
            is_prime[j] = False
    return [i for i in range(MAX_NUM+1) if is_prime[i]]

from itertools import accumulate as acc
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left


def main():
    a, b, n = MII()
    f = lambda x: divf(a*x,b) - a*divf(x,b)
    print(f(min(b-1, n)))
    
if __name__ == '__main__':
    main()

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

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

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

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

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

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

def floor(a,b,x):
    p = (a*x)//b - a*(x//b)
    return p

max = 0
if b == 1:
    max = 0
elif n <= b-1:
    max = floor(a,b,n)
elif n > b-1:
    for i in range(b-1,n+1,b):
        c = floor(a,b,i)
        if c >= max:
            max = c

print(max)

Solution (Python):
import sys
import math
import bisect







INF = sys.maxsize
MOD = 10 ** 9 + 7



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

left = 1
right = n

ans = 0
num = 0
while abs(left - right) > 10 ** (-2):
    tmp_left = left + (right - left) / 3
    tmp_right = left + 2 * (right - left) / 3

    c_left = math.floor(a * left / b) - a * math.floor(left / b)
    c_right = math.floor(a * right / b) - a * math.floor(right / b)

    f_left = math.floor(a * tmp_left / b) - a * math.floor(tmp_left / b)
    f_right = math.floor(a * tmp_right / b) - a * math.floor(tmp_right / b)

    if c_left <= f_left <= f_right:
        left = tmp_left
        if ans < f_left:
            ans = f_left
            num = tmp_left

    else:
        right = tmp_right
        if ans < f_right:
            ans = f_right
            num = tmp_right


ans1 = math.floor(a * int(num) / b) - a * math.floor(int(num) / b)
ans2 = math.floor(a * int(num + 1) / b) - a * math.floor(int(num + 1) / b)

print(int(max(ans1, ans2)))

Solution (Python):


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

Solution (Python):
import sys
from math import sqrt, floor

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


def I():
    return int(input())


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


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

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


if __name__ == "__main__":
    main()

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

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

print(ans)

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

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

Solution (Python):
A,B,N=map(int,input().split())
C=A%B
ans=0
b=min(B-1,N)
ans=(A*b-C*b%B)//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*(x//B))

Solution (Python):
from sys import stdin
import sys

A, B, N = [int(x) for x in stdin.readline().rstrip().split()]


x=min(B-1,N)
ans = int((A*x)/B)-A*int(x/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):
def f(A,B,x):
    return (((A*x)//B)-(A*(x//B)))
def main():
    A,B,N=map(int,input().split())
    x=min(N,B-1)
    print(f(A,B,x))
if __name__=='__main__':
    main()

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

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


print(ans)

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



if __name__ == "__main__":
    d()

Solution (Python):



from pprint import pprint as pp
from pprint import pformat as pf

import math

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

if __name__ == '__main__':
    a, b, n = map(int, input().split())
    if b > n:
        m = calc(a, b, n)
    else:
        m = calc(a, b, b - 1)
    print(m)

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

Solution (Python):
import sys
from math import sqrt, floor

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


def I():
    return int(input())


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


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

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


if __name__ == "__main__":
    main()

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


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

ans = function(0)
for i in range(b):
    if i * b - 1 > n:
        ans = max(ans, function(n))
        break
    ans = max(ans, function(i * b - 1))

print(ans)

Solution (Python):


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

z = 0

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

print("{}".format(z))

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

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

print(c)

Solution (Python):

import sys
from collections import Counter
from itertools import permutations, combinations

from math import gcd
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)
inf = float("inf")

def input():
    return sys.stdin.readline()[:-1]


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

if __name__ == '__main__':
    main()