peterverebics/CodeNet_Python_118 huggingface dataset:
def naive(a, b, n):
	ans = 0
	for i in range(1, n + 1):
		ans = max(ans, int((a * i) / b) - a * int(i / b))
	return ans

def main(a, b, n):
	ans = 0
	tmp = []
	for i in range(max(n + 1 - a * 10 - 1, 1), n + 1):
		ans = max(ans, int((a * i) / b) - a * int(i / b))
	return ans


n = 10000
for a in range(1, 10):
	for b in range(1, 100):
		if naive(a, b, n) != main(a, b, n):
			print(a, b, naive(a, b, n), main(a, b, n))

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

# ans = 0
# for x in range(N+1):
#     tmp = A * x // B - A * (x // B)
#     ans = max(ans, tmp)
#     print(x, A * x // B, A * (x // B), tmp)
# print(ans)

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

print(A * x // B - A * (x // B))
# print(x)
A,B,N=map(int, input().split())
print(A*(N%B)//B)
INT_MAX=10**19+7
MOD=10**12+7
def INPUT():return list(int(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]
#=======================================================================
import math as M
a,b,n=INPUT()
if n<=b:
    print(int(a*n/b))
else:
    print(int(a*(b-1)/b))
a, b, n = map(int, input().split())

ans = 0
for x in range(b, 0, -1):
    ans = a*x // b
    break

print(ans)
a,b,n = map(int, input().split())
def f(x):
    return int(a*x/b) - a*int(x/b)
syou = n//b
Max = 0
for i in range(0,a+1):
    syou1 = syou - i
    Max = max(f(syou1*b-1),f(syou*b-1),Max)
Max = max(Max,f(n),f((syou+1)*b-1))
print(Max)
import math

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

if b <= a:
    if n >= b:
        x = b - 1
        print(math.floor(a * x / b))
    elif n < b:
        x = n
        print(math.floor(a * x / b))
elif b > a:
    if n >= b:
        x = math.ceil(n / b) - 1
        print(math.floor(a * x / b) - a * math.floor(x / b))
    elif n < b:
        x = n
        print(math.floor(a * x / b))
import math

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

s=N//B

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

#print(x)

#ans = math.floor(A*x/B) - A * math.floor(x/B)
ans = math.floor(A/B*x) - A * math.floor(x/B)


#print(a,b)
print(ans)
import math
 
a,b,n = map(int,input().split())
cnt = 0
t = 0
if n<=b:
    print(math.floor(a*n/b))
    exit()
a, b, x = map(int, input().split())

o = x
x = max(0, x - 100000)

m = 0

while x <= o:
    m = max(m, (a*x) // b - a * (x // b))
    x += 1

print(m)
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(800000):
  ran = math.floor(random.uniform(0, N))
  tem = quick(ran)
  if(max < tem):
    max = tem

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

if n < b:
    print(int(a * n / b) - a * int(n / b))
else:
    print(a - 1)
func = []
A , B , N = map(int , input().split())
"""
for x in range(N+1):
    func.append((A*x) // B  - A * (x // B ))
print(max(func))
"""
if B - 1 > N + 1:
    print((A*(N)) // B  - A * ((N) // B ))
else:
    print((A*(B-1)) // B  - A * ((B-1) // B ))
import math
a, b, n = list(map(int, input().split()))

ans = 0
if a*n/b < 1:
    print(math.floor(a*n/b) - a*math.floor(n/b))
else:
    for i in range(1, a+1):
        x = math.ceil(i/(a/b))-1
        if x <= n:
            diff = math.floor(a*x/b) - a*math.floor(x/b)
            ans = max(ans, diff)
        else:
            break
    print(ans)
import math
A,B,N=map(int,input().split())
max=0
for x in range(N-1,N+1):
  temp=math.floor(x*(A/B))-A*math.floor(x/B)
  if temp>max:
     max=temp
print(max)
A,B,N = map(int, input().split())
print(round(A*(N-1)/B)-A*int((N-1)/B))
a,b,n = map(int, input().split())
tmp = int(n/b)
result = 0
if tmp != 0:
    result = b*tmp - 1
    if result + b <= n: result += b
else:
    result = n
print(int(a*result/b) - a*int(result/b))
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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

    x = (n // b) * b - 1
    if x < 0:
        x = n
    r = max(int(a * x / b) - a * (x // b),
            int(a * n / b) - a * (n // b))
    print(r)


if __name__ == '__main__':
    main()
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:(input())

"""========main code==============="""

a,b,c=ml()
d=(a*c)%b
x=d//a
print(((a*(c-x))//b)-a*((c-x)//b))
from math import floor
A,B,N = [int(_n) for _n in input().split()]
if A == 1:
    print(0)
if N >= B-1:
    print(B-1)
else:
    print(N*A//B)
A,B,N = map(int, input().split())
ans = []
for t in range(B):
    x = t+1
    ansX = A*x//B-A*(x//B)
    ans.append(ansX)
print(ans)
def floor(A,B,x):
    return int(A*x/B)-A*int(x/B)

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

ans =max(floor(A,B,N),floor(A,B,B*(N//B)-1))


print(ans)
import math

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

ans = 0
if N <= B:
    ans = math.floor(A*N/B) - A * math.floor(N/B)
else:
    for x in range(B, N+1):
        val = math.floor(A*x/B) - A * math.floor(x/B)
        if ans < val:
            ans = val

print(ans)
import math
A,B,N = (int(x) for x in input().split())
a = (N//B)*B-1
if a < 0:
  a = 0
  ans = math.floor(A*a/B) - A*math.floor(a/B)
else:
  ans = math.floor(A*a/B) - A*math.floor(a/B)
  
if ans < math.floor(A*N/B)-A*math.floor(N/B):
  re = math.floor(A*N/B)-A*math.floor(N/B)
else:
  re = ans
print(re)
from math import floor
A,B,N = map(int,input().split())
cnt = 0
siki = 0
if B < N :
    for i in range(B) :
        siki = floor(A*i/B) - A * floor(i/B)
        cnt = max(siki,cnt)
else :
    cnt = floor(A*N/B) - A*floor(N/B)

print(cnt)
A, B, N = map(int,input().split())
n = 0
x = 1
if N < 10**5:
    while (n+1)*B-1 < N:
        n += 1
else:
    n = int((N+1)/B - 10**5)
    while (n+1)*B-1 < N:
        n += 1

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

print(int(A*x/B) - A*int(x/B))
# coding: utf-8
# Your code here!
import math
line = list(map(int,input().split()))

A,B,N =line[0],line[1],line[2]

ans = (N+1)//B
if ans ==0:
    print(math.floor(A*N/B)-A*math.floor(N/B))
else:
    kouho =[0 for j in range(ans)]
    for i in range(1,ans+1):
        x= i*B-1
        kouho[i-1]=(math.floor(A*x/B)-A*math.floor(x/B))
    
    kouho.append(math.floor(A*N/B)-A*math.floor(N/B))
    print(min(kouho))
import sys

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

if (N>=2*B-1):
    n=B-1
elif (B<N<2*B-1):
    n=N-B
else:
    n=N

print(int(A*n/B))
A,B,N = map(int, input().split())
ans = 0
for i in range(10**6):
    if i > N-1:
        break
    
    tmp = (A*(i+1))//B-A*((i+1)//B)
    if ans < tmp:
        ans = tmp
print(ans)
a,b,n = map(int,input().split())
max=a-1
if n<b:
    max=int(a*n/b)-a*int(n/b)
print(max)
from math import floor

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

ans=A-1

m=0
if N<B:
    an=A*N
    for i in range(int(an/B+1)):
        if an > B:
            an-=B
            m+=1
        else:
            break
    ans=m
print(ans)
a,b,n=map(int,input().split())
d=((a*(n))//b)-(a*((n)//b))
e=((a*(n-1))//b)-(a*((n-1)//b))
f=((a*(1))//b)-(a*((1)//b))
print(max(d,e,f))
A, B, N = list(map(int, input().split()))

c = 0
ans = 0

if N < 1000001:
  for i in range(1,N+1):
    c = int(A*i/B) - A*int(i/B)
    if ans < c:
      ans = c

elif N < B:
  ans = int(A*N/B) - A*int(N/B)
      
else:
  ans = int(A*(B-1)/N)
    
print(int(ans))
import math

input1 = input().split()
A = int(input1[0])
B = int(input1[1])
N = int(input1[2])

x = 0
result = 0
if N >= B-1:
    x = B-1
    result = (A*(x%B) - (A*x)%B)/B
elif N < B-1:
    x = N
    result = (A*(x%B) - (A*x)%B)/B

print(result)
def Int():
    return int(input())
def Ints():
    return map(int,input().split())
def IntList():
    return list(Ints())
def IntMat(N):
    return [IntList() for i in range(N)]

A,B,N = Ints()

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

ans = 0
n = 1
x = -int(-B*n/A)

while x<=N and n <= A-1:
    ans = max(ans, int(A*x/B)-A*int(x/B))
    n += 1
    x = -int(-B*n/A)
print(ans)
import math
a, b, n = map(int, input().split())
print(math.floor(a*n/b))
import math

A, B, N = map(int, input().split())
f = []
count = 0
roop = True
zero = False
for x in range(N+1):
  count += 1
  s = math.floor(A*x/B) - A * math.floor(x/B)
  f.append(s)
  if s == 0 and roop == True and count >= N:
      roop = False
  elif s == 0 and roop == False:
      zero = True
      print(f)
      print(f[count-1])
      exit()
if zero == False:
    print(f[count-1])
a, b, n = map(int, input().split())
x = -999999999
i, j = 0, n
while(i <= j):
    mid = i + (j - i) // 2
    if(((a * mid) // b) - a * (mid // n) >= x):
        i = mid + 1
        x = ((a * mid) // b) - a * (mid // n)
    else:
        j = mid - 1
    # print(i, j)    
print(x)
a, b, n = map(int, input().split())

import math

cnt = 0
box = [0]
for x in reversed(range(1, n+1)):
  floor = math.floor(a*x/b) - a*math.floor(x/b)
  box.append(floor)
  cnt+=1
  if cnt > b/2+1:
    break
#  print(x, math.floor(a*x/b), a*math.floor(x/b), floor)

box.sort(reverse=True)
print(box[0])
#print(box)
a,b,n=map(int, input().split())
from math import floor
cand1=floor(a*n/b)-a*floor(n/b)
x=n//b*b-1
if x<0:
    x=n-1
cand2=floor(a*x/b)-a*floor(x/b)
cand1=max(cand2,cand1)

x=n//b*b
cnt=0
for i in range(n,n//b*b-1,-1):
    cnt+=1
    cand0=floor(a*i/b)-a*floor(i/b)
    if i<0:
        break
    if cand0>cand1:
        cand1=cand0
    if cnt>10**8:
        break
print(cand1)
a, b, n = map(int, input().split())
x = 0

if n % b == 0:
  x = n - 1
else:
  x = n

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

cnt = 1
buf = []
buf.append(int(a * n / b) - a * (int(n / b)))

while True:
    if n / b > 10 ** 6:
        break
    x = cnt * b - 1
    if n < x :
        break
    calc = int(a * x / b) - a * (int(x / b))
    if calc > max(buf):
        buf.append(calc)
    cnt += 1
    
if n / b > 10 ** 6:
    ans = n // b

ans = max(buf)
print(ans)
a, b, n = map(int, input().split())
print((a * n)//b - a*(n//b))
import sys
a, b, n, = map(int, input().split())
if n < b:
    print(int(a*(n)/b)-a*int((n)/b))
    sys.exit(0)
max = 0

row, up = n-b, n
while row <= up:
    mid = (row+up)//2
    if n//b == mid//b:
        up = mid-1
    elif n//b > mid//b:
        row = mid+1
if int((a*up)/b)-a*int((up)/b) > int((a*n)/b)-a*int((n)/b):
    print(int((a*up)/b)-a*int((up)/b))
else:
    print(int((a*n)/b)-a*int((n)/b))
A, B, N = map(int, input().split())

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

X = N
Y = min(B-1,N)

print(min(f(X),f(Y)))
A,B,N=map(int,input().split())
s=list(range(1))
for x in range(N):
  s.append(int((A*x)/B)-A*int(x/B))
print(max(s))
A,B,N = list(map(int , input().split()))

if N>B:
    x = B -1
else:
    x = N
F1 = (A*x)//B
F2 = A * (x//B)
S = F1 - F2
L = S
K = 0
while (L>K):
    L = S
    x -= 1
    F1 = (A*x)//B
    F2 = A * (x//B)
    S = F1 - F2
    K = S
ans = max(L,K)

print(ans)
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) > 2:
        if al[-1] <= al[-3]:
            break
if max(al) < 0:
    print(0)
else:
    print(max(al))
a,b,n=map(int,input().split())
a1=int((a*n)/b)-a*int(n/b)
i=int((n+1)/b)
if i!=0:
    a2=int((a*(i*b-1))/b)-a*int((i*b-1)/b)
    a3=int((a*(b-1))/b)-a*int((b-1)/b)
    print(max(a1,a2,a3))
else:
    print(a1)
import math
import numpy as np
c1,c2,c3 = (int(x) for x in input().split())
c5 =int(0) 
for i in range(c3-100,c3 + 1):
    c4 = math.floor(c1*i/c2) - c1*math.floor(i/c2)
    if c5 <=c4:
        c5 = c4
print(c5)
A,B,N = map(int,input().split())

print(max(int(A * i / B) - int(i/B) for i in range(1,N+1)))
import math
a, b, n = map(int, input().split())

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

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

print(((A*N)//B) - (A*(N//B)))
a, b, n = [int(x) for x in input().split()]

y = min(b, n)

print((a*y)//b)
a,b,n=map(int,input().split())
for i in range(1,n+1):
  ans=(a*i//b)-a*(i//b)
  ans2=(a*(i+1)//b)-a*((i+1)//b)
  if ans>=ans2:
    print(ans)
    break
a, b, n = [int(x) for x in input().split()]
def f(x):
  return a*x//b - a *(x//b)
print(f(min(b, n - 1)))
a, b, n =  map(int, input().split())

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

else:
  print(0)
import numpy as np
def main():
    A, B, N = map(int, input().split())
    max_value = 0
    if N < B:
        np.floor(A*(N-1)/B)
    else:
        for x in range(N+1):
            value = np.floor(A*x/B) - A * np.floor(x/B)
            #print(x, value)
            if value > max_value:
                max_value = value
    print(int(max_value))
    
if __name__ == '__main__':
    main()
A,B,N = map(int,input().split())
if N >= B:
    print(B)
else:
    print((A*N)//B-A*(N//B))
A, B, N = map(int, input().split())

print((A * (N % B)) // B)
import math

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


ans1 = 0

x = int(B/A)
while x <= N and x <= B:
    ans = int((A * x) / B) - A * int(x / B)
    print(((A * x) / B), (x / B))
    ans1 = max(ans1, ans)
    x += 1
print(ans1)
import math
a, b, n = map(int, input().split())
x = math.floor(n)
ans = math.floor(a * x//b)
print(ans)
A,B,N = map(int, input().split(' '))
print(int(A*(N)/B))
A, B, N = [int(i) for i in input().split()]

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

prev = -1
for n in range(N + 1, 0, -1):
    res = floor(A, B, n)
    if res < prev:
        print(prev)
        break
    prev = res
import math


def solve():
    A, B, N = map(float, input().split())
    ans = 0
    div_ab = A/B
    div_1b = 1/B
    now_1 = (max(1, int(N)-100)*A)/B
    now_2 = max(1, int(N)-100)/B

    for i in range(max(1, int(N)-100), int(N) + 1):
        ans = max(math.floor(now_1) - A*math.floor(now_2),ans)
        now_1 += div_ab
        now_2 += div_1b

    print(int(ans))


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


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

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

import math
M = 0
for x in range(max(N-1000,0),N+1):
    Z = math.floor(A * x / B) - A * math.floor(x / B)
    if M < Z:
        M = Z
print(M)
a, b, n = map(int, input().split())
if b > n:
    ans = int(a * (n) / b) - a * int((n) / b)
else:
    ans = int(a * (n - 1) / b) - a * int((n - 1) / b)
for i in range((n + 1 - 100000), n + 1)[::-1]:
    if n >= i and i > 0:
        floor = int(a * i / b) - a * int(i / b)
        ans = max(ans, floor)
for i in range(100000):
    if n >= i and i > 0:
        floor = int(a * i / b) - a * int(i / b)
        ans = max(ans, floor)
print(ans)
A,B,N=map(int,input().split())
if B<=N:
  print(A*(B-1)/B)
else:
  print(int(A*N/B))
import math
A, B, N = list(map(int, input().split()))
if B >= N:
  ans = int(A*(N/B-N//B))
else:
  ans = int(A*(B-1)/B)
print(ans)
A,B,N = map(int,input().split())
ans = 0
for i in range(N//B+1):
    x = B*i
    cur = A*x/B//1 - A*(x/B//1)
    ans = max(ans, cur)

for i in range(N//B*B,N+1):
    cur = A*i/B//1 - A*(i/B//1)
    ans = max(ans, cur)
print(int(ans))
# abc165_d.py
A, B,N = map(int,input().split())
ans = 0
for i in range(A):
    if N < i:
        break
    t = (A*i) // B - A * (i//B)
#    print(i, t,floor(A*i/B),A*floor(i/B))
    if ans < t :
        ans = t
print(ans)
a, b, n = map(int, input().split())
ans1 = 0
ans2 = 0
ans = 0
ax = 0
x = 0
c = a*(b-1)
for _ in range(b-1, n+1, b):
    ax += c
    x += b-1
    if ax % b == 0:
        ax = 0
        ans1 += 1
    else:
        ans1 = ax//b
    ans = max(ans, ans1-ans2)
    ans2 += 1
print(ans)
li=list(map(int,input().split()))
a=li[0]
b=li[1]
n=li[2]

for x in range(0,n+1):
  c=int((a*x)/b)
  d=int(x/b)
  e=int(c-a*d)
  list=[]
  list.append(e)
  
print(max(list))
A,B,N=map(int,input().split())

maxP=0

for i in range(1,N+1):
    tmp=(A*i)//B-A*(N//B)
    if maxP<tmp:
        maxP=tmp
        
print(maxP)
a,b,n=map(int,input().split())
if n>=b:
    x=b-1
    fl1=a*x//b
    fl2=a*(x//b)
else:
    fl1=a*(n//b)
    fl2=a*(n//b)
    
ans = fl1-fl2
print(ans)
A,B,N= map(int,input().split())


floor_num=[]
for x in range(N+1):
    floor_num.append(int(A*x/B)-A*int(x/B))
    print((int(A*x/B)-A*int(x/B)))

print(max(floor_num))
import math                                                       
A, B, N = map(int, input().split())

# A, B, N = 11, 10, 9

maxR = -1
maxX = 0
for x in range(1, N+1):
    R = math.floor(A*x/B) - A * math.floor(x/B)
    if R > maxR:
        maxR = R
        maxX = x
print (maxX)
# Code for D - Floor Function
# Use input() to fetch data from STDIN
from math import floor

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

max_result = 0
for x in range(min(a * 2, n)):
    x = x + 1
    r = floor(a * x / b) - a * floor(x / b)
    if r > max_result:
        max_result = r

print(max_result)
A, B, N = map(int, input().split())
from math import floor
from math import gcd

k = gcd(A, B)

As = A // k
Bs = B // k
if Bs-1 <= N:
    m = Bs - 1
else:
    m = N
print(floor(As * m / Bs) - As * floor(m / Bs))
# for x in range(1, N+1):
#     print(floor(As*x/Bs)-As*floor(x/Bs))
A, B, N= map(int, input().split())
score=0
max_score=0
for i in range(N):
    score=(A*(i+1)//B)-((i+1)//B)
    if max_score<=score:
        max_score=score
print(max_score)
import sys
input = sys.stdin.readline
import random
import copy
import math
def main():
     A,B,N = map(int,input().split())
     ma = 0
     for x in range(1,min(A+1,N+1)):
          ma = max(ma,math.floor(A*x/B)-A*math.floor(x/B))
     print(ma)
                    
main()
import math

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

temp = -1 * float('inf')
temp2 = -1 * float('inf')

if A > N or B > N:
    temp = math.floor(A*N/B) - A*math.floor(N/B)
elif A < B and B < N:
    temp = math.floor(A*(B-1)/B) - A*math.floor((B-1)/B)
else:
    x = A - 1
    while x <= N:
        if temp <= math.floor(A*x/B) - A*math.floor(x/B):
            temp = math.floor(A*x/B) - A*math.floor(x/B)
            x += A

print(temp)
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)
s = input().split(' ')
a = int(s[0])
b = int(s[1])
i = int(s[2])

ans = 0
eps = 0.000000001
if(a * i < b):
    d1 = 0
else:
    d1 = (a * i) / b
    d1 = int(d1+eps)
    d2 = (i / b)
    d2 = int(d2+eps)
ansi = int(d1 - (a * d2))
ans = max(ans, ansi) 
print(ans)
import math
 
A, B, N = map(int, input().split())
c = 0
for x in range(N, 1, -1):
    j = (A*x / B)
    k = (x / B)
    a = math.floor(j) - A * math.floor(k)
    if a <= c :
        break
    c = a
print(c)
def cal(i):
    return floor(a*i/b)-a*floor(i/b)
from  math import floor
a, b, n = map(int, input().split())
ans = 0
if b-1<n:
    ans = cal(b-1)
print(max(cal(ans),cal(n),0))
from math import floor

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

for x in range(0, n):
    result = floor(a*x)/b - a*floor(x/b)

print(floor(result))
a, b,n  = map(int, input().split())
from math import floor
if n<b:
    ans =  floor(a*n/b)-a*floor(n/b)

else:
    m = n//b
    m = m*b-1
    
    if m<0:
        m += 1
    ans = floor(a*m/b)-a*floor(m/b)
print(ans)
# coding: utf-8
# Your code here!
import math
 
A,B,N = map(int, input().split())
List=[]
i=1
count=0
while i<=N:
    one=math.floor((A*i)/B)
    two=math.floor(i/B)
    three=A*two
    ans=one-three
    List.append(ans)
    if ans==0:
        count+=1
        if count==10:
            break
    #print(ans)
    i+=1
#print("ans")
print(max(List))
import math
import sys

a, b, n = map(int, input().split())
step = math.ceil(n/(3*(10**6)+1000))
array = range(1, n+1, step)
ans = -sys.maxsize-1

for x in array:
    val = int((a*x)/b) - a*int(x/b)
    if val > ans:
        ans = val

print(ans)
import sys
def main():
    A,B,N=tuple(map(int,sys.stdin.readline().split()))
    L=max([1,min([B-1,N])])
    print((A*L)//B)
if __name__=='__main__':main()
import math
A,B,N=map(int,input().split())
answer=0
for i in reversed(range(1,N+1)):
    temp=math.floor(A*i/B)-A*math.floor(i/B)
    if answer>temp:
        break
    else:
        
        answer=max(answer,temp)
    
print(answer)
a, b, n = map(int, input().split())

ans = 0
zero_cnt = 0
for i in range(n+1):
    tmp = int(a*i/b) - a*int(i/b)
    if tmp == 0:
        zero_cnt += 1
    if zero_cnt == 10:
        break
    ans = max(ans, int(a*i/b) - a*int(i/b))
print(ans)
A, B, N = map(int, input().split())
max = 0
wait = int(B/A) + 1
for x in range(1, N+1, wait):
    fun = int(A*x/B) - A*int(x/B)
    if x == 1:
        x0 = fun
    elif x > wait:
        if x0 == fun:
            break
    if max < fun:
        max = fun
print(max)
def floor(a):
    return int(a)

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

    max_amount = 0
    for i in range(0,min(b-1,n)):
        amount = floor(a*i/b) -a*floor(i/b)
        max_amount = max(max_amount,amount)

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

print(ans)
A,B,N = map(int,input().split())
lst = []
for i in range(N,N+1):
    c = int(A*i/B) - A * int(i/B)
    lst.append(c)
print(max(lst))
from math import ceil
A,B,N=map(int,input().split())

if N<ceil(B/A):
  ans=0
elif ceil(B/A)<=N<B:
  ans= (A*N)//B
else:
  ans = B-1

print(ans)
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
if max(al) < 0:
    print(0)
else:
    print(max(al))
import math

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

if N >= B:
    print(A)
else:
    print(f(min([B-1, N]), A, B))
import sys
input = sys.stdin.readline
import random
import copy
import math
def main():
     A,B,N = map(int,input().split())
     if min(B,N) == N:
          x = min(B,N)-0.000000000001
          ma = math.floor(A*x/B)-A*math.floor(x/B)
          x = N
          ma = max(ma,math.floor(A*x/B)-A*math.floor(x/B))
     else:
          ma = A-1
     print(ma)
                    
main()
ABN = list(map(int,input().split()))
A = ABN[0]
B = ABN[1]
N = ABN[2]

max_of_x = min(B-1, N)
max = int(A*max_of_x/B)

x=B*2-1
score = int(A*x/B) - A*int(x/B)
if score>max:
    max = score
print(max)
import math
a,b,n = map(int,input().split())
ans = 0
print((a*n)//b - a*(n//b))
def floor(bunshi,bunbo):
    return bunshi//bunbo

a,b,n = map(int,input().split())
ans = 0
for i in range(1,b):
    tmp = floor(a*i,b) - a * floor(i,b)
    #print(i,tmp)
    ans = max(ans,tmp)
    
print(ans)
a, b, n = map(int, input().split())

cnt = 1
buf = []
buf.append(int(a * n / b) - a * (int(n / b)))

while True:
    if n / b > 10 ** 6:
        break
    x = cnt * b - 1
    if n < x :
        break
    calc = int(a * x / b) - a * (int(x / b))
    if calc > max(buf):
        buf.append(calc)
    cnt += 1
    

ans = max(buf)
print(ans)
import math

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

k = n//b

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

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

print(ans)
import math


a, b, n = map(int, input().split())
li1 = [0, 1, 2, 3, (n/2-1), n/2, (n/2)+1, n-3, n-2, n-1, n]
li2 = []
for x in li1:
    an = math.floor(a*x/b) - a * math.floor(x/b)
    li2.append(an)
print(max(li2))
A,B,N = map(int,input().split())
if B >= N - 1:
    print(A * N // B)
else:
    print(A * (B-1) // B)
A, B, N = map(int, input().split())
from math import floor
mans = -10e9
x = N
cand = floor(A*x/B) - A * floor(x/B)
print(cand)