peterverebics/CodeNet_Python_118 huggingface dataset:
import math

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

max_value = 0
x = B - 1
if x > N:
    x = N
max_value = math.floor(A * x / B) - A * math.floor(x / B)
# for x in range(1, N+1):
#     value = math.floor(A * x / B) - A * math.floor(x / B)
#     print("X:", x, "value:", value)
#     max_value = max(max_value, value)

print(max_value)
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 int(t * a / b)
print m
"""
a, b, n = map(int, input().split())

mx = 0

nn = n//b

mm = (a*n)//b - a*(nn)

if nn > 0:
    x = b*nn-1
    mx = (a*x)//b - a*(nn-1)
    mm = max(mm, mx)
    
print(mm)
def f(x):
    return (A*x)//B-A*(x//B)
    
A, B, N = map(int, input().split())
print(f(min(B-1, N)))
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)
import sys
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

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

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

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

cur = min(n, b - 1)
print(a * cur // b)
A, B, N = map(int, input().split())
answer = 0
if B > N:
    mae = (A*N)//B
    usiro = A*(N//B)
    l = mae-usiro
else:
    i = (B-1)
    mae = (A*i)//B
    usiro = A*(i//B)
    l = mae-usiro
print(l)
a, b, n = map(int, input().split())
print(int((a*(min(n,b-1)%b)-(a*min(n,b-1))%b)/b))
import math
A,B,N = map(int,input().split())
s = min(B-1,N)
print(math.floor((A*s)/B)-A*(math.floor(s/B)))
a,b,n=map(int,input().split())
l=[]
m=a//b
if b==1:
    print(0)
    exit()
if n>=b:
    for x in range(b-1,n+1,b):
        y=a*x//b-a*(x//b)
        #l.append(y)
        m=max(m,y)
    x=n
    y=a*x//b-a*(x//b)
    m=max(m,y)
else:
    x=n
    y=a*x//b-a*(x//b)
    #l.append(y)
    xx=n-1
    yy=a*xx//b-a*(xx//b)
    m=max(y,yy)


print(m)
import sys
readline = sys.stdin.readline

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

k = min(B - 1, N)
ans = (A * k - A * k % B) // B
print(ans)
s = list(map(int, input().split()))
a = s[0]
b = s[1]
n = s[2]

if n >= b:
    n = b - 1

kotae = round(a * ((n / b) - (n // b)) - ((a * n / b) - ((a * n) // b)))

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

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

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

print(int(a*min(n,b-1)/b))
import sys
import math
from pprint import pprint

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

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

print(func(min(B-1, N)))
import sys
input = sys.stdin.readline

def main():

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

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

    num = n//b

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

if __name__ == '__main__':
    main()
a,b,n=map(int,input().split())
ans=0

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

if b>=n:
    ans=max(f(n),f(n-1))
elif a<b:
    ans = f(b-1)
print(ans)
A, B, N = map(int, input().split())

x = min(B - 1, N)
print((A * x) // B - A * (x // B))
from math import floor
def main():
    a, b, n= map(int, input().split())
    x = min(n, b - 1)
    r = floor((a * x) / b) - a * floor(x / b)
    print(r)

if __name__ == '__main__':
    main()
a, b, n = map(int, input().split())

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

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

x = min(B-1, N)

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

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

a,b,n = map(int, input().split())
i = min(n,b-1)
print(floor(a*i/b) - a*floor(i/b))
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
a,b,n = (int(i) for i in input().split())

#p = a//b
#q = a-b*p
#print(p,q)
#m=0
#for x in range(0,n+1):
#    m= max(m, (a*x // b - a* (x//b) ) )#, q*x//b,q*(x//b))
#    print((a*x // b - a* (x//b) ))
#print(m)
if n >= b:
    n=b-1
m = a*n // b - a* (n//b) 

print(m)
def solve():
    A,B,N = map(int,input().split())
    print(max(express(A,B,N), express(A,B,max(N//B*B-1,0))))

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

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

if  n >= b:
    r = b - 1
else:
    r = n
    
ans = (a * r) // b

print(ans)
from sys import setrecursionlimit, exit
setrecursionlimit(1000000000)

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

main()
a,b,n=map(int,input().split())
print((a*min(n,b-1))//b)
A, B, N = map(int, input().split())

if A == 1 or B == 1:
    print(0)
elif N >= B:
    print(A * (B-1) // B)
else:
    print(A * N // B)
# -*- coding: utf-8 -*-
a,b,n = list(map(int,input().split()))
ret = 0
if n >= b-1:
    ret = max(ret,int(a * (b-1) / b) - a * int((b-1)/b))
else:
    ret = max(ret,int(a * n / b) - a * int(n/b))
print(ret)
"""
- 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))
import math
a, b, n = map(int, input().strip().split())
x=min(b-1,n)
print(math.floor(a*x/b)-a*math.floor(x/b))
import math
A,B,N = map(int,input().split())
looked = min(B-1,N)
ans = (A*looked)//B - A*(looked//B)
print(ans)
#!/usr/bin/env Pypy3
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))
from collections import *
a,b,n = map(int,input().split())
ans = a*n//b - a*(n//b)
mb = (n//b)*b-1
if(mb > 0):
	ans = max(ans,a*mb//b - a*(mb//b))
mbb = min(n,b-1)
ans = max(ans,a*mbb//b - a*(mbb//b))
print(ans)
from sys import stdin
input = stdin.readline


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

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


if(__name__ == '__main__'):
  main()
import math

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

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

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

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

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

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

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

print((a*x)//b)
#設定
import sys
input = sys.stdin.buffer.readline

#ライブラリインポート
from collections import defaultdict

con = 10 ** 9 + 7
#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	A, B, N = getlist()
	if N < B:
		ans = int(A * N // B)
	else:
		ans = int(A * (B - 1) // B)
	print(ans)

if __name__ == '__main__':
	main()
import math
v = list(map(int, input().split()))
a, b, n = v[0], v[1], v[2]
if n <= b - 1:
	print(math.floor((a * n) / b))
else:
	print(math.floor((a * (b - 1)) / b))
import sys
import itertools
import math

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

i = min(B-1,N)


print(math.floor(A*i/B) - A * math.floor(i/B))
import math

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

x=min(N,B-1)

print(A*x//B-A*(x//B))
from math import floor
a, b, n = map(int, input().split())
x = 0

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

print(floor(a*x/b)-a*floor(x/b))
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))
a, b, n = map(int, input().split()) 
if b == 1 or a == 1: 
    print(0) 
else: 
    r = min(b-1, n) 
    s = (a * r) // b - a * (r // b)    
    print(s)
a,b,n = map(int,input().split())
if n//b==0:
    print((a*n)//b - a*(n//b))
else:
    print(a*(b-1)//b)
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))
a, b, n = list(map(int, input().split()))
if a == 1 or b == 1:
    print(0)
    exit()

if b <= n:
    k = n // b
    x = b * k - 1
else:
    x = n

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

def floor(x):
    return int(x)

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

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

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

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

#X=int(input())
# a=int(input())
A,B,N=map(int,input().split(" "))
#a=[int(_) for _ in input().split(" ")]

s=N//B

if s==0:
  x=N
else:
  x=s*B-1

if B==1:
  ans=0
  #print("B")
else:
  ans = int(x/B*A) - A * int(x/B)

print(ans)
a, b, n = map(int, input().split())
y = min(b-1, n)
ans = a*y//b - y//b * a
print(ans)
from math import floor
A,B,N = map(int,input().split())
def floor_1(x):
  return floor(A*x/B) - floor(x/B)*A
print(floor_1(min(N,B-1)))
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)
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))
a,b,n = map(int,input().split())
ans = 0
if n >= b:
    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 B-1>N:
    answer = (A*N/B)//1 - A*((N/B)//1)

else:
    answer = (A*(B-1)/B)//1 - A*(((B-1)/B)//1)

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

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

print(func(min(B-1, N)))
A,B,N=map(int, input().split())
print(A*min(B-1,N)//B)
a, b, n = map(int, input().split())

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

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

if n>=(b-1):
  print(int((a*(b-1)/b)//1))
else:
  print(int((a*n/b)//1))
A, B, N = map(int, input().split())
x = B - 1 if B - 1 <= N else N
print(A*x//B - A*(x//B))
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(N,B-1)))
from sys import stdin
#n = int(stdin.readline().rstrip())
#l = list(map(int, stdin.readline().rstrip().split()))
a,b,n = map(int, stdin.readline().rstrip().split())
#S = [list(map(int, stdin.readline().rstrip().split())) for _ in range(h)]#hの定義を忘れずに

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


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


A, B, C = map(int, input().split())
# for i in range(2*B):
#     print(math.floor(A*i/B)-A*math.floor(i/B))
if C < B:
    print(GetScore(A, B, C))
else:
    print(GetScore(A, B, B-1))
A,B,N = map(int,input().split())
x = min(N,B-1)
print(int(A*x/B))
A, B, N = map(int,input().split())
fivex = 0
i = 1
ans = 0
x = 0
# ans_x = -((-1)*A*N // B)
# if ans_x>N:
#     ans_x -= 1
# print(ans_x)
# print(int(A*ans_x/B)-A*int(ans_x/B))
while x <= B:
    x = -((-1)*i*B // A)
    if x > N:
        break
    now = i - A *  int(x / B)
    if now > ans and x <= N:
        # print(x)
        ans = now
    i += 1

print(ans)
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(int(ans))
A, B ,N = map(int,input().split())
if B-1 <= N:
    print(A*(B-1)//B)
else:
    print(A*N//B)
L=list(map(int,input().split()))
A=L[0]
B=L[1]
N=L[2]
if N>=B-1:
    print(int(A*(B-1)/B))
else:
    print(int(A*N/B))
import math

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

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

print(math.floor(A * x / B) - A * math.floor(x/B))
def read_int():
    return int(input())

def read_int_map():
    return map(int,input().split(' '))

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

def read_s_list_loop(n):
    return [input() for _ in range(n)]
import math
A,B,N = read_int_map()

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

'''
for i in range(1,N+1):
    print(i, math.floor(A*i/B)-A*math.floor(i/B))
'''
A,B,N=map(int,input().split())
x=min(B-1,N)
print(int(A*x/B)-A*int(x/B))
import math
A,B,N = (int(x) for x in input().split())
a = min(B-1,N)
ans = math.floor(A*a/B) - A*math.floor(a/B)
print(ans)
a,b,n = map(int,input().split())
if n<b:
  print((a*n)//b)
else:
  print((a*(b-1)//b))
import sys

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

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

#for x in range(1, 100):
	#print(x, f(x))

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

one = math.floor(ap * change / bp)
two = math.floor(change / bp)
answer = one - two * ap
print(answer)
a, b, n = map(int, input().split())

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

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


print((((a * x)//b)) )
from math import floor

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

max_v = 0
if n < b:
  max_v = floor(a * n / b)
else:
  if b != 1:
    for i in range(b - 1, n + 1, b):
      j = 0
      t = floor(a * i / b) - a * j
      if t > max_v:
        max_v = t
      j += 1
print(max_v)
A,B,N = map(int, input().split())

n = B - 1 if N >= B else N
print(A*n//B)
def calc(a, b, x):
    return (a * x) // b - a * (x // b)

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

if n < b:
    print(calc(a, b, n))
else:
    print(calc(a, b, b-1))
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))
print(math.floor(a* (x%b) / b))
l = list(map(int,input().split()))
a = l[0]
b = l[1]
n = l[2]

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

max = 0
if b == 1:
    max = 0
elif n <= b-1:
    max = floor(a,b,n)
elif n > b-1:
    for i in range(b-1,n+1,b):
        c = floor(a,b,i)
        if c >= max:
            max = c

print(max)
def main(a: int, b: int, n: int):
    ans = 0
    for i in (1, min(n, b - 1)):
        f = int((a * i) / b) - a * int(i / b)

        if ans < f:
            ans = f

    print(ans)


if __name__ == "__main__":
    a, b, n = map(int, input().split())
    main(a, b, n)
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))
import math
def f(x):
    return math.floor(A*x/B)

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

def main(A, B, N):
    x = min(B-1, N)
    answer = math.floor(A * x / B) - A * math.floor(x / B)
    print(answer)

if __name__ == '__main__':
    A, B, N = list(map(int, input().split()))
    main(A, B, N)
def target(x):
    return (A * x) // B - A * (x // B)


A, B, N = map(int, input().split())
print(target(min(B - 1, N)))
from math import floor

a,b,n=map(int,input().split())
ans=0
x=b-1
if x>=n:
    x=n
ans = floor(a*x/b) - 5*floor(x/b)
print(ans)
import sys
input = sys.stdin.readline

a, b, n = map(int, input().split())
def f(x: int) -> int: return ((a * x) // b) - (a * (x // b))
print(f(min(b-1, n)))
import math
def D():
    A, B, N = map(int, input().split())
    if N >= B:
        print(A*(B-1)//B - A*((B-1)//B))
        return
    x = N % B
    print(A*x//B - A*(x//B))
D()
a, b, n = map(int, input().split())
import math
c = math.floor(a*n/b)
d = math.floor(n/b)
e = a*d
f = math.floor(a*(b-1)/b)
g = math.floor((b-1)/b)
h = a*g
if n < b:
  print(c - e)
else:
  print(f - h)
from math import floor

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

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

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

    print((a - 1) - int((a - 1) / b))
A,B,N = map(int,input().split())
x = max(0,N//B*B-1)
cur1 = A*x/B//1 - A*(x/B//1)
cur2 = A*N/B//1 - A*(N/B//1)
print(int(max(cur1,cur2)))
import sys
A, B, N = map(int, input().split())
if N < B:
    print(A*N//B)
else:
    print(A*(B-1)//B)
import fractions

def gcd(a, b):
    while b:
        a, b = b, a%b
    return a


def reduce(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


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

#if a != b:
#    a,b = reduce(a,b)
    

#print(a,b)

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


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

#print(a,b,x)
print(ans)
from math import floor
a, b, n = map(int, input().split())
if b == 1:
    print(0)
    
else:
    if n < b:
        print((a * n) // b - a * (n //b))
        
    else:
        ans = 0
        for i in range(b - 1, n + 1, b):
            ans = max(ans, (a * i) // b - a * (i //b))
                
        print(ans)
a,b,n=map(int,input().split())
i=(n//b)*b
r=(a*n)//b-a*(n//b)
if i>1:
    x=b*(i+1)-1
    r1=(a*x)//b-a*(x//b)
else:
    r1=0
print(max(r,r1))
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)
a,b,n = map(int, raw_input().split(' '))
print min(b-1,n) * a /b
import math

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

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

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

if B > N:
    print(keisan(A, B, N))
else:
    print(keisan(A, B, B-1))
a,b,n = [int(i) for i in input().split()]
 
x = min(n,b-1)
print(a*x // b)
A, B, N = map(int, input().split())

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

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

print(result)
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)
a, b, n = map(int,input().split())
x = min(n,b-1)
print(int(a*(x%b) / b))
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(b-1,n)))
# 初期入力
import sys
#input = sys.stdin.readline
A,B,N = (int(x) for x in input().split())
ans =0
if B <=N:
    ans =int(A*(B-1)/B) 
else:
    ans =int(A*N/B)
print(ans)
import math

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

ans1 = (a*(b-1))//b
ans2 = (a*n)//b

print(min(ans1, ans2))
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))
a,b,n=map(int,input().split())
l=a//b
if b==1:
  print(0)
  exit()
if n>=b-1:
  if a%b>0:
    print(a-l-1)
  else:
    print(a-1)
else:
  print(int((a*n)//b)-a*(n//b))
a,b,n=map(int,input().split())

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

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

if B > N:
    tmp = N

else:
    tmp = B -1

ans = int(A * tmp / B) - A * int(tmp/B)

print(ans)
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)
    # Max = max(fx,Max)
    # for x in range(1,X):
    #     fx = int(A*x/B) - A * int(x/B)
    #     Max = max(Max,fx)
elif B == N:
    Max = int(A*(B-1)/B)
else:
    Max = int(A*N/B)
print(Max)
def main():
  A, B, N = (int(_) for _ in input().split())
  k = A * N // B
  m = int(A - A/B)
  if k >= m: print(m)
  else:
    print(k)
  return

if __name__ == '__main__':
  main()
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)))
from math import floor

line = [int(ch) for ch in input().split()]
a = line[0]; b = line[1]; n = line[2]
if b <= n:
    x = b-1
else:
    x = n
res = floor(a*x/b) - a*floor(x/b)
print(res)
A, B, N = map(int, input().split())

if A % B == 0:
    print(0)

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

# f(x+B) = f(x)
# 単調増加
x = min(B-1, N)
ans = (A*x)//B - A*(x//B)
print(ans)
a,b,n = map(int,input().split())
if n >= b-1:
    print(a * (b-1) // b)
else:
    print(a * n // b)
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 )) )
a,b,n=map(int,input().split())
print(a*min(n,b-1)//b)
import math
tmp = input().split()
A = int(tmp[0])
B = int(tmp[1])
N = int(tmp[2])
Mmax = 0

if N%B == 0:
    ANS = math.floor(A*(B-1)/B)
elif N > B:
    ANS = math.floor(A*(B-1)/B)
else:
    ANS = math.floor(A*N/B)

print(int(ANS))
def solve(a, b, n):
    if n >= b - 1:
        return a * (b - 1) // b
    else:
        return a * n // b


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


def test():
    assert solve(5, 7, 4) == 2
    assert solve(11, 10, 9) == 9


if __name__ == "__main__":
    test()
    main()
a,b,n = map(int,input().split())

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

print(calc)
import math

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

m = 0
n = 1

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

while n<N:
  c = B*(math.floor((n+1)/B)+1)-1
  n = min(N, c)
  m = max(cal(n), m)
  if (A*n)%B == 0:
    break
  
print(m)
A, B, N = [int(n) for n in input().split()]

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

print(f(min(B-1,N)))
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))
def main():
    A, B, N = map(int, input().split())
    x = (N+1) // B * B - 1
    if x <= 0:
        x = N
    ans = (A*x)//B - A * (x//B)
    print(ans)


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

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

    def gcd(a, b):
        if a > b: a, b = b, a
        if a == 0: return b
        return gcd(b%a, a)

    g = gcd(A, B)
    p = A // g
    q = B // g
    # print(g, p, q)
    return int(p * min(N, B-1) // q)



if __name__ == '__main__':
    print(main())
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

A, B, N = I()

print(math.floor(A*min(B-1,N)/B))
A,B,N= map(int,input().split())
max_num = 0
x = min(B-1,N)
print(int((A*x)/B)-(A*int(x/B)))