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

Solution (Python):
import math

a, b, n = map(int, input().split())
maxr = 0
minr = 0
ans = 0
if b < n:
    maxr = b + 1
    minr = abs(b - 1000000) if abs(b - 1000000) < b else 0
else:
    maxr = n + 1
    minr = abs(n - 1000000) if abs(n - 1000000) < n else 0
for i in range(minr, maxr):
    c = math.floor((a * i) / b) - math.floor(i / b) * a
    ans = max(ans, c)
print(ans)

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

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

Solution (Python):
def floor(a,b,n):
    if b == 1:
        print(0)
    elif n < b:
        print(int(a*n/b)-a*int(n/b))
    else:
        print(int(a*(b-1)/b))

a, b, n = [int(i) for i in input().split()]
floor(a,b,n)

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

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

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

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

ans = 0
if b > 10 ** 6:
    x = b - 1
    while x <= n:
        ans = max(ans,f(x))
        x += b
for x in range(n,max(1,n-2 * 10**6 -10),-1):
        ans = max(ans,f(x))
    
print(ans)

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

Solution (Python):
import math

a,b,n=map(int,input().split())
num=-100
i=1
if n<b:
    num=max(num,math.floor(a*n/b)-a*math.floor(n/b))
else:
    j=b-1
    num=max(num,math.floor(a*j/b)-a*math.floor(j/b))
print(num)

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

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

print(ans)

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


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


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

Solution (Python):

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


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


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

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

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

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

mn = min(B-1,N)
mx = int(A*mn/B)

print(mx)

Solution (Python):



from math import *
from copy import *					
from heapq import *					
from string import *				
from random import *				
from bisect import *				
from sys import stdin				
from sys import maxsize				
from operator import *				
from itertools import *				
from collections import Counter		
from collections import defaultdict 

'''

'''

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

def solve(a,b,n):
	x = b-1
	if(b > n):
		x = n
	return floor(a*x/b)


a,b,n = list(map(int, stdin.readline().rstrip().split()))
ans = solve(a,b,n)
print(ans)

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

ans = min (b - 1, n)

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

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


x = b-1

if b > n:
  res = int((a/b)*n)

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

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

if b > n:
    mod_ab = a%b
    
    answer = (a*n)//b
else:
    x=b-1
    tmp_max=(a*x-(a*x)%b)
    answer=int(tmp_max/b)

print(answer)

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

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

Solution (Python):
import bisect,sys
import math
from collections import deque

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))

INF = 1 << 29

DIV = (10**9) + 7

