peterverebics/CodeNet_Python_118 huggingface dataset:
from collections import defaultdict,deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp():
    '''
    一つの整数
    '''
    return int(input())
def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


a, b, n = inpl()
x=min(b-1,n)
ans = a * x // b
print(ans)
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()
#!/usr/bin/env python3
def main():
    import sys

    input = sys.stdin.readline

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

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


if __name__ == '__main__':
    main()
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))
a,b,n = map(int,input().split())
x = max(1,min(b-1,n))
print(int(a*x/b)-a*int(x/b))
a, b, n = map(int, input().split())

if n >= b-1:
    x = b-1
else:
    x = n
print((a*x)//b - a * (x//b))
A, B, N = [int(i) for i in input().split()]
if B == 1:
    max = 0
elif B > N:
    x = N
    max = ((A * x) // B) - A * (x // B)
else:
    x = N
    maxn = ((A * x) // B) - A * (x // B)
    x = B * (N // B) - 1
    maxx = ((A * x) // B) - A * (x // B)
    if maxx > maxn:
        max = maxx
    else:
        max = maxn

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

x = min(b-1, n)
print((a*x)//b)
def nasu(a, b, x):
  return (a * x) // b - (x // b) * x

A, B, N = list(map(int, input().split()))
if B == N:
  print(nasu(A, B, N - 1))
elif B > N:
  print(nasu(A, B, N))
else:
  print(nasu(A, B, B - 1))
def resolve():
    A, B, N = map(int, input().split())
    print(A * min(N, B - 1) // B)


resolve()
a,b,n=map(int,input().split())
print(a*min(b-1,n)//b)
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)))
a, b, n = map(int, input().split())
def func(i, j, k):
    return (i*k)//j - i*(k//j)
m = min(n, b-1)
r = (a*min(n, b-1)) // b
while ((a*m) // b) == r:
    m -= 1
print(func(a, b, m+1))
a, b, n = map(int, input().split())

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

print((a * x) // b)
import math
 
A,B,N = map(int,input().split())

p=min(N,B-1)
ans =math.floor(A*p/B)-A*math.floor(p/B)

print(ans)
import sys
import numpy as np
import math
from collections import deque 
from functools import reduce

# input = sys.stdin.readline

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


if __name__ == '__main__':
    solve()
A, B, N = map(int, input().split())
x = min(B - 1, N)
print(A*x//B - A*(x//B))
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)))
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)
a,b,n = [int(i) for i in input().split()]
x = min(n,b -1)
ans = (a*x)//b
print(ans)
#!/usr/bin/env python3
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)))
import sys
input = sys.stdin.readline

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

if n >= b - 1:
    print((a*(b - 1)//b) - (a*((b - 1)//b)))
else:
    print((a*n//b) - (a*(n//b)))
A,B,N = map(int,input().split())
x = min(B-1,N)
ans = int(A*x/B) - A*int(x/B)
print(ans)
a,b,N = map(int,input().split())
x =b-1
if x<N:
        print(int(a*x/b)-a*int(x/b))
else:
    x=N
    print(int(a*x/b)-a*int(x/b))
a,b,n=map(int,input().split());print(a*min(b-1,n)//b)
a, b, n = map(int, input().split())

c = int(a*n/b) - a*int(n/b)

if n < b:
    print(c)
else:
    c = int(a*(b-1)/b) - a*int((b-1)/b)
    print(c)
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)
a,b,n = map(int,input().split())
ans = 0
ans = max(int(a*n/b) - a*int(n/b),ans)
if b == 1:
    print(0)
else:
    for k in range(1,n//(b-1)+1):
        ans = max(int(a*(k*b-1)/b) - a*int((k*b-1)/b),ans)
        if ans == a:
            print(ans)
            break
    if ans != a:
        print(ans)
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()
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)
A, B, N = map(int, input().split())
i = (N // B) * B
  
i = i - 1
if i < 0:
  ans = (A * N) // B - A * (N // B)
else:
  ans = (A * i) // B - A * (i // B)
  
print(ans)
a, b, n = map(int, input().split())
x = min(b - 1, n)
print(int(a * x / b) - a * (x // b))
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

a,b,n=n1()

if b<=n:
    i=b-1
else:
    i=n
m=(a*i)//b-a*(i//b)
print(m)
# coding: utf-8


def main():
    A, B, N = map(int, input().split())
    
    if N >= B-1:
        return (A*(B-1))//B - A*((B-1)//B)
    
    return (A*N)//B - A*(N//B)


print(main())
a,b,m = map(int,input().split())
best = min(b-1,m)

ans = a*(best/b)//1
print(int(ans))
A,B,N = map(int, input().split())

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

print(int( math.floor(A*x/B)-A*math.floor(x/B)  ))
def solve():
    if n >= b:
        print((b-1)*a//b)
    else:
        print((a*n)//b- a*(n//b))
    return


# n = int(input())
a, b, n = [int(s) for s in input().split(" ")]
solve()
import math
a,b,n = map(int,input().split())
c = min(n,b - 1)
ans = math.floor(a * c / b) - a * math.floor(c / b)
 
print(ans)
import math

def main():
    A, B, N = map(int, input().split(" "))
    max_score = -float("inf")

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

if __name__ == "__main__":
    main()
import math
A,B,N = map(int, input().split())

mf=math.floor
if N<B-1:
    q=mf(A*N/B)-A*mf(N/B)
    print(q)
else:
    a=math.floor(A*(B-1)/B)
    print(a)
import numpy as np

s=input().split(' ')
A,B,N=int(s[0]),int(s[1]),int(s[2])

def f(x):
    a=np.floor(A*x/B)-A*np.floor(x/B)
    return a.astype(int)

if N<B-1:
    print(f(N))
else:
    print(f(B-1))
input_ABN = input().split(' ')
A = int(input_ABN[0])
B = int(input_ABN[1])
N = int(input_ABN[2])

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

from math import floor

x = min(b-1, n)

ans = floor(float(a*x/b)) - a*floor(float(x/b))
print(ans)
import sys
import math

sys.setrecursionlimit(10 ** 7)

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

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

ans = 0

if N < B - 1:
    ans = math.floor(A * N / B) - A * math.floor(N / B)
else:
    c = B - 1
    cnt = 1
    while c <= N:
        cnt += 1
        t = math.floor(A * c / B) - A * math.floor(c / B)
        ans = max(ans, t)
        c += B
        if B < cnt:
            break

print(ans)
import math

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

if n >= b-1:
    print(math.floor(a*(b-1)/b))
else:
    print(math.floor(a*n/b) - a*math.floor(n/b))
A, B, N = map(int, input().split(' '))

x = min(B - 1, N)

print(int(A * x / B))
import math
a,b,n=map(int,input().split())
if n>=b:x=b-1
else:x=n
print(math.floor(a*x/b)-a*math.floor(x/b))
def main():
    a,b,n = map(int,input().split(" "))
    p = a//b
    q = a%b

    if n < b:
        print(p*n+int(q*n/b))
    else:
        print(p*(b-1)+int(q*(b-1)/b))
main()
A, B, N = map(int, input().split())

x = min(N, B - 1)
print(A * x // B)
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)
import math
a, b, n = list(map(int, input().split()))
output = 0
if n < b:
  output = math.floor(a * n / b)
else:
  output = math.floor(a * (b-1) / b)
print(output)
# x % B = q として、 q をできるだけ大きくすると qA//B が解
A, B, N = map(int, input().split())
q = min(B-1, N)
print(q*A//B)
#!/usr/bin/env python3

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


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

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

print(a*x//b - a*(x//b))
a, b, n = map(int, input().split())
if n < b:
	print(int(a*n/b))
else:
	print(int(a*(b-1)/b))
a,b,n=map(int,input().split());print(a*min(n,b-1)//b)
A, B, N = list(map(int, input().split()))
x = B-1
if x > N:
    x = N
print(A * x // B - A * (x // B))
A,B,N = map(int, input().split())
#ans = 0
#for x in range(N+1):
    #print(x,(A*x)//B - A*(x//B))
    #if ans < (A*x)//B - A*(x//B):
    #    ans = (A*x)//B - A*(x//B)
if B-1 > N:
    x = N
else:
    x = B -1

print((A*x)//B - A*(x//B))
import sys
from math import sqrt, floor

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


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


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


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

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


if __name__ == "__main__":
    main()
A, B, N = map(int, input().split())
c = 0
x = B-1
if x <= N:
    ans = (A*x) // B - A * (x // B)
else:
    ans = (A*N) // B - A * (N // B)
print(ans)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

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

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


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


if B == 1 or A == 1:
    print(0)
else:
    print(f(B-1) if N >= B else f(N))
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

a,b,x=MAP()

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

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

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

if B - 1 <= N:
    bunshi = math.floor(A * (B - 1)) // B
    bunbo = A * math.floor((B - 1) // B)
    print(bunshi - bunbo)
else:
    bunshi = math.floor(A * N) // B
    bunbo = A * math.floor(N // B)
    print(bunshi - bunbo)
a, b, n = map(int, input().split())
import math
ans = 0
if b - 1 <= n:
    x = b - 1
    ans = math.floor(a * x / b)
else:
    x = n
    ans = math.floor(a * x / b) - a * math.floor(x / b)
    #print(1, ans)
print(ans)
import math
a,b,n = map(int, input().split())
if n >= b-1:
    print(math.floor(a*(b-1)/b))
else:
    print(math.floor(a*n/b))
a,b,n = map(int, input().split())

mx = a*n//b
if n//b < 1:
    print(mx)
else:
    x = (a*b-a)//b
    print(x)
from sys import stdin
input = stdin.readline

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

if B > N:
    tmp = N / B
else:
    tmp = (B - 1) / B

ans = tmp * A
print(int(ans))
a,b,n=map(int,input().split())
def f(x):
    return ((a*x)//b)-a*(x//b)
if n<b:
    print(f(n))
elif n==b:
    print(f(n-1))
elif n>b:
    t = n
    u = b - 1
    print(max(f(t),f(u)))
a,b,n = map(int,input().split())
c = min(b-1,n)
print(a*c//b)
a, b, n = map(int, (input().split()))
print(a * min(n, b - 1) // b)
A,B,N = map(int,input().split())

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

print(int(A*r/B))
import math
a, b , n = map(int, input().split())

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

ans = 0
for i in range(b, b - 10*3, -1):
    ans = max(math.floor(a * (b-1) / b) - a * math.floor((b-1) / b), ans)
print(ans)
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()
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(input())

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

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

INF = float('inf')

from math import floor

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

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


if __name__ == '__main__':
    solve()
A,B,N=map(int,input().split())
f=lambda x:(A*x)//B-A*(x//B)
print(f(B-1 if B-1<=N else N))
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()))
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)))
import sys
import math  # noqa
import bisect  # noqa
import queue  # noqa


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


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

    if N < B:
        res = (A * N) // B
        return print(res)

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


if __name__ == '__main__':
    main()
a,b,n = map(int, input().split())
if b-1 < n:
    n = b-1
print(a*(n)//b - a*((n) // b))
A,B,N=map(int, input().split())
answer=0
import math
if N < B:
    print(int(math.modf(N/B)[0]*A))
else:
    apple=min(B,N)
    startnum = B-1 if B>1 else 1
    for i in range(startnum,apple+1):
        newans=math.modf(i/B)[0]*A
        newans//=1
        answer=newans if newans>answer else answer
    print(int(answer))
def func(a,b,x):
    return ((a*x)/b)//1-a*((x/b)//1)

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

print(int(func(a,b,x)))

# tp = 0
# for i in range(1,n+1):
#     tpp = func(a,b,i)
#     if tpp > tp:
#         tp = tpp
# print(tp)
A, B, N = list(map(int, input().split()))
n = min(N, B-1)
ans = int(A*n/B) - A * int(n/B)
print(ans)
A, B, N = [int(x) for x in input().split()]
best = (A * (min(N, B - 1) % B)) // B
print(best)
def main():
    A, B, N = map(int, input().split())
    x = min(B - 1, N)
    ans = A * x // B - A * (x // B)
    print(ans)
    
    
if __name__ == '__main__':
    main()
A,B,N = map(int,input().split())
import math

if N>=B:
  x = B-1
  print(int(math.floor(A*x/B) - math.floor(x/B)*A))
else:
  print(int(math.floor(A*N/B) - math.floor(N/B)*A))
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)
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))
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))
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()
A, B, N = map(int, input().split())
ans = 0
if ((B == 1) or (A == 1)):
  ans = 0
elif (N < B):
  z = N
  p = (((A * z) / B) // 1)
  q = A * ((z / B) // 1)
  ans = p - q
else:
  z = B - 1
  p = (((A * z) / B) // 1)
  q = A * ((z / B) // 1)
  ans = p - q
print(int(ans))
import sys
a, b, n = [int(i) for i in sys.stdin.readline().split()]
x = min(b-1, n)
print(int(x / b * a) - int(x / b) * a)
A,B,N = map(int, input().split())
x = min(N, B-1)
d = x/B - int(x/B)
ans = int(A*d)
print(ans)
A,B,N = map(int,input().split())
x = min(B-1,N)
print((A*(x)//B)-(A*((x)//B)))
a, b, n = map(int, input().split())

if b == 1:
    r = [0]
else:
    i = 0
    r = [int((a*n)/b)-a*int(n/b)]
    while b*i-1 <= n:
        r.append(int((a*(b*i-1))/b)-a*int((b*i-1)/b))
        i += 1
print(max(r))
import sys
a, b, n = map(int, sys.stdin.readline().split())
if b-1 >= n:
  s = (a*n)//b - a*(n//b)
else:
  s = (a*(b-1))//b - a*((b-1)//b)
print(s)
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()
A, B, N = map(int, input().split())
if N < B:
    print((A*(N))//B - A*((N)//B))
else:
    print((A*(B-1))//B - A*((B-1)//B))
#わかんなかった
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)))
import math

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

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

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

print(ans)
a,b,c=map(int,input().split())
if c>= b:
    print((a*(b-1))//b)
else:
    print((a*c)//b)
a,b,n = map(int,input().split())
import math
if n < b:
    print(int(math.floor(a*n/b) - a*math.floor(n/b)))
else:
    print(int(math.floor(a*(b-1)/b) - a*math.floor((b-1)/b)))
A, B, N = map(int, input().split())
x = min(B-1, N)
print(A*x//B - A*(x//B))
import math

a, b, n = list(map(int, input().split()))
x = min(n, b - 1)
ans = math.floor((a * x) / b) - a * math.floor(x / b)
print(ans)
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))
a, b, n = [int(x) for x in input().split()]
def f(x):
  return a*x//b - a *(x//b)
print(f(min(b - 1, n)))
import math
A, B, N = map(int, input().split())

if N // B == 0:
    f, _ = math.modf(N / B)
    ans = math.floor(A * f)
else:
    n = (N // B) * B - 1
    f1, _ = math.modf(n / B)
    f2, _ = math.modf(N / B)
    f = max(f1, f2)
    ans = math.floor(A * f)

print(ans)
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))
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))
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))
import math
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)

A,B,N = nm()
q = min(B-1,N)
print(A*q // B)
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(x1, x2)
print(ans)
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

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

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

ans = int(A * ans_n / B) - A * int(ans_n / B)
print(ans)
import math
a, b, n = map(int, input().split())
if b <= n:
    print(math.floor((a * (b-1)) / b) - a * math.floor((b-1) / b))
elif b > n:
    print(math.floor((a * (n)) / b) - a * math.floor((n) / b))
X=list(map(int, input().split()))
A=X[0]
B=X[1]
N=X[2]

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

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

print(calc(min(N,B-1)))
def main():
    a, b, n = [int(e) for e in input().split()]

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

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


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

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

print(f(a, b, min(b-1, n)))
# -*- coding: utf-8 -*-
import math

in_a = list(map(int, input().split()))
A = in_a[0]
B = in_a[1]
N = in_a[2]

ans = 0

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

print(ans)
from math import ceil #切り上げ
import numpy as np
 
def inp(): return int(input()) #一個だけ読み取り
def inpm(): return map(int,input().split()) #mapオブジェクトで呼び出し
def inpl(): return list(map(int, input().split())) #数字リストをintで
def inpls(): return list(input().split()) #リストをstrで

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


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