peterverebics/CodeNet_Python_118 huggingface dataset:
import math

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

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


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

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

print(calc(x))
A,B,N = map(int,input().split())
x = min(N,B-1)
ans = int(A*x/B) - A*int(x/B)
print(ans)
# -*- coding: utf-8 -*-
A,B,N = map(int, input().split())
 
def function(x):
  return (A*x)//B-A*(x//B)
 
if B-1<=N:
  print(function(B-1))
else:
  print(function(N))
A,B,N=map(int,input().split())
Z=0
if N<B:
    Z=(A*N)//B

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

print(Z)
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    x = min(b - 1, n)

    ans = int(a*x/b)

    print(ans)


if __name__ == '__main__':
    main()
def solve(a, b, n):
    return a * min(b - 1, n) / b

assert solve(5, 7, 4) == 2
assert solve(1, 1, 1) == 0
assert solve(11, 10, 9) == 9

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

print solve(a, b, n)
A, B, N = map(int, input().split())


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


if N < B:
    print(f(N))
else:
    print(f(B - 1))
A, B, N = [int(n) for n in input().split()]

c = min([B - 1, N])
y = (A * c - ((A * c) % B)) // B

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

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

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

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

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

if N<= B-1:
    ans = (N*A)//B
else:
    ans = ((B-1)*A)//B
    
print(ans)
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())
def floor(a,b,x):
    return a*x//b - a*(x//b)

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

