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

if n < b:
    ans = a * n // b  
    print(ans)
    sys.exit()  
elif n == b:
    ans = a * (b-1) // b
    print(ans)
    sys.exit()


r = n // b
ans = 0




    

t = r * b - 1
ans_t = a * t // b - (a * (r - 1))
ans = max(ans, ans_t) 

ans_t = a * n // b - (a * (n // b))
ans = max(ans, ans_t) 

print(ans)

Solution (Python):
"""
- floor function
- xは(0<=x<=B-1 && x<=N)を満たす最大数
"""
a,b,n=map(int,input().split())
 
x=min(n,b-1)
print((a*x)//b-a*(x//b))

Solution (Python):
from decimal import Decimal
import math
a,b,n = map(str,input().split())

a = Decimal(a)
b = Decimal(b)
n = int(n)
ans = 0
kouho = [min(b-1,n)]
for x in kouho:
    tmp = math.floor((a*x)/b) - a*math.floor(x/b)
    ans = max(ans,tmp)
print(ans)

Solution (Python):
"""
- floor function
"""
a,b,n=map(int,input().split())

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

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

A,B,n=map(int,input().split())
print(f(A,B,B-1)) if n>=B-1 else print(f(A,B,n))

Solution (Python):
import math
A,B,N = list(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)-A*math.floor((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):
import sys
from functools import lru_cache
from collections import defaultdict
inf = float('inf')
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**6)
def input(): return sys.stdin.readline().rstrip()
def read():
  return int(readline())
def reads():
  return map(int, readline().split())

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

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

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

print(ans)

Solution (Python):
import math

A, B, N = [int(x) for x in input().split()]
count = min(B-1, N)
a = math.floor(float(A*count)/B) - A * math.floor(float(count)/B)
print(a)

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

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

print(res)

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




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

Solution (Python):

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

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



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

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):
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

a,b,n=nm()

import math

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

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

Solution (Python):

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

Solution (Python):
import sys
from sys import stdin


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


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

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

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

if n < b - 1:
    max = f(n)
elif b == 1:
    max = 0
else:
    x = b - 1
    max = f(x)
    while x <= n:
        if max < f(x):
            max = f(x)
        x += b

print(max)

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

import time
import math

sys.setrecursionlimit(10 ** 7)

from collections import defaultdict

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

x = min(b - 1, n)





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

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

Solution (Python):
import math
import sys
x=input()
x0=x.split()
a=int(x0[0])
b=int(x0[1])
n=int(x0[2])
b0=n%b
b1=0
q1=0
if b==1:
    print(0)
    sys.exit()
for i in range(1,math.floor(n/b)+1):
    b1=b*i-1
    q1=max(q1,math.floor(a*b1/b)-a*math.floor(b1/b))
q2=math.floor(a*b0/b)-a*math.floor(b0/b)
print(max(q1,q2))

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

Solution (Python):
from math import floor

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

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

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

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

'''
print(x)
'''

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

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

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):
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) - a * math.floor((b-1) / b))

Solution (Python):
import math

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

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

Solution (Python):

import sys


def solve(A: int, B: int, N: int):
    if A == 1: return 0

    if N < B:
        x = N
    else:
        md = N % B
        x = int(N - (md + 1))
    return int((A*x)//B) - A * int(x//B)

    
    
    
    
    



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))  
    
    print(solve(A, B, N))

if __name__ == '__main__':
    main()

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


if B < N:
    Max = int(A*(B-1)/B)
    X = int(N/B)
    fx = int(A*(B*X-1)/B) - A * int((B*X-1)/B)
    
    
    
    
elif B == N:
    Max = int(A*(B-1)/B)
else:
    Max = int(A*N/B)
print(Max)

