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(float,input().split())

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

Solution (Python):


import math

input_1 = input()
a = int(input_1.split(" ")[0])
b = int(input_1.split(" ")[1])
n = int(input_1.split(" ")[2])



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

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 os
import math
import bisect
import collections
import itertools

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

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


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


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

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


if __name__ == '__main__':
    main()

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

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

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

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

print(int(ans))

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

def hoge(i):
    hoge=math.floor(A*i/B)-A*math.floor(i/B)
    return hoge

if N<=B-1:
    re=hoge(N)
else:
    re=hoge(B-1)

print(re)

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

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

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

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

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

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

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

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

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

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

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

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

print( math.floor(( A*(div_num % B)/B )) )

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

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

Solution (Python):

import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


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

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


def calc(i):
    return floor(A * i / B) - A * floor(i / B)


if __name__ == '__main__':
    A, B, N = map(int, input().split())
    print(calc(min(B - 1, N)))

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


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

Solution (Python):
import math

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

maxresult = 0











"""
解説動画を見て、再考
x = pB + qと変形する。（https://twitter.com/chokudai/status/1256806061194874881）
floor[Ax / B]
=floor[(APB+Aq) / B]
=Ap + floor[Aq / B]

A * floor[x / B]
= A * floor[(pB+q) / B]
= A * (p + floor[q/B])

よって、
floor[Ax / B] - A * floor[x / B]
=Ap + floor[Aq / B] - Ap - A * floor[q / B]
=floor[Aq / B] - A * floor[q / B]
  
=floor[Aq / B]
  
=floor[A/B * (x % B)]
この値が最大になればよく、xは整数なので、
x = B-1の時が最大となる。

ただしN < B-1の場合は、x = B-1を取れないので、
そのときにはxの最大値x=Nとなる。
"""

if n < b-1:
    x = n
else:
    x = b-1
maxresult = a * (x%b) // b

print(int(maxresult))

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

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

a,b,n = LI()

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

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

def floor(x,y):
    return int(x/y)
  
if N < B:
    x = N
else:
    x = B-1
max = floor(A*x,B) - A * floor(x,B)
print(max)

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

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

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

ans = (a*(x%b))//b
print(ans)

Solution (Python):
def fanc():
  a,b,n=map(int,input().split())
  x=min(b-1,n)
  max_res=int(a*x/b)-a*int(x/b)
  print(max_res)
  
if __name__=="__main__":
  fanc()

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

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

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

Solution (Python):
from math import floor

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

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

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

def main():
    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)))


if __name__ == "__main__":
  main()

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

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

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

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

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

import math

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

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

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

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

from decimal import *
































def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007




def main():
	A,B,N = inputMap()

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





def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res


def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y



def H(n, r, mod=10**9+7):
	
	
    return combination(n+r-1, r, mod)


class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        
        
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv



def dfs(graph,parent,counter,edge):
    stk = []
    stk.append(edge)
    while len(stk) > 0:
        p = stk.pop()
        for e in graph[p]:
            if parent[p] == e:
                continue
            else:
                parent[e] = p
                counter[e] += counter[p]
                stk.append(e)

if __name__ == "__main__":
	main()

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

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

Solution (Python):
import math

DEBUG = False

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

if DEBUG:
    ans = 0
    for x in range(1, N+1):
        term1 = math.floor(A*x/B)
        term2 = A * math.floor(x/B)
        temp = term1 - term2
        print("x: {}, temp: {}, term1: {}, term2: {}".format(x, temp, term1, term2))
        ans = max(ans, temp)
    print(ans)

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

Solution (Python):




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


if __name__ == "__main__":
    main()

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

Solution (Python):

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

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

if __name__ == "__main__":
    resolve()

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

def X(x):
    return (A * (x % B) - A * (x % B) % B)/B

if N < B - 1:
    print(int(X(N)))
else:
    print(int(X(B-1)))

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

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

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

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

