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

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

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


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

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

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7 
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    a, b, n = map(int,input().split())
    def f(x):
        return (a * x) // b - a * (x // b)

    if n < b:
        print(max(f(x) for x in range(max(0, n - 3), n + 1)))
    else:
        print(max(f(x) for x in range(max(0, b - 3), b + 1)))
resolve()

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

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

x = min(N, B - 1)

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

print(ans)

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

Solution (Python):
a,b,n=map(int,input().split())
ans=0
if a<b:ans=(a*(min(b-1,n)))//b-a*(min(b-1,n)//b)
for i in range(1,min(a+10,n+1)):ans=max(ans,(a*i)//b-a*(i//b))
print(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 sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

Solution (Python):


import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

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

if __name__ == "__main__":
    main()

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


import sys
readline = sys.stdin.readline
read = sys.stdin.read


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

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

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

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

Solution (Python):
input = raw_input

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

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


print(out)

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

Solution (Python):
from math import ceil, floor

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

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

print(ans)

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

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

saidai=min(b-1,n)

print((a*saidai)//b)

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

Solution (Python):
def examA():
    K = I()
    A, B = LI()
    for i in range(A,B+1):
        if i%K==0:
            print("OK")
            return
    print("NG")
    return

def examB():
    X = I()
    now = 100
    ans = 0
    while(now<X):
        ans += 1
        now += now//100
    print(ans)
    return

def examC():
    N, M, Q = LI()

    ans = 0
    print(ans)
    return

def examD():
    A, B, N = LI()
    if N>=B-1:
        ans = (A*(B-1))//B
    else:
        ans = (A*N)//B
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examD()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

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

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

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

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



if N>=B-1:
    print(calc(B-1,A,B))
else:
    print(calc(N,A,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):
A,B,N = map(int,input().split())

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

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

Solution (Python):
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 =  list(map(int, input().split()))
i = min(b - 1, n)
print(int(a * i / b) - a * int(i / 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())
if b-1<=n:
  x=b-1
else:
  x=n
print((a*x)//b-a*(x//b))

Solution (Python):
A,B,N = map(int,input().split())
if B >= N + 1:
    print(A * N // B)
else:
    print(A * (B-1) // 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())
x=min(n,b-1)
l=(a*x)//b
r=a*(x//b)
print(l-r)

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

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

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

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

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

Solution (Python):


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


if __name__ == '__main__':
    main()

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

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

stdin = sys.stdin

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






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

Solution (Python):
mod = 1000000007
eps = 10**-9


def main():
    import sys
    import math
    input = sys.stdin.readline

    a, b, N = map(int, input().split())
    if N < b:
        print(math.floor(a * N / b))
    else:
        print(math.floor(a * (b-1) / b))


if __name__ == '__main__':
    main()

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

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

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

if __name__ == "__main__":
    main()

Solution (Python):
from collections import defaultdict
import sys
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7
input = sys.stdin.readline


def inp():
    return int(input())


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


A, B, N = inpl()


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


ans = -1

for a in range(1, A + 5):
    x = B * a - 1
    if x > N:
        break
    tmp = calc(x)
    ans = max(ans, tmp)


if ans == -1:
    if N <= A:
        for x in range(N + 1):
            ans = max(ans, calc(x))
    else:
        ans = calc(N)

print(ans)

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

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

Solution (Python):


import sys
import math




















def main():
    mod = 1000000007                
    inf = float('inf')              
    inf = 2 ** 64 - 1               
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    a, b, n = mi()

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



if __name__ == "__main__":
    main()

Solution (Python):
import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]
def init_dp1(init, N): return [init for _ in range(N)]
def init_dp2(init, N, M): return [[init for _ in range(M)] for _ in range(N)]


class V:
    def __init__(self, f, v=None):
        self.f = f
        self.v = v
 
    def __str__(self):
        return str(self.v)
 
    def ud(self, n):
        if n is None:
            return

        if self.v is None:
            self.v = n
            return
        self.v = self.f(self.v, n) 


def main():
    A, B ,N = read_values()
    print((A * min(N, B - 1)) // B)


if __name__ == "__main__":
    main()

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

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

Solution (Python):
import sys

sys.setrecursionlimit(10**7)
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
printn = lambda x: print('\n'.join(x))

a, b, n = nm()
if b-1 < n:
    c = (a-1)//b + 1
    print(a - c)
else:
    print(a*n//b - a*(n//b))

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