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

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

print(ans)
a,b,n = map(int,input().split())
ans = 0
for i in range(1,min(10**7+1,n+1)):
    ans = max(ans,((a * i)//b -a * (i//b)))
print(ans)
a,b,n=map(int,input().split())
x=0
if b < n:
    x=b
else:
    x=n
#while x<=b and x<=n:
    #x+=1
print((int((a*x)//b) - a*(int(x//b))))
import math
a,b,n = map(int,input().split())
#li = []

#for x in range(n+1):
ans = (math.floor((a*(n))/b) - (a * math.floor(n/b)))
if ans == 0:
    print(0)
else:
    print(math.floor(ans))

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

n = b if n > b else n
ans = 0
for x in range(n, 0, -1):
    if x > b:
        continue
    ans = max(a * x // b - a * (x // b), ans)
    break

print(ans)
A,B,N=map(int,input().split())
x=min(B,N)
ans=(A*x)//B-(A)*(x//B)
for i in range(B,10**12+1,B):
    if i>N:
        break
    ans=max(ans,(A*i)//B-A*(i//B))
print(ans)
#D
a,b,n = map(int,input().split())

print(min(n,b-1))
import math
A, B, N = list(map(int, input().split(" ")))
res = []

for n,i in enumerate(range(1,N+1)):
  r = math.floor(A*i/B) - A*math.floor(i/B)
  res.append(r)
  if n >= 1:
    if res[n-1] <= res[n]:
      break
print(max(res))
a, b, n = map(int, input().split())

ans_list = []

for q in range(n + 1):
  ans_list.append(int(a * q / b))
print(max(ans_list))
import math

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

max=0
x_max=-1


for x in range(B-k,B+k):
	if x>=0 and x<=N:
		tmp = math.floor(A*x/B)-A*math.floor(x/B)
		if max<=tmp:
			max=tmp
			x_max=x


for x in range(N-k,N+1):
	if x>=0:
		tmp = math.floor(A*x/B)-A*math.floor(x/B)
		if max<=tmp:
			max=tmp
			x_max=x
	
print(max)
a,b,N=map(int,input().split())
d=[]
for i in range(1,N+1):
    d.append(((a*i)//b)-(a*(i//b)))
print(d[-1])
a,b,n=map(int,input().split())
print((a*(n-1)/b)-(a*int((n-1)/b)))
import math
import sys
a,b,n = map(int, input().split())
ans=0
if n<b:
    ans=math.floor(a*n/b)-a*math.floor(n/b)
    print(ans)
    sys.exit()
else:
    for i in range(b,n+1):
        tmp=(math.floor(a*i/b))-a*(math.floor(i/b))
        if ans<tmp:
            ans=tmp
    print(ans)
    sys.exit()
import math
line = input()
a, b, n = line.split(" ")
a, b, n = int(a), int(b), int(n)
# ans = 0


# for i in range(n+1):
#     ans = math.floor((a*i)/b) - math.floor(i/b)
# print(ans)

ans1 = math.floor((a*n)/b) - math.floor(n/b)
ans2 = math.floor((a*n-1)/b) - math.floor(n-1/b)
print(max(ans1, ans2))
A,B,N = map(int,input().split(" "))
max_floor = 0
for x in range(N+1):
  floor_x = int(A*x/B) -A*int(x/B)
  if max_floor < floor_x:
    max_floor = floor_x
print(floor_x)
a, b , n = map(int, input().split())
def floor_abx(a, b, x):
    return int(a*x/b) - int(x/b)*a 
    
res = 0
for i in range(n+1-a, n+1):
    num = floor_abx(a, b, i)
    if res < num:
        res = num
for i in range(1, a):
    num = floor_abx(a, b, i)
    if res < num:
        res = num
print(res)
a, b, n = map(int, input().split())

ans = 0

if b == 1:
  ans = 0

else:
  for x in range(0, a * n, b):
    new = x // b - a * ((x / a) // b)
    if new > ans:
      ans = new

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

print(min(B-1, N))
def main():
    a,b,n = map(int,input().split())
    aa = min(b,n)
    ans = 0
    for i in range(aa,n):

        ans = max(ans,a*aa//b  - a * (aa//b))
    print(ans)
if __name__=='__main__':
    main()
a,b,n = map(int,input().split())
ans = 0

# for i in range(n+1,n-2*a,-1):
for i in range(2*a):
    ans = max(ans,int((a*i)/b) - a*int(i/b))

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

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


def solve():
    A, B, N = map(float, input().split())

    ans = 0
    div_ab = A/B
    div_1b = 1/B
    init_1 = (max(1, int(N)-100000)*A)/B
    init_2 = max(1, int(N)-100000)/B
    start = max(1, int(N)-100000)

    for i in range(max(1, int(N)-100000), int(N) + 1):
        ans = max(math.floor(init_1+div_ab*(i-start)) - A*math.floor(init_2+div_1b*(i-start)),ans)

    print(int(ans))


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

cand = []

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

cand.append(calc(0))
cand.append(calc(n))
cand.append(calc(n-1))
cand.append(max(0, calc(b*(n//b) - 1)))
cand.append(max(0, calc(b*(n//b) - 2)))
cand.append(calc(min(n, b-1)))
cand.append(calc(min(n, b-2)))

print(max(cand))
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:
        x = N
        res = math.floor(A * x / B)
        return print(res)

    x = (N // B) * B - 1
    res = math.floor(A * x / B) - A * math.floor(x / B)
    return print(res)


if __name__ == '__main__':
    main()
from sys import stdin
import sys
import math

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

ans = []

#for x in range(N+1):
#    ans.append(math.floor(A * x / B) - A * math.floor(x / B))

#loop = min(B+1 ,N+1)
#for x in range(loop):
#    ans.append(math.floor(A * x / B) - A * math.floor(x / B))

max_ans = 0
for x in range(N+1)[::-1]:
    ans = math.floor(A * x / B) - A * math.floor(x / B)
    if ans < max_ans:
        print(max_ans)
        sys.exit()
    else:
        max_ans = ans
print(max_ans)
import math


nums = [int(e) for e in input().split()]

a = nums[0]
b = nums[1]
n = nums[2]

max_score = -1
score = -1

for x in range(1, n+1):
    score = math.floor(a*x/b) - a* math.floor(x/b)
    if max_score < score:
        max_score = score
        x += 1
    else:
        break

print(max_score)
a,b,n = map(int,input().split())
maxim=int(a*n/b)
print(maxim)
a, b, n = map(int, input().split())

if b == 1:
    r = [0]
else:
    i = 0
    r = []
    while b*i-1 <= n:
        r.append(int((a*(b*i-1))/b)-a*int((b*i-1)/b))
        i += 1
print(max(r))
a, b, n = map(int, input().split())
print(a * (b-1) // b)
import math
a, b, n = map(int, input().split())
if b>n:
    print(math.floor(a*n/b))
else:
    y = a-1 if a>b else b-1
    x = y if y>n else n
    print(math.floor(a*x/b)-a*math.floor(x/b))
# coding: utf-8
# Your code here!
A,B,N=map(int,input().split())

num=N//B
if num==0:
    n=N
else:
    n=B*num-1

temp1=(A*n)/B//1
temp2=A*((n/B)//1)

print(temp1-temp2)
A,B,N= list(map(int, input().split()))
print(min(B-1,N))
a, b, n = map(int, input().split())
ans = int((a * n) / b) - a * int(n / b)
print(max(ans, 0))
A, B, N = map(int, input().split())

lo = 0
hi = N
ans = 0

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

while lo < hi:
    mid = (lo + hi) // 2
    
    if f(lo) < f(hi):
        lo = mid + 1
    else:
        hi = mid

print(f(lo))
A, B, N = [int(x) for x in input().split()]
max_val = 0
i = B-1
for j in range(min(i,N)):
  x = (A*j)//B - A*(j//B)
  if x > max_val:
    max_val = x

while i<=N:
  x = (A*i)//B - A*(i//B)
  if x > max_val:
    max_val = x
  i+=B
print(max_val)
inp=[int(x) for x in input().split()]
a,b,n=inp[0],inp[1],inp[2]
if (a-1)>n:
  print(n-1)
else:
  print(a-1)
a,b,n = map(int,input().split())
ma = -1
for x in range(0,b):
    ans =  ((a*x)//b) - (a * (x//b))
    print((a * (x//b)))
    if(ans > ma):
        ma = ans
        print(x,ma)
print(ma)
a,b,n = (int(x) for x in input().split())
print(n-(a-b)+1)
A,B,N=map(int,input().split())

import math
M = 0
for x in range(max(N-100,0),N+1):
    Z = math.floor(A * x / B) - A * math.floor(x / B)
    if M < Z:
        M = Z
print(M)
import math
a,b,n = map(int,input().split())

temp = a * b // math.gcd(a, b) - 1
temp = min(temp, n)
ans = (a * temp)//b - a * (temp//b)
print(ans)
import sys
import math
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    a,b,n = IL()
    x = min(b,n)
    print(math.floor(a*x/b)-a*math.floor(x/b))
    return

if __name__=='__main__':
    Main()
import math
A,B,N= map(int,input().split())
x=[]
AB=A/B
if N<B:
    #x.append(math.floor(AB*N-1)-A*(N//B)
    print(math.floor(AB*N))
else:
    print(math.floor(AB*B-1))
#for i in range(1,N+1):
a, b, n = map(int, input().split())
ans = 0
for i in range(n, max(0, n-b), -1):
    ans = max(ans, int(a * i / b) - (a * int(i / b)))
print(ans)
#import matplotlib.pyplot as plt

def main():
    a,b,n = map(int,input().split())
    mx = 0
    for x in range(0,min(a+1,n+1)):
        left = int(a*x/b)
        right = a * int(x/b)
        print("x=",x,"floor(Ax/B)=",int(a*x//b),"A*floor(x/B)=",a * int(x // b),"answer=",left-right)
        #right.append(a * int(x/b))

        mx = max(left-right,mx)
    print(mx)


    #plt.plot(list(range(len(right))),right,label="test")


if __name__ == '__main__':
    main()
#D
a,b,n = map(int,input().split())
x = n-1
ans1 = ((a*x)//b) - (a*(x//b))
x = n-1
ans2 = ((a*x)//b) - (a*(x//b))
x = n-b
ans3 = ((a*x)//b) - (a*(x//b))
x = n//b
ans4 = ((a*x)//b) - (a*(x//b))
x = n//2
ans5 = ((a*x)//b) - (a*(x//b))
x = 1
ans6 = ((a*x)//b) - (a*(x//b))
print(max(ans1,ans2,ans3,ans4,ans5,ans6))
a ,b ,n = map(int, input().split())

ans = -1
if(a % b == 0):
    x = b-1
    abc = ((a*x)//b)-(a*(x//b))
    if(ans < abc):
        ans = abc
else:
    for x in range(n-int(n**(1/2)),n+1):
        abc = ((a*x)//b)-(a*(x//b))
        if(ans < abc):
            ans = abc


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

x = max(b-1, n)

print((a*x)//b)
# coding: utf-8

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

n = 0

for i in range(N):
    
    _n = int(A*i/B) - A*int(i/B)
    if n < _n:
        n = _n

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

print((a * n) // b - a * (n // b))
from math import floor,sqrt
import sys
a,b,n=map(int,input().split())
t1=floor((a*(n-1))/b)-a*floor((n-1)/b)
t2=floor(a*n/b)-a*floor(n/b)
print(max(t1,t2))
a, b, n = map(int, input().split(' '))

import math

x = n
tmp1 = math.floor(a*x/b) - a*math.floor(x/b)
ret = tmp1

if n//b == 0:
    print(tmp1)
else:
    q, _ = divmod(n, b)
    for i in range(1,10**4):
        x = i*b-1
        tmp2 = math.floor(a*x/b) - a*math.floor(x/b)
        ret = max(ret, tmp2)
    print(ret)
A, B, N = map(int, input().split())

n = 0

for i in range(N):
    
    _n = int(A*N/B) - A*int(N/B)
    if n < _n:
        n = _n
    break

print(n)
a,b,n = map(int, input().split())
res = 0
for i in range(1,min(n+1,pow(10,7))):
  res = max(res,(a*i)//b - a*(i//b))
print(res)
A, B, N = map(int, input().split())
Ymax=0

for i in range(N,N-B,-1):
  x = i+1
  Y = int(float(A)*float(x)/float(B)) - A * int(float(x)/float(B))
  if Y>Ymax:
    Ymax = Y
  print(x)
print(Ymax)
A,B,N=map(int,input().split())

def fl_m(a,b,n):
  if n>=(a-1)*b/a:
    z=a-1
  else:
    k=int(n*a/b)
    z=k
  return(z)
    
print(fl_m(A,B,N))
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()
from math import floor
 
a, b, n = [int(x) for x in input().split()]
 
for x in range(0, n+1):
    value = floor(a*x/b) - a * floor(x/b)

print(value)
import math

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

ab = a/b
maxi = 0
st = max(0, n-a-1)
for x in range(st, n+1):
    z = 0
    
    z = math.floor(ab * x) - a * math.floor(x/b)
    if z > maxi:
        maxi = z

for x in range(0, a):
    # z = 0
    if x < b:
        z = math.floor(ab * x)
    else:
        z = math.floor(ab * x) - a * math.floor(x/b)
    if z > maxi:
        maxi = z

print(maxi)
import math

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

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

print(int((a * n) / b) - a * int(n / b))
from math import floor
a, b, n = map(int, input().split())
ans = 0
for i in range(min(5, n)):
    score = floor(a*(n-i)/b) - a*floor((n-i)/b)
    ans = max(score, ans)
print(ans)
def main():
    A, B, N = map(int, input().split())
    n=0
    if N < B:
        print(int(A*N/B))
    else:
        for i in range(B,N+1):
            if n < int(A*i/B) - A*int(i/B):
                n = int(A*i/B) - A*int(i/B)
        print(n)
        
main()
a, b, n = map(int, input().split())
max_v = 0
c = 0
for x in range(1, n+1):
  v = int(a*x/b)- a * int(x/b)
  c += 1
  if v > max_v:
    max_v = v
    c = 0
  if c > 10000000:
    break
print(v)
A, B, N = map(int, input().split())

maxFloor = 0

def floor(x):
    num = int(x // 1)
    return num

check = floor(A * (B - 1) / B) - A * floor((B - 1) / B)
print(check)
from math import floor
from functools import reduce
from itertools import product

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

  maximam = 0
  for n in range(1, N+1):
    result = (floor(A*n/B) - A * floor(n/B))
    if maximam < result :
      maximam = result

  print(result)

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

def func(t):
    return int(t)

syo=N//B
amari=N%B

if syo==0:
    x=amari
    print(func(A*x/B)-A*func(x/B))
else:
    x1=syo*B-1
    x2=N
    ans1=func(A*x1/B)-A*func(x1/B)
    ans2=func(A*x2/B)-A*func(x2/B)
    print(max(ans1,ans2))
import math
A, B, N = map(int, input().split())

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

high = N
low = 0
while high - low > 1:
    mid_left = high / 3 + low * 2 / 3
    mid_right = high * 2 / 3 + low / 3
    # print(mid_left, mid_right)
    if f(mid_left) >= f(mid_right):
        high = mid_right
    else:
        low = mid_left
print(f(high))
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
INF = 10**10
MOD = 10**9 + 7
A, B, N = map(int,input().split())

mx = 0

N = min(N,A)

for x in range(1,N+1):
    v = (A*x)//B - A * (x//B)
    #print (v)
    mx = max(mx,v)
print (mx)
import math
import random

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

def quick(x):
  pri = math.floor(A * x / B)
  lat = A * math.floor(x / B)
  return math.floor(pri - lat)

max = quick(N)
for i in range(50000):
  ran = math.floor(random.uniform(0, N))
  tem = quick(ran)
  if(max < tem):
    max = tem

print(max)
import math

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

ans = 0

for x in range(0, a * n, b):
  new = math.floor(x / b) - a * math.floor((x / a) / b)
  if new > ans:
    ans = new

print(ans)
import math

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

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

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

print(ans)
import math
A,B,N=map(int,input().split())
A=float(A)
B=float(B)
maxi=0
for x in range(N):
    x=float(x)
    if math.floor(A*x/B)-A*math.floor(x/B) >=maxi:
        maxi = math.floor(A*x/B)-A*math.floor(x/B)
print(int(maxi))
a, b, n = map(int, input().split())
ans = int((a * n) / b) - a * int(n / b)

for i in range(0, 100):
  n = n - 1
  ans=max(ans, int((a * i) / b) - a * int(i / b))
print(ans)
A, B, N = map(int, input().split())
if B == 1:
    result = 0
elif N >= B-1:
    result = B-1
else:
    result = N
    
print(result)
import math


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


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

left = 0
right = N

while right - left > 1:
    mid = (left + right) // 2
    y = target(mid)
    prv = target(mid - 1)
    nxt = target(mid + 1)
    if prv <= y <= nxt:
        left = mid
    else:
        right = mid


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

def calc(x):
    # print(a, b, x)
    return (a*x)//b - a*(x//b)

res = 0


for i in range(0, min(a + 5, n + 1)):
    # print(i)
    # print(calc(i))
    res = max(res, calc(i))
    # print(res)

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

if B > N:
    ans = int(A*N/B)
    print(ans)
else:
    ans = 0
    ans_2nd = 0
    x = (N//B)*B - 1
    temp = int(A*x/B) - A*int(x/B)
    while ans <= temp and x >= 0:
        ans = temp
        temp = int(A*x/B) - A*int(x/B)
        x -= B
    while ans_2nd <= temp and x >= 0:
        ans_2nd = temp
        temp = int(A*x/B) - A*int(x/B)
        x -= B
    print(max(ans, ans_2nd))
#D
A,B,N = map(int,input().split())
ans = 0
for x in range(1,min(10**6+1,N+1)):
    left = A*x//B
    right = A*(x//B)
    #print("x =",x,left,right)
    ans = max(ans,left-right)
print(ans)
import math
a,b,n = map(int,input().split())
if n % b == 0:
    n = n -1
    print(math.floor((a * n)/b) - (a * math.floor(n/b)))
else:
    mm = max(0,(b * (n//b)) - 1)
    print(int(max(math.floor((a * n)/b) - (a * math.floor(n/b)),math.floor((a * mm)/b) - (a * math.floor(mm/b)))))
import math
a, b, n = map(int,input().split())
# N = int(input())
# al = list(map(int,input().split()))

lst = []
if b >= n:
    x = n
else:
    if b != 1:
        x = b-1
    else:
        x = 1

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

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

max_result = -10 ** 12

N = min(N, 10 ** 8)
for x in range(0, N+1):
    tmp = math.floor(A * x / B) - (A * math.floor(x / B))
    max_result = max(max_result, tmp)

print(max_result)
A, B, N = map(int,input().split())
ans = []

if N >= 100000:
    for i in range(N-500,N+1): 
        k = (A*i)//B - A*(i//B)
        ans.append(k)
        i = i + 1
    
else:
    for i in range(N//2,N+1):
        k = (A*i)//B - A*(i//B)
        ans.append(k)
        i = i + 1
    
print(max(ans))
# A, B, N = map(int, input().split())
A, B, N = 5, 7, 4

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


def calculate(a, b, n):
    s1 =  a * n // b
    if n == b:
        s1 = a*(n-1) // b
    if N > b:
        if n >= 2 * b:
            x = b + b - 1
        else:
            x = n
        return max(s1,(a * x) // b + a * (x // b))

    return s1


print(calculate(A, B, N))
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())
    print(min(f(n, a, b), f(b-1, a, b)))
if __name__ == '__main__':
    main()
A,B,N = list(map(int,input().split()))

print(min(N,B-1))
a, b, n = map(int, input().split())
print(int(a*n/b) - a*int(n/b))
A,B,N=map(int,input().split())
#print(math.floor(A/B))
#c=[0]*N
s=0

if N<=B:
  print((A*(N-1))//B-A*((N-1)//B))
else:print(A-1)
exit()
for i in range(1,N+1):
  if s<(A*i)//B-A*(i//B):
    s=(A*i)//B-A*(i//B)
  if s==39204:print(i)
print(s)
import math
a,b,n = map(int,input().split())
ans = 0
al = []
for i in range(n,-1,-1):
    ans = ((a*i)//b)-(a*(i//b))
    al.append(ans)
    if len(al) > 1:
        if al[-1] < al[-2]:
            break
print(max(al))
a, b, n = input().split()
a = int( a )
b = int( b )
n = int( n )
f_max = 0

x = 0
x_per_b = 0
d = 1 / b
for x in range( min( b, n ) + 1 ):
    f_x = int( a * x_per_b ) - a * int( x_per_b )
    if x == 0 or f_max < f_x:
        f_max = f_x
    x_per_b = x_per_b + d

print( f_max )
import math
ans=-100000000
a,b,n=map(int,input().split())
st=1
if n>1000000:
    st=b-1
for i in range(st,n+1):
    keep=math.floor(a*i/b)-a*math.floor(i/b)
    if ans<keep:
        ans=keep
print(ans)
a, b, n = map(int, input().split())
n = n - 1
print(int((a * n) / b) - a * int(n / b))
# -*- coding: utf-8 -*-
"""
Created on Sat May  2 22:26:54 2020

@author: Kanaru Sato
"""

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

def floorspecial(x):
    u = int((a*x)/b)
    v = a*int(x/b)
    print(int(u-v))

if a == 1:
    print(0)
elif n < b:
    floorspecial(n)
else:
    p = int(n/b)*b
    p = p-1
    floorspecial(p)
A, B ,N = map(int,input().split())
x = 0
max = 0
while True:
  result = int((A*x)/B) - (A*int(x/B))
  if result > max:
    max = result
  if x/B >= 1:
    break
  x = x + 1
print(max)
import sys
A, B, N = map(int, input().split())

ans = [int((A*(i+(B-1)))/B) - (A*i) for i in range(N+1) if i % B == 0]
ans.append(0)

print(max(ans))
a, b, n = map(int, input().split())
ans = -100
for x in range(1, n+1):
    if x % b == 0:
        continue
    fx = int(a*x/b) - a * int(x/b)
    if ans < fx:
        ans = fx
print(ans)
from math import floor
a, b, n = [int(x) for x in input().split()]

x = min(b - 1, n)
v1 = floor(a * x / b) - a * floor(x / b)
x = n
v2 = floor(a * x / b) - a * floor(x / b)
print(max(v1, v2))
import sys
A, B, N = map(int, input().split())

if N <= B :
  print(int(N * A // B) - A * int(N // B))
  sys.exit()
else :
  print(((B-1) * A // B) - A * ((B-1) // B))
import math
a,b,n = map(int,input().split())
ans = 0
al = []
al2 = 0
for i in range(n,-1,-1):
    ans = ((a*i)//b)-(a*(i//b))
    al.append(ans)
    if al2 < ((a*i)/b)-(a*(i/b)):
        break
    al2 = ((a*i)/b)-(a*(i/b))
    
if max(al) < 0:
    print(0)
else:
    print(max(al))
import math
a,b,n = map(int,input().split())
c = min(n,b - 1)
ans = max(math.floor(a * c / b) - a * math.floor(c / b), math.floor(a * n / b) - a * math.floor(n / b))
 
print(ans)
import math
 
a, b, n = map(int, input().split())
 
ans = -1
 
search_list = [i for i in range(b-100, b+100) if i >= 0 and i <=n]
 
for x in search_list:
    res = math.floor(a*x/b) - a*math.floor(x/b)
    ans = max(ans, res)
 
print(ans)
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()
    # max = 0
    # for x in range(1, n + 1):
    #     r = floor((a * x) / b) - a * floor(x / b)
    #     if max < r:
    #         max = r

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


if __name__ == "__main__":
    main()
A,B,N = 5,7,4
max = 0
A_ = 0
for i in range(1,N+1):
  if  i > 1 and int((A*i) % B) == int((A*i-1) % B):
    continue
  num = int((A * i)/B) - A * int(i/B)
  if num > max:
    max = num
    
    
print(max)
A,B,N = map(int, input().split())
ans = -1145141919810931931
for x in range(1, N+1, max(1, int(B/A))):
    a = int(A*x/B) - A*int(x/B)
    if a>ans:
        ans = a
print(ans)
A,B,N = map(int,input().split())

k = (N+1)//B

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

ans = 0
for i in range(10 ** 6):
  print(A * i // B - A * (i // B))
  ans = max(ans, A * i // B - A * (i // B))

for i in range(10 ** 6):
  i = N - i
  if i < 0:
    break
  ans = max(ans, A * i // B - A * (i // B))

print(ans)
A,B,N= list(map(int, input().split()))
ma=0
for i in range(1,min(N,B)+1):
    a=int(A*i/B)-A*int(i/B)
    print(a)
    if(ma<a):
        ma=a
    if(a>=A):
      break
print(ma)
a,b,n=map(int,input().split())
def f(x):
    return int(a*x/b)-a*x//b
if n<b:
    ans =f(n)
else:
    t = n
    u = b - 1
    ans=max(f(t),f(u))
print(ans)
a,b,n=map(int,input().split())
mul=0
while mul*b-1<=n:
    mul+=1
mul-=1
x=max(n,mul*b-1)
print((a*x)//b-a*(x//b))
a,b,n = map(int,input().split())
#if b%n != 0:
	#print((a*n)//b - ((n//b)*a))
#else:
n = b-1
print((a*n)//b - ((n//b)*a))
a, b, n = [int(x) for x in input().split()]


x = max(0,n-a-a-a-a)

s = -a

for i in range(x,n+1):
    s = max(s,(a*i//b)-a*(i//b))
for i in range(b-1,b):
    s = max(s,(a*i//b)-a*(i//b))


print(s)
a, b, n = map(int, input().split())
c=int(a*b/b) - a*int(b/b)
d=int(a*n/b) - a*int(n/b)
e=0
print(max(c,d,e))
# abc165_d.py
A, B,N = map(int,input().split())
ans = -100000000000
for i in range(A):
    if N +1 < i:
        break
    t = (A*i) // B - A * (i//B)
#    print(i, t,(A*i) // B, A * (i//B))
    if ans < t :
        ans = t
print(ans)
def resolve():
    A, B, N = map(int, input().split())

    A_ans = 0
    for i in range(min(N, B), 1, -2):
        tmp = (A * i // B) - A * (i // B)
        A_ans = max(tmp, A_ans)

    print(A_ans)


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

ans=-100000
for x in range(5*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
print(ans)