if b > x:
    print(a*x//b)
else:
    print(a*(b-1)//b)
a,b,n = map(int, input().split())
# ans = []
if(b-1<=n):
    i = b-1
else:
    i = n
# for i in range(0, n):
ans = (a*i)//b - a*(i//b)
print(ans)
#coding: utf-8
A, B, N = map(int, input().split())
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(n<b):
    n=n
else:
    n=b-1
F = (a*n)//b
print(int(F))
a, b, n = map(int, input().split())
if n < b:
    print(a*n//b)
else:
    print((a*(b-1))//b)
#X = int(input())
def maxnumber(N, B):
  if N < B:
    return N
  a = (N // B) * B - 1
  if N == a + B:
    return N
  else:
    return a
  
A, B, N = list(map(int, input().strip().split()))
X = maxnumber(N, B)
ans = (A * X) // B - A * (X // B)
#print(X)
print(ans)
import sys
input = sys.stdin.readline


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()
def f(x):
    return a * x // b - a * (x // b)

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

if n >= b -1:
    print(f(b-1))
else:
    print(f(n))
import math
def f(x):
    return math.floor(a*x/b) - a*math.floor(x/b)

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

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

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

ans = (A * x) // B - A * (x // B)
print(ans)
A, B, N = map(int, input().split())

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

num = min(B-1, N)

print(A * num // B - A * (num // B))
a, b, n = map(int, input().split())

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

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

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

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

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

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


if  b>n:
    print(a*n//b - a*((n)//b))
else:
    print(a*((n//b)*b-1)//b - a*(((n//b)*b-1)//b))
a,b,n = list(map(int, input().split()))
if n>=b-1:
    res = (a*(b-1))//b-a*((b-1)//b)
else:
    res = (a*n)//b
print(res)
import math
A, B, N = map(int, input().split())
if B <= N:
    x = B - 1
else:
    x = N
print(math.floor(A * x / B))
import math
A, B, N = (int(i) for i in input().split())  

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

print(func(A, B, min(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)


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

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


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

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

temp_prev = 0
temp_curr = 0
x = min(n, b-1)

while x <= n:
    temp_prev = temp_curr
    temp_curr = int(a * x / b) - a * int(x / b)
    x += 1.0

    if temp_curr <= temp_prev:
        break

print(max(temp_curr, temp_prev))
a,b,n=map(int,input().split())
x=min(n,b-1)
l=(a*x)//b
r=a*(x//b)
print(l-r)
a, b, n = map(int, input().split())

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

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

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

    print(ans)

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

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

ans = (A * x // B) - (A * (x//B))
print(ans)
import math

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

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

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

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

print(ans)
a, b, n = map(int, input().split())
start = min(b - 1, n)
def f(x):
    return int(a * x / b) - a * int(x / b)
print(f(start))
from math import floor
a,b,n = map(int,input().split())
if a == 1 or b == 1:
    print(0)
    exit()

prev = 0

for x in range(min(b-1,n),n+1, b):
    val = floor(a*x/b) - a*floor(x/b)
    if val < prev:
        print(prev)
        exit()
    prev = val

val = floor(a*n/b) - a*floor(n/b)
print(max(prev,val))
a, b, n = map(int, input().split())
x = min(b-1,n)
print((a*x)//b - a*(x//b))
from math import floor
a, b, n = map(int, input().split())

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

k = max(0,(n - b + 1) // b)
k = min(n,k * b + b - 1)

print((a * k) // b - a * (k // b))
A,B,N = map(int,input().split())
if B <= N:
    X = B-1
elif B > N:
    X = N
print(int((A*X)/B) - A*int(X/B))
import math
A,B,N = map(int,input().split())
C = N - N%B
ans = A*(C-1) // B - A*math.floor((C-1)/B)
if B > N:
    ans = math.floor(A*N/B) - A*math.floor(N/B)
print(ans)
A, B, N = map(int, input().split())
ans = 0
x = min(B-1, N)
print((A*x)//B-A*(x//B))
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))
a, b, n = [int(x) for x in input().split()]


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


print(solve(min(n, b-1)))
A,B,N=map(int, input().split())
def f(n):
    return A*n//B-A*(n//B)
ans=f(N)
ans=max(ans,f(N//B*B))
x=N//B*B-1
if x>0:
    ans=max(ans,f(x))
print(ans)
import math

a, b, n = map(int, input().split())
if (b == n):
    x = n-1
elif (b < n):
    x = b-1
elif (b > n):
    x = n

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

ans=-100000
for x in range(A):
  #print(A//B,x//B,A*x//B,A*x//B-A*(x//B))
  ans=max(ans,(A*x//B)-A*(x//B))
  if x==N:break
x=B-1
if x>N:x=N
ans=max(ans,(A*x//B)-A*(x//B))
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(ans)
A,B,N = map(int,input().split())
def f(x):
  f = int((A*x)/B)-A*int(x/B)
  return f
if(B-1 < N):
  print(f(B-1))
else:
  print(f(N))
a, b, n = map(int, input().split())

x = min(b-1, n)

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

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

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

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

if n < b:
    x = n
else:
    x = b - 1
print(math.floor(a * x / b) - a * math.floor(x / b))
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

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

ans=-float("inf")
i=0

while True:
    x=b*i-1
    i+=1
    if x>n:
        ans=max(int((a*n)/b)-a*int(n/b), ans)
        print(ans)
        break
    if ans<int((a*x)/b)-a*int(x/b):
        ans=int((a*x)/b)-a*int(x/b)
    else:
        print(ans)
        break
from sys import stdin
import sys

A, B, N = [int(x) for x in stdin.readline().rstrip().split()]
# N, M = [int(x) for x in stdin.readline().rstrip().split()]
# U = input().split()
x=min(B-1,N)
ans = int((A*x)/B)-A*int(x/B)
print(ans)
# if N >= B:
import math
A, B, N = list(map(int, input().split()))
ans = 0
if B+1 < N:
    C = B+1
else:
    C = N
if B//A == 0:
    D = 1
elif B//A > 1:
  	D = B//A-1
else:
    D = B//A
for i in range(1, C+1, D):
    val = math.floor(A*i/B) - A*math.floor(i/B)
    #print("i", i, "val", val)
    ans = max(ans, val)

print(ans)
a,b,n=map(int,input().split())
def f(x):
    return int(a*x//b)-a*int(x//b)
if n<b:
    print(f(n))
elif n==b:
    print(f(n-1))
elif n>b:
    t = n
    u = n - (n%b+1)
    print(max(f(t),f(u)))
a,b,n=map(int,input().split())
i=b-1
ans=(min(n,b-1)*a)//b;
while(i<=n):
    if((i*a)//b-a*(i//b)<=ans):
        break;
    ans=max(ans,(i*a)//b-a*(i//b));
    print(ans+"\n")
    i+=b;
print(ans);
a, b, n = map(int, input().split())

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


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

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

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


if N<B:
    num = N
    answer= int(A*num/B)-A*int(num/B)
else:
    num = B-1
    answer = int(A*num/B)-A*int(num/B)
print(answer)
#!/usr/bin/env python
import math

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

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

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

if __name__ == '__main__':
    main()
def resolve():
    A, B, N = map(int, input().split())
    if B <= N+1:
        print(A*(B-1)//B)
    else:
        print(A*N//B)
resolve()
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))
a, b, n = map(int, input().split())

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

ans = (a*(x%b))//b
print(ans)
import math
a, b, n = list(map(int, input().split(" ")))
k = min(b - 1, n)
print(int(math.floor(a * k / b) - a * math.floor(k / 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))
import math
a, b, n = map(int, input().split())

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

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

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

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

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

W = N//B
dammy=[]
x=N
dammy.append((A*x)//B - A * int(x/B))
x=(B * W)-1
dammy.append((A*x)//B - A * int(x/B))


print(max(dammy))
a,b,n = map(int,input().split())
ans = 0
q = 0

if(n>=b):
  if((n+1)%b == 0):
    q = (n+1)/b - (n+1)//b
  else:
    tmp = (n//b)*b - 1
    q = tmp/b -tmp//b
else:
  q = n/b

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

from math import floor
if B - 1 <= N:
    x = B - 1
else:
    x = N

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

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

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

x = None
if N < B:
    x = N
else:
    x = B
    x = B - 1
    # max_diff = 0
    # for _x in range(B, N + 1):
    #     diff = (x / B) - floor(x / B)
    #     if max_diff <= diff:
    #         max_diff = diff
    #         x = _x

answer = floor(A * x / B) - A * floor(x / B)

print(answer)
import math
def LI():return list(map(int,input().split()))

a,b,n=LI()

def f(x):
    ret=math.floor(a*x/b)-a*math.floor(x/b)
    return ret

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

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

nb=n//b

#xmax=0
if n<b:
    xmax=a*n//b
else:
    xmax=0
#    for xb in range(nb):
#        xv=(a*xb*b+a*(b-1))//b-a*xb
#        xmax=max(xmax,xv)
    xb=nb-1
    xv=(a*xb*b+a*(b-1))//b-a*xb
    xmax=max(xmax,xv)
    xb=nb
    xv=(a*xb*b+a*n%b)//b-a*xb
    xmax=max(xmax,xv)

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

ans =0

# for x in range(1,n+1):
x = min(b-1,n)
ans = max( ans , (a * x) // b - a* (x // b))
print(ans)
A,B,N=map(int,input().split())
def floor(x):
    return int(A*x/B)-A*int(x/B)
print(floor(min(B-1,N)))
A,B,N=map(int,input().split())

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

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

print(func(a,b,min(b-1,n)))
from math import floor

def main():
    a,b,n = (int(x) for x in input().split())
    if b <= n:
        ans = floor(a*(b-1)/b)
    else:
        ans = floor(a*(n)/b)
    print(ans)

if __name__ == '__main__':
    main()
a,b,n=[int(x) for x in input().split()]
x=min((b-1),n)
f=(a*x)//b-(a*(x//b))
print(f)
a,b,n=map(int,input().split())
x=min(b-1,n)
print((a*x)//b)
import math as m
A, B, N = map(int, input().split())
if N >= B: print(m.floor(A * -1 / B) - A * m.floor(-1 / B))
else: print(m.floor(A * N / B) - A * m.floor(N / B))
import math
a,b,n = list(map(int,input().split()))
if b-1>=n:
    x=n
else:x=b-1
print(math.floor(a*x/b)-a*math.floor(x/b))
# D
# Floor Function

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))
A,B,N= map(int,input().split())


floor_num=[]

if N >=B:
    floor_num.append(int(A*(B-1)/B))
else:  

        floor_num.append(int(A*N/B))


print(max(floor_num))
from math import floor
a, b, n = [int(x) for x in input().split()]
x = min(b - 1, n)
answer = floor(a * x / b) - a * floor(x / b)
print(answer)
A,B,N = (map(int , input().split()))
min(B-1,N)
x = min(B-1,N)
print(((A*x)//B - A * (x//B)))
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))
A,B,N = map(int,input().split())
if B>N:
    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())
if n>=b-1:
    count=0
    for i in range(a):
        count+=(((b-1)/b)+(i/a))//1
    print(int(count))
else:
    count=0
    for j in range(a):
        count+=((n/b)+(j/a))//1
    print(int(count))
import math
a, b, n = map(int, input().split())
if n <= b - 1:
    m = math.floor(a*n/b)
else:
    m = math.floor(a-a/b)
print(m)
A,B,N = map(int, input().split())
if B == 1 or A == 1:
  floor = 0
else:
  if N < B:
    floor = int(A*N/B) - A*int(N/B)
  elif N == B:
    floor = int(A*(N-1)/B) - A*int((N-1)/B)
  else:
    floor = max([(int(A*(x-1)/B) - A*int((x-1)/B)) for x in range(B,N,B)])
    
print(floor)
"""n,m,q = (int(i) for i in input().split())
a = []
ans = 0

for i in range(q):
	a.append(list(map(int,input().split())))

for i in range(q):
	if
		ans+=a[i][3]

print(ans)
"""

a,b,n = (int(i) for i in input().split())
x = 0
if b<=n:
	x = b-1
else:
	x = n
c = a*x
print(c//b)
from math import floor

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

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

    print(floor(a*x/b))

if __name__ == '__main__':
    main()
a,b,n = [int(x) for x in input().split()]


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

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

x = min(b - 1, n)

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

print(f(x))
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))
import math
A,B,N=(int(x) for x in input().split())
if N<B:i=N
else:i=B-1
p=(math.floor((A*i)/B))
print(p)
A, B, N = map(int, input().split())
m = B - 1 if N >= B else N
print(A * m // B)
import numpy as np
A,B,N = map(int,input().split())
if B <= N:
    x = B-1
    print(int(np.floor(A*x/B)))
else:
    print(int(np.floor(A*N/B)))
a,b,n=map(int,input().split())

x=b-1
if x>n:
    x=n
p=a*x//b
q=x//b
print(p-q)
import sys
def input(): return sys.stdin.readline().strip()

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

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

print(ans)
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()
ABN = input().split()
A = int(ABN[0])
B = int(ABN[1])
N = int(ABN[2])

answer = 0
temp = 0

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

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

print(answer)
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))
a,b,n = map(int,input().split())
if n%b==0:n-=1
x = max((n//b)*b-1,n%b)
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) )