Solution (Python):
import sys
from io import StringIO
import unittest
import math



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


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """5 7 4"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """11 10 9"""
        output = """9"""
        self.assertIO(input, output)


if __name__ == "__main__":
    
	resolve()

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

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

print(ans)

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

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

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

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

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

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

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

Solution (Python):
import math

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

Solution (Python):
A,B,N = map(int,input().split())
if N >= B:
    N = B - 1
ans = int(A * N / B) - A * int(N / B)
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):
import sys
def input():
    return sys.stdin.readline()[:-1]


def main():
    A, B, N = map(int,input().split())
    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())
import math
def f(x):
    return math.floor(A*x/B) - A*math.floor(x/B)


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

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

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

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

    res=floor(res_x,A,B)
    print(res)

if __name__=="__main__":
    main()

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

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

Solution (Python):
a,b,n=map(int,input().split())
score=0
if (n<b):
    print( int(a*n/b))
elif(b==1):
    print(0)
else:
    c = int(n/b)
    score = 0
    for i in range(1,c+1):
        n_ = b*i-1
        t = int(a*n_/b)-a*int(n_/b)
        score = max(score,t)
    t = int(a*n/b)-a*int(n/b)
    score = max(score,t)
    print(score)

Solution (Python):
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  
  
  
  a,b,n=LI()
  x=min(n,b-1)
  return math.floor(a*x/b)-a*math.floor(x/b)


print(main())

Solution (Python):










from math import floor


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


if __name__ == '__main__':
    solve()

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

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

print(max_value)

Solution (Python):

from math import floor

def parse():
  return map(int, input().split(" "))

def main():
  A, B, N = parse()
  
  x = B - 1 if B - 1 <= N else N
  print(floor((A * x) / B) - A * floor(x / B))
  exit(0)

  limit_N = 5000000
  N = limit_N if N > limit_N else N

  x = 0
  max_val = floor((A * x) / B) - A * floor(x / B)

  for x in range(1, N + 1):
    val = floor((A * x) / B) - A * floor(x / B)
    if max_val < val:
      max_val = val

  print(max_val)


if __name__ == "__main__":
  main()

Solution (Python):
from sys import stdin
input = stdin.readline
 
a,b,n = map(int,input().split())
maxpoint = 0
 
if b > n  :
    tmp = int((a * n) / b)  - a * int(n/b) 
    maxpoint = max(tmp,maxpoint)
else:
    k = int(n/b)*b -1
    maxpoint =  int((a * k) / b)  - a * int(k/b) 
    if b == 1:
        maxpoint = 0
 
print(maxpoint)

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

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

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

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

x = (n//b)*b - 1

if x == -1:
    x = n

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

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

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

Solution (Python):
import math

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

x = 0
if N < B:
    x = N
else:
    x = 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-1, N)//B)

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

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

Solution (Python):
from math import floor

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

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

if x == -1:
    x = n

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

Solution (Python):
import sys
import math


def solve(a: int, b: int, n: int) -> int:
    x = min(n, b - 1)
    return math.floor(a * ((x / b) - int(x / b)))


def main():
    input = sys.stdin.buffer.readline
    a, b, n = map(int, input().split())
    print(solve(a, b, n))


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
import sys
from collections import deque
import copy
import math
def main():
    A, B, N = map(int, input().split())
    if B - 1 <= N:
        x = B - 1
    else:
        x = N
    ans = math.floor(A * x / B) - A * math.floor(x / B)
    print(ans)


if __name__ == '__main__':
    main()

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

Solution (Python):
import math

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

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

print(func(A,B,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 = list(map(int, input().split()))
def f(x):
    return a*x//b - a*(x//b)

left=1
right=n
for _ in range(100):
    delta=(right-left)/3
    midl=left+delta
    midr=midl+delta

    if f(midl)>f(midr):
        right=midr
    else:
        left=midl
print(max(f(int(midl)),f(min(int(midl)+1,n))))

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

f=lambda x: (A*x)//B+A*(x//B)

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

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

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

def main():
    a, b, n = map(int, readline().split())
    if n < b:
        print(f(n, a, b))
    else:
        print(f(b-1, a, b))
if __name__ == '__main__':
    main()

Solution (Python):
from math import floor
from sys import stdin
A, B, N = [int(_) for _ in stdin.readline().rstrip().split()]
def solve(x):
    return floor(A*x/B)-A*floor(x/B)
print(solve(min(B-1, N)))

Solution (Python):
def solve(a, b, n):
    return a * min(b-1, n) // b - a * (min(b-1, n) // b)


def solve_baka(a, b, n):
    ans = -1e9
    for x in range(n+1):
        ans = max((a * x) // b - a * (x//b), ans)
        print('    ', x, (a * x) // b - a * (x//b))
    return ans


def main():
    a, b, n = [int(v) for v in input().split()]
    print(solve(a, b, n))


if __name__ == '__main__':
    main()

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

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):
from math import floor

A, B, N = map(int, input().split())
i = min(B - 1, N)
f_i = floor(A * i / B) - A * floor(i / B)

print(f_i)

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

if n <= b - 1:
    x = n
else:
    x = n - (n%b + 1)

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

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


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


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

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


if __name__ == '__main__':
    main()

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

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

print(ans)

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

Solution (Python):

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

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

def ma(k):
    s = a * k / b
    t = k / b
    ss = s // 1
    tt = (t // 1) * a
    return ss - tt

if(n < b):
    print(str(int(ma(n))))
else:
    print(str(int(ma(b-1))))

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

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

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

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

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

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

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

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

if __name__ == "__main__":
    main()

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(n,b-1)
print(int(a*x/b)-a*int(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):
import numpy as np


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

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


if __name__ == "__main__":
    main()

Solution (Python):
import sys
import math

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

a, b, n = nm()

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

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



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

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):
def f(x):
    return int(A*x/B) - A*int(x/B)

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

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

if x == -1:
    x = n

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

Solution (Python):
import math
A,B,N = map(int,input().split())
siki = 0
k = math.floor(N/B)
m = k*B
if (B-1) <= N:
    siki = math.floor((A*(B-1))/B)-A*math.floor((B-1)/B)
elif B>N:
    siki = math.floor((A*N)/B)-A*math.floor((N/B))

print(siki)

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

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

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

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

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

print(A * ans //B)

Solution (Python):
from math import floor

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

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

Solution (Python):
from math import floor
A, B, N = map(int, input().split())
print(floor(A*min(B-1, N)/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):
A, B, N = list(map(int, input().split()))
n = min(N, B-1)
ans = int(A*n/B) - A * int(n/B)
print(ans)

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

Solution (Python):
def floor(N):
    return int(N)
A, B, N = list(map(int, input().split()))
result = 0


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

Solution (Python):
from sys import stdin, setrecursionlimit


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

    x = min(b - 1, n)

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


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Solution (Python):
from sys import stdin, setrecursionlimit


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

    ans = 0

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

    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

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

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

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

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

def floor(t):
    return int(t)

list = []

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

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

def calc(a,b,c):
    print(math.floor(a * c / b) - a * math.floor(c / b))

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

calc(a,b,c)

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

Solution (Python):
from math import floor

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

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

Solution (Python):
def floor(a):
    return int(a)

if __name__ == '__main__':
    abn = input()
    abn = abn.split()
    a = int(abn[0])
    b = int(abn[1])
    n = int(abn[2])

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

    print(ans)

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

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

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

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

Solution (Python):
import math

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

Solution (Python):
def solve(string):
    a, b, n = map(int, string.split())
    return str(a * n // b) if b > n else str(a * (b - 1) // b)


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Solution (Python):
def solve(string):
    a, b, n = map(int, string.split())
    return str(a * (b - 1) // b) if b <= n else str(a * n // b)


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Solution (Python):
A, B, N = [ int(i) for i in input().strip().split(' ')]
max_floor = 0
if B > N:
    max_floor = int(A * N / B) - A * int(N/B)
    print(max_floor)
else:
    floor = int(A * (B-1) / B) - A * int((B-1)/B)
    if max_floor < floor:
        max_floor = floor
    print(max_floor)

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

def floor(x):
  return x//1

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

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

Solution (Python):
import math

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

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

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

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

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

def floor(t):
  return math.floor(t)

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

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

Solution (Python):
from math import floor


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


if __name__ == '__main__':
    main()

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

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

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

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

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

if n < b:
    score = math.floor(a*n/b) - a * math.floor(n/b)
    print(score)
    
else:
    max_score = -10000
    for i in range(1,10):
        x = (b-1)*i
        score = math.floor(a*x/b) - a * math.floor(x/b)
        max_score = max(max_score, score)
    print(max_score)

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

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

else:
    print(int(A * N/B))

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

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

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

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

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

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

from math import floor








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

print(ans)

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

x =min(N,B-1)

result=int(A*x/B)-A*int(x/B)

print(result)

Solution (Python):
a,b,n=map(int,input().split())
if n>=b-1:
  x=b-1
else:
  x=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):
from sys import stdin
input = stdin.readline

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

x1 = max(n - n % b - 1, 0)
x2 = n
ans = max(((a * x1) // b) - (a * (x1 // b)), ((a * x2) // b) - (a * (x2 // b)))


print(ans)

Solution (Python):
def main():
    A, B, N = [int(x) for x in input().split()]
    if N >= B-1:
        return A*(B-1)//B
    return A*N//B


print(main())

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

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


print(ans)

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

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

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

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

w=min(n,b-1) 
ma=f(w)
print(ma)

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

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

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

Solution (Python):
import math

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

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

Solution (Python):


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

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

Solution (Python):

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

def ans(x):
    return math.floor(a*x//b) - a*math.floor(x//b)
print(ans(min(b-1, n)))

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

if B == 1:
  print(0)
else:
  if N >= B-1:
    x = math.floor(A-A/B)
    y = A - math.ceil(A/B)
    ans = max(x,y)
    print(ans)
  else:
    print(math.floor(A*N/B))

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