ans=0
t=min(b,n)
for i in range(t,max(t-3,-1),-1):
    ans=max(ans,((a*i)//b-(a*(i//b))))
print(ans)

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

print(math.floor(a*min([b-1, n])/b)-a*math.floor(min([b-1, n])/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 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())
if N >= B:
    N = B-1
ans = math.floor(A*N/B) - A*math.floor(N/B)
print(ans)

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

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

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

x=min(b-1,n)

print(int(a*x/b))

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

Solution (Python):

import 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):
n,m,k = [int(e) for e in input().split()]
mk = min (m-1,k)
a = (n * mk) // m  - n * (mk //m )
print(a)

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

Solution (Python):
arr = input().split(" ")
a, b, n = int(arr[0]), int(arr[1]), int(arr[2])
if b<=n:
   k = int((a*(b-1))/b)
else:
   k = int((a*n)/b)
print(k)

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

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

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

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

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

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

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

A,B,N = [int(x) for x in input().split()]
m = min(B-1,N)
print(f(A,B,m))

Solution (Python):
from sys import stdin


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


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

Solution (Python):
from math import floor


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


if __name__ == '__main__':
    main()

Solution (Python):
import math

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

max_value = 0
n = min(N, B-1)

max_value =  math.floor(A*n/B) - A* math.floor(n/B)


    
print(max_value)

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

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

print(t)

Solution (Python):
s = input().split()

a = int(s[0])
b = int(s[1])
n = int(s[2])

c = min(b-1,n)
m = (a*c)//b
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):
s = input().split()

a = int(s[0])
b = int(s[1])
n = int(s[2])

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

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

ans = 0

x = min(N, B-1)

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

print(ans)

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

ans = 0

x = min(N, B-1)

A_x = A * x
left_ = int(A_x / B)
right_ = A * int(x / B)
fnc_ = left_ - right_
ans = fnc_

print(ans)

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

ans = 0

x = min(N, B-1)

A_x = A * x
left_ = int(A_x / B)
right_ = A * int(x / B)
fnc_ = left_ - right_
if x <= N:
  ans = max(ans, fnc_)
  

print(ans)

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

x = min(B-1,N)

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

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

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

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

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

print(ans)

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


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

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

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

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

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

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

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

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

Solution (Python):
'''ika tako
見た目が難しそうな問題こそ、書いて考えよう
式の意味を、数字を当てはめながら、具体的に試してみよう
考察が出来れば、実装は簡単な問題もある

x  を B で割った商をd、剰余を m とすると、それぞれは以下のように表せる。
(Ax)/B=Ad+(Am)/B
A*x/B=Ad
なので、m を最大化すればよい。
m=B−1 とできるなら、それが最大となる。
N の制約のせいでできないなら、できるだけ大きい数なので、
x=N とすればよい。
'''
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())
val = (A*min(N,B-1))//B - A*(min(N,B-1)//B)
print(val)

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

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

print(int(ans))

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

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


x = 0

if N >= B - 1:
    x = B - 1
elif N < B -1:
    x = N
    if not N % B == 0:
        pass
    else:
        x -= 1


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

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

Solution (Python):
import math