def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def CONV_TBL(max, mod=DIV):
    fac, finv, inv = [0]*max, [0]*max, [0]*max
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, max):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod % i] * (mod//i) % mod
        finv[i] = finv[i-1]*inv[i] % mod

    class CONV:
        def __init__(self):
            self.fac =fac
            self.finv = finv
            pass

        def ncr(self, n, k):
            if(n < k):
                return 0
            if(n < 0 or k < 0):
                return 0
            return fac[n]*(finv[k]*finv[n-k] % DIV) % DIV
        
    return CONV()



sys.setrecursionlimit(200005)


def main():
    A,B,N = isRaw()
    
    if N<B:
        a1 = (A*N)//B
        return a1
    else:
        res = B-1
        a2 = (A*res)//B
        if A<=B:
            return max(a2,0)
        return max(a2, 0)
        
    
if __name__ == "__main__":
    print(main())

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

if n >= b-1:
    print(int(a*(b-1)/b))
else:
    print(int(a*n/b)-a*int(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):
import sys
import math
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

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

res = n//b
x = b*res -1
if n < b:
    x = n

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

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

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

Solution (Python):
import os

import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


A, B, N = list(map(int, sys.stdin.buffer.readline().split()))

if N < 10:
    ans = 0
    for x in range(N + 1):
        y = A * x // B - A * (x // B)
        ans = max(ans, y)
    print(ans)
    exit()
if A == 1 or B == 1:
    print(0)
    exit()

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

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

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

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

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

q_b = a // b
r_b = a % b

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

q_ans = q_b * r + (r_b * r) // b

print(q_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):
import sys,math,copy,queue,itertools,bisect,collections,heapq
sys.setrecursionlimit(10**7)
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
INF = 10**18
MOD = 10**9 + 7
DD = ((1,0),(-1,0),(0,1),(0,-1))

A,B,N = LI()

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

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

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

x = math.floor(a*n/b)-( a*math.floor(n/b))
y = math.floor(a*b/b)-( a*math.floor(b/b))
z = math.floor(a*(b-1)/b)-( a*math.floor((b-1)/b))

if b == 1:
    print(0)
elif n < b:
    print(x)
else:
    print(z)

Solution (Python):
import numpy as np

def fLOOR(a,b,x):
    return np.floor(a * x / b) - a * np.floor(x / b)
"""
def fLOOR1(a,b,x):
    return np.floor(a * x / b)

def fLOOR2(a,b,x):
    return np.floor(x / b)
"""
def main():
    a,b,n = map(int, input().split(" "))
    
    """
    for x in range(n):
        x += 1
        val = fLOOR(a,b,x)
        val1 = fLOOR1(a,b,x)
        val2 = fLOOR2(a,b,x)
        print(val)
    """
    if b <= n:
        ans = fLOOR(a,b,b-1)
    else:
        ans = fLOOR(a,b,n)
    print(int(ans))

if __name__ == '__main__':
    main()

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

import math

ans=0
if N < B:
  end = N
else:
  end = B -1

x = end
tmp=math.floor(A*x/B) - A * math.floor(x/B)
  
print(tmp)

Solution (Python):
A, B, N = map(int, input().split())
a = A//B
k = A%B
n = N//B

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

print(max(f(n*B-1), f(N), 0) if n>0 else max(f(N),0))

Solution (Python):
from copy import copy, deepcopy
from collections import Counter
from math import sqrt, floor

MOD = 10**9 + 7


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

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

Solution (Python):
import math

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




cands = []
temp = math.floor(A * N // B) - A * math.floor(N // B)
cands.append(temp)
if B <= N + 1 and B - 1 > 0:
    temp = math.floor(A * (B - 1) // B) - A * math.floor((B - 1) // B)
    cands.append(temp)
print(max(cands))

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

from math import floor

def f_ans(X):
  return floor(a*X/b) - a * floor(X/b)

temp = n // b
temp = temp * b
if b == 1:
  print(0)
elif temp > 0:
  print(f_ans(temp-1))
else:
  print(f_ans(n))

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

Solution (Python):
import math

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

if n//b > 0:
  z = b-1
else:
  z = n

d = ((a*z)/b)//1
e = a*((z/b)//1)
y = d - e
v = math.floor(y)
print(v)

Solution (Python):
import math
a, b, n = [int(i) for i in input().split(' ')]
if n >= b:
  x = b - 1
else:
  x = n
f = math.floor(a * x / b) - a * math.floor(x / b)
print(f)

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

maxFloor = 0


def floor(x):
    num = int(x // 1)
    return num


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

Solution (Python):
from math import floor

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

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

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

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

print(int(f*int(A)))

Solution (Python):
import math

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






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

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

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

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

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

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

Solution (Python):
import sys
A,B,N=map(int,input().split())
X=B-1
ans=(A*N)//B-A*(N//B)
if B==1:
  print(0)
  sys.exit()
while X<=N:
  ans=max(ans,(A*X)//B-A*(X//B))
  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*((n//b)*b-1)//b - a*(((n//b)*b-1)//b))

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

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


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


def readint():
    return int(input())


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


def readstrs():
    return input().split()


A, B, N = readnums()

'''

x = B - 1のとき最大？
f(A(B - 1) / B) = f(A - A/B)
A*f((B-1)/B) = 0

x = 2B - 1のとき
f(A(2B - 1) / B) = f(2A - A/B)
A*f((2B-1)/B) = A*f(2 - 1/B) = A

A <= Bのとき
x = B - 1のとき最大で、その値はA - 1

A > Bのとき
f(A - A/B) = A - A // B - 1
f(2A - A/B) - A = A - A//B - 1

'''












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

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

Solution (Python):

si = lambda: input().strip()
ii = lambda: int(input())
mii = lambda: map(int, input().split())
msi = lambda: map(str, input().split())
lmii = lambda: list(map(int, input().split()))
lmsi = lambda: list(map(str, input().split()))
smii = lambda: sorted(map(int, input().split()))




A, B, N = mii()

ans = 0
x = min(N, B)


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

if x > 1:
    x -= 1
    ans = max(ans, A*x//B - A*(x//B))

print(ans)

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

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

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


res = f(n)


for i in range(max(1,n-10000),n+1):
    res = max(res,f(i))

w = (n//b)*b - 1
w2 = (n//b)*b - 1 + b

for i in range(max(1,w-10000),min(n+1,w+10000)):
    res = max(res,f(i))

for i in range(max(1,w2-10000),min(n+1,w2+10000)):
    res = max(res,f(i))


print(res)

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

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

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

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

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

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

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

Solution (Python):
import math

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

if __name__ == '__main__':
    main()

Solution (Python):
import sys
import numpy as np
import math
from collections import deque 
from functools import reduce



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

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

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

Solution (Python):

import sys
import math

from fractions import *


def solve(A: int, B: int, N: int):
    def kansuu(x):
        
        left = math.floor(Fraction(A) * Fraction(x) * Fraction(1, B))
        right = Fraction(A) * math.floor(Fraction(x, B))
        return left - right

    saidaibaisuu = (N // B) * B
    if saidaibaisuu == 0:
        print(kansuu(N))
        exit()
    else:
        print(kansuu(saidaibaisuu-1))
        exit()

    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 sys



def solve(A: int, B: int, N: int):
    print((A*min(N,(B-1))//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):
def floor(x):
    return int(x)

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

    X = B-1 if B-1 <= N else N
    X = float(X)

    ans = floor(A*X/B) - A*floor(X/B)
    print(ans)

if __name__ == '__main__':
    main()

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

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

Solution (Python):
a,b,n=map(int,input().split())
if n>=b-1:
    count=0
    for i in range(a):
        count+=(((b-1)/b)+(i/a))//1
    print(int(count))
else:
    count=0
    for j in range(a):
        count+=((n/b)+(j/a))//1
    print(int(count))

Solution (Python):
import sys
import math

if __name__ == '__main__':
    a, b, n = list(map(lambda x: int(x), sys.stdin.readline().split(' ')))
    old = 0
    if 0 <= b-1 and b-1 <= n:
        x = b - 1
        print(math.floor(a*x/b)-a*math.floor(x/b))
    else:
        x = n
        print(math.floor(a*x/b)-a*math.floor(x/b))

Solution (Python):
import math
data = input().rstrip().split(" ")
ap = int(data[0])
bp = int(data[1])
max = int(data[2])
one = 0
two = 0
answer = 0
if bp - 1 <= max:
    change = bp - 1
else:
    change = max

one = math.floor(ap * change / bp)
two = math.floor(change / bp)
answer = one - two * ap
print(answer)

Solution (Python):

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


print(ans)

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True

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

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

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

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

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

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

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

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

    return a * x // b - x // b * a


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

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)

if N < B:
    print(func(N))
    exit()
    
ans = []
for i in range(B-100,B+100):
    ans.append(func(i))
    
print(max(ans))

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

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

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

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

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

if (b == 1) or (a == 1):
    temp = 0


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

else:
    temp = (a * n) / float(b)
   

ans = math.floor(temp)
print(ans)

Solution (Python):
import math

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

solved_flag = False
if B==1:
    ans = 0
    solved_flag = True
else:
    if B <= N:
        x = B-1
    else:
        x = N

if not solved_flag:
    ans = math.floor(A*x/B) - A*math.floor(x/B)
print(ans)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

if N >= B:
    N = B - 1

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

print(ans)

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

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

def main():
    A, B, N = map(int, read().split())
    m = N % B
    x1 = N
    x2 = N - m - 1
    if x2 > 0:
        ans = max((A * x1) // B - A * (x1 // B), (A * x2) // B - A * (x2 // B))
    else:
        ans = (A * x1) // B - A * (x1 // B)
    print(ans)
    return

if __name__ == '__main__':
    main()

Solution (Python):
import math
s = list(map(int,input().split()))

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

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

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

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

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

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

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

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

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

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

print(ans)

Solution (Python):
a,b,x = map(int, input().split())
point = 0
if x < b:
    print(int(a*x/b)-(a*int(x/b)))
else:
    for i in range(b-100, b+100):
        point = max(int(a*i/b)-(a*int(i/b)), point)
    print(point)

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

W = N//B
dammy=[]
x=N
dammy.append((A*x)//B - A * int(x/B))
x=(B * W)-1
dammy.append((A*x)//B - A * int(x/B))


print(max(dammy))

Solution (Python):
from sys import stdin

def main():

    input = stdin.readline

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

    ans = 0

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

    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
import sys
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
lrs = lambda: [_ for _ in rs().split()]
lri = lambda: [int(_) for _ in rs().split()]
lrf = lambda: [float(_) for _ in rs().split()]

A, B, N = lri()
def f(x):
    return ((A * x) // B) - A * (x // B)
print(max(f(N), f(max((N // B) * B - 1, 1))))

Solution (Python):

import sys


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

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

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

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

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

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

print(ans)

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

def f(x):
    return a * x // b - a * (x // b)
if b - 1 <= n:
    print(f(b - 1))

else:
    print(f(n))

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




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

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

Solution (Python):



def input_int():
    return int(input())



def int1(x):
    return int(x) - 1



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



def input_to_int_tuple():
    return tuple(map(int, input().split()))



def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


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

    if n < b:
        return (a * n) // b

    if n < b * 2:
        return ((a * ((b * 2) - 1)) // b) - a

    return 0


if __name__ == "__main__":
    print(main())

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

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

Solution (Python):
from math import ceil 
import numpy as np
 
def inp(): return int(input()) 
def inpm(): return map(int,input().split()) 
def inpl(): return list(map(int, input().split())) 
def inpls(): return list(input().split()) 

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

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

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

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

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

Solution (Python):
import sys

def calc_floor(A, B, X):
    return (int(A * X / B) - A * int(X / B))

A, B, N = map(int, sys.stdin.readline().split())
if N >= B - 1:
    print(calc_floor(A, B, B - 1))
else:
    print(calc_floor(A, B, N))

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

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

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

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

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

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

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

    f = lambda x: int(A*x/B) - A * int(x / B)

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

if __name__ == '__main__':
    main()

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

max_v = 0
for x in range(-1, min(B, N+1), min(B, N+1)):
    if x <= 0:
        continue
    v = math.floor(A*x/B) - A*math.floor(x/B)
    if max_v < v:
        max_v = v
print(max_v)

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

if b == 1:
    ans = 0
else:
    ans = (a * min(n, (b - 1)) / b) // 1 - a * ((min(n, (b - 1)) / b) // 1)

print(int(ans))

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

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

if n%b != b-1:
    x = n - n%b - 1
else:
    x = n
print(a * x // b - a * (x // b))

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

ans = 0

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

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

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

a, b, n = map(int, input().split())
if b == 1:
    print(0)
    sys.exit(0)

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

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