A, B, N = [int(i) for i in 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 = map(int,input().split())
x = min(B-1,N)
print(math.floor(A*x/B)-A*math.floor(x/B))

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

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

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

Solution (Python):
def f1():
    x = B-1
    if x > N:
        x = N
    return (A * x) // B - A * (x // B)

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

print(f1())

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

if __name__ == "__main__":
    main()

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

if __name__ == "__main__":
    main()

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

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

Solution (Python):
import sys

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

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

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

    ans = (A*x) // B
    print(ans)
    return

if __name__ == '__main__':
    main()
    sys.exit(0)

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

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

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

Solution (Python):
import math
A, B, N = map(int, input().split())
ans = 0
if N<10**6:
    for i in range(N+1):
        tmp = math.floor(A*i/B)-A*math.floor(i/B)
        if tmp>ans:
            ans = tmp
elif N>=10**6 and N>=B:
    ans = math.floor(A*(B-1)/B)-A*math.floor((B-1)/B)
elif N>=10**6 and N<B:
    ans = math.floor(A*N/B)-A*math.floor(N/B)
    

print(ans)

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

Solution (Python):
import math

A,B,N=map(int,input().split())
print(math.floor(A/B*(~-B if N>=B else N)))

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

m=min(N,B-1)

ans= A*m//B - A*(m//B)
print(ans)

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

Solution (Python):
import math

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

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

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



print(ans)

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

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

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

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

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

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 sys


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


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


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

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

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


if __name__ == "__main__":
    main()

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

Solution (Python):


def main():
    import sys
    line = sys.stdin.readline
    A,B,N = map(int,input().split())
    if B>N:
        ans = A*N//B
    else:
        ans = A*(B-1)//B
    print(ans)

if __name__== "__main__":
    main()

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

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

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

Solution (Python):
A, B, N = map(int, 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())

ans = min(B-1, N)

print(int((A*ans)/B)-A*int(ans/B))

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

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


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

if __name__ == "__main__":
    main()

Solution (Python):
import math

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

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

print(int(f))

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


A, B, N = map(int, input().split(" "))
if B <= N:
    print(f(A, B, B - 1))
else:
    print(f(A, B, N))

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

if n < b-1:
    print(func(n))
else :
    print(func(b-1))

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

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

ans = floor(min(b-1,n))

print(int(ans))

Solution (Python):
A,B,N=map(int,input().split())
b=B-1
ans=(A*(N))//B-A*((N)//B)
while b<=N:
    num=(A*b)//B-A*(b//B)
    if ans>=num:
        break
    else:
        ans=num
    b+=B
print(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 = list(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())
"""
floor(ax/b) - a*floor(x/b)
= (ax-(ax)%b)/b - a*(x-x%b)/b
= (a*(x%b)-(ax)%b)/b
"""
def f(x):
    return (a*(x%b)-(a*b)%b)//b

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

Solution (Python):


import math


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


def f(x: int) -> int:
    """目的関数

    Arguments:
        x {int} -- 非負整数

    Returns:
        int -- 目的関数値
    """
    return math.floor(A*x/B) - A*math.floor(x/B)


def main() -> None:
    """Entry point
    """
    
    """
    f(x+B) = f(x)より、0 <= x <= (B-1)についてのみ考える.
    このとき、f(x) = floor(Ax/B)であり、これはxについての単調増加関数である.
    よって、求める最大値はf(min(B-1, N))である.
    """
    result = f(min(B-1, N))

    
    print(result)


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
import math

def input_number():
    return int(input())

def input_1line_list(number_of_input):
    return [input() for i in range(number_of_input)]

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




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

def main():
    a, b, n = input_1line()
    x = min(b-1, n)
    ans = f(a, b, x)
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
import math

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

def floor_t(A,B,y):
    return math.floor(A*y/B) - A*math.floor(y/B)











X=min(N,B-1)

print(floor_t(A,B,X))

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

Solution (Python):
import sys



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

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

Solution (Python):






import sys,bisect,math
sys.setrecursionlimit(15000)

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

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

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

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

ans = f(N)
if B - 1 <= N:
    D = (N // B) * B
    ans = max(ans, f(D - 1))
print(ans)

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

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

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

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

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

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

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

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

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

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

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

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

x = min(N, B - 1)

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

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

Solution (Python):


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





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

Solution (Python):
Nlist = list(map(int, input().split()))

A = Nlist[0]; B = Nlist[1]; N = Nlist[2]

if N//B == 0:
  print(int(A*N/B))
else:
  print(int(A*(B-1)/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())
x = min(b - 1, n)
print(math.floor(a * x / b) - a * math.floor(x / b))

Solution (Python):

a, b, n = map(int, input().split())
print(int(min(b-1, n)*a/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):
import math
a, b, n = map(int, input().split())
ans = -float('inf')
n = min(b-1, n)
f1 = math.floor(a*n/b)
f2 = math.floor(n/b)
ans = f1-(a*f2)
print(ans)

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


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

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

Solution (Python):
a,b,n = map(int, raw_input().split(' '))
m = 0
print min(b-1,n) * a /b
"""
for t in range(0, min(b,n) + 1):
	print t*a/b
	m = max(m,t * a / b)
	
print m
"""

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

Solution (Python):
import time
startTimeProblem=time.time()

import fileinput, sys, itertools, functools
from math import *
from bisect import *
from heapq import *
from collections import *

def lcm(a, b):  
    return (a*b)/gcd(a, b)

class InputHelper:
    def __init__(self):
        self.myinput = fileinput.input()

    def isLocal(self):
        return not fileinput.isstdin()

    def int(self):
        return int(self.myinput.readline().rstrip())

    def ints(self):
        return [int(_) for _ in self.myinput.readline().rstrip().split()]

    def str(self):
        return self.myinput.readline().rstrip()

    def strs(self):
        return [_ for _ in self.myinput.readline().rstrip().split()]

class OutputHelper:
    def int(self, a):
        print(a)    

    def ints(self, a):  
        print(" ".join([str(_) for _ in a]))
    
    def intsNL(self, a):
        for _ in a:
            print(_)
    
    def str(self, s):
        print(s)

    def strs(self, s):
        print(" ".join([_ for _ in s]))

    def strsNL(self, s):
        for st in s:
            print(st)

class ListNode:
    def __init__(self, val):
        self.val = val
        self.next = None
        self.prev = None

In = InputHelper()
Out = OutputHelper()



A, B, N = In.ints()

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

Out.int(res)
        


if len(sys.argv)>2 and sys.argv[2]=="TIMEIT":
    fin = (time.time()-startTimeProblem)*1000
    print("{:.2f}".format(fin) + "ms")