Problem:
 Score : 400 points    Problem Statement Given are integers A , B , and N .  Find the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N .  Here floor(t) denotes the greatest integer not greater than the real number t .      Constraints  1 ≤ A ≤ 10^{6}  1 ≤ B ≤ 10^{12}  1 ≤ N ≤ 10^{12}  All values in input are integers.         Input Input is given from Standard Input in the following format:  A  B  N       Output Print the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N , as an integer.        Sample Input 1 5 7 4      Sample Output 1 2  When x=3 , floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2 . This is the maximum value possible.       Sample Input 2 11 10 9      Sample Output 2 9

Solution (Python):
A, B, N = map(int, input().split())
if (B-1) >= N:
    Max = ((A*N) // B) - A*(N // B)
elif (B-1) < N:
    Max = ((A*(B-1)) // B) - A*((B-1) // B)

print(Max)

Solution (Python):
import math
A, B, N = map(int, input().split())
x = min(N, B - 1)
print(math.floor(A * x / B) - A * math.floor(x / B))

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

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

Solution (Python):
a,b,n = list(map(int, input().split()))
t = 0
n = min(b-1,n)

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

Solution (Python):

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

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

Solution (Python):
import math
A,B,N = map(int, input().split())




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

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

Solution (Python):
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)))

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

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

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

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


if N//B == 0:
    ans_i = N
else :
    ans_i = B*(N//B)-1

print((A*ans_i)//B - A*(ans_i//B))

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

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

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

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

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

import math

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

Solution (Python):


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


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

Solution (Python):
a,b,n = map(int,input().split())
if b <= n:
    k = b-1
else:
    k = n
m = int(k*a/b) - a*int(k/b)
print(m)

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

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

Solution (Python):
import math

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







temp = min(B - 1, N)

ans = math.floor(A * temp / B) - A * math.floor(temp / B)
print(ans)

Solution (Python):




from math import floor


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

    print(f(min(N, B-1)))
main()

Solution (Python):

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

Solution (Python):

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


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


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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


def main():
    solve()


if __name__ == '__main__':
    main()

Solution (Python):
import sys,math,collections,itertools
input = sys.stdin.readline

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

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

Solution (Python):
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()

Solution (Python):
import sys
input = sys.stdin.readline
from math import floor

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

if N<B:
    print(floor(A/B*N))
else:
    print(floor(A/B*(B-1)))

Solution (Python):
a,b,n=list(map(int,input().split()))
if b==1:
    print(0)
elif n>=b:
    k=n%b
    if k==b-1:
        print(int(a*(n)/b)-a*int(n/b))
    else:
        print(int(a*(n-k-1)/b)-a*int(n/b-1))
else:
    print(int(a*n/b))

Solution (Python):
a,b,n = map(int, input().split())
yuka = lambda a,b: (a-(a%b))//b

x = min(n,b-1)
score = yuka(a*(x%b),b)
ans = score

print(ans)

Solution (Python):
a,b,n = list(map(int, input().split()))
x = min(n,b - 1)
print(int(a*x/b)-a*int(x/b))

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

if __name__ == "__main__":
    main()

Solution (Python):
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))

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

if B == 1:
  print(0)
else:
  N = min(N, B-1)
  print(A*N // B)

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

ans=-100000
for x in range(A):
  
  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)

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

Solution (Python):
import math

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

Solution (Python):
a, b, n = map(int,input().split())
x = min(n,b-1)
print(int(a*(x%b) / b))

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

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

if A == 1: print(0)
elif B == 1: print(0)

else:
  if N ==1: x=1
  elif N < B: x = N
  else:x = B-1
  print(int(A*x/B) - A*int(x/B))

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

Solution (Python):
import math
a, b, n = map(int, input().split())
 
 
def calc(a, b, n):
    return int(math.floor((a * n)/b) - (a * math.floor(n/b)))
 
if n <= b -1:
  print(calc(a,b,n))
else:
  print(calc(a,b,b-1))

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

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

Solution (Python):
import math
a, b, n = map(int, input().split())
 
 
def calc(a, b, n):
    return int(math.floor((a * n)/b) - (a * math.floor(n/b)))
 
if n <= b -1:
  print(calc(a,b,n))
else:
  print(calc(a,b,b-1))

Solution (Python):
def eq1(A,B,x):
    temp = (A*x)
    temp //= B
    return temp

def eq2(A,B,x):
    temp = x//B
    temp = temp*A
    return temp

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

    if B <= N:
        x = B-1
        ans = eq1(A,B,x) - eq2(A,B,x)
        return ans
    else:
        x = N
        ans = eq1(A,B,x) - eq2(A,B,x)
        return ans

print(main())

Solution (Python):

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

def func(t):
    return int(t)



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

Solution (Python):
import sys
def Ii():return int(sys.stdin.buffer.readline())
def Mi():return map(int,sys.stdin.buffer.readline().split())
def Li():return list(map(int,sys.stdin.buffer.readline().split()))

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

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

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

print((A*x)//B)

Solution (Python):
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)))

Solution (Python):
A, B, N = map(int, input().split())
r = min(B-1, N)
print(A*r//B)

Solution (Python):
import sys
input = sys.stdin.readline
import bisect
import math





def main():
    a, b, n = input_list()
    x = min(b-1, n)
    aa = math.floor((a*x)/b) - (a * math.floor(x/b))
    print(aa)

def bi(num, a, b, x):
    print((a * num) + (b * len(str(b))))
    if (a * num) + (b * len(str(b))) <= x:
        return False
    return True

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


def input_list_str():
    return list(map(str, input().split()))


if __name__ == "__main__":
    main()

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

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

if __name__ == "__main__":
    main()

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

s1 = (a*n)//b - a*(n//b)
x = max(1,n - n % b - 1)
s2 = (a*x)//b - a*(x//b) 

print(max(s1,s2))

Solution (Python):
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))

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


ans=0

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

print(ans)

Solution (Python):
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))

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

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

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

Solution (Python):
def II(): return int(input())
def MI(): return map(int, input().split())
A,B,N=MI()
def f(x):
  return A*x//B-A*(x//B)
if B-1<=N:
  ans=f(B-1)
else:
  ans=f(N)
print(ans)

Solution (Python):
A,B,N = (int(a) for a in input().split())

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

if B-1 <= N :
    print(max(f(B-1) , f(N)))
else : 
    print(f(N))

Solution (Python):
a, b, n = map(int, input().split())
t = min(b - 1, n)
print((a * t) // b)

Solution (Python):
import sys
import math
input = lambda: sys.stdin.readline().rstrip()

def main():
    a, b, n = 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))
    
if __name__ == '__main__':
    main()

Solution (Python):
A, B, N = map(int, input().split())
x = N if N<B else B-1

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

Solution (Python):
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

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


def solve():
    a,b,n = rl()
    if n >= b:
        ans = (a * (b - 1)) // b - a * ((b - 1) // b)
    else:
        ans = a * n // b

    print (ans)






mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()

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

Solution (Python):
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))

Solution (Python):
from math import floor
A, B, N = map(int, input().split())
print(floor(A*min(B-1, N)/B))

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 9)

def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
from math import ceil, floor, log2






def solve():
    A, B, N = MI()

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

if __name__ == '__main__':
    solve()

Solution (Python):
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)

Solution (Python):
f = lambda a, b, x: int(a*x/b)-a*int(x/b)
a, b, n = map(int, input().split())
print(f(a, b, min(b-1,n)))

Solution (Python):
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations_with_replacement, compress
import sys
import math
import bisect


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)


def main():
    A, B, N = LI()
    print(int(A / B * min(N, B - 1)))


main()

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

x = min(b-1,n)

print(int(a*x/b)-a*int(x/b))

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

Solution (Python):
import math

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

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

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

print(answer)

Solution (Python):
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()

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

Solution (Python):
import math

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

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

Solution (Python):
from math import floor

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

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

print(f(min(B-1,N)))

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

if __name__ == "__main__":
    main()

Solution (Python):
import math

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

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

if B - 1 <= N:
    ans = f(B - 1)
else:
    ans = f(N)
print(ans)

Solution (Python):
A, B, N = map(int, input().split())
from math import floor

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

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()

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

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

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

Solution (Python):
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))

Solution (Python):
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))

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

max = 0
if B - 1 >= N:
    i = N
else:
    i = B - 1
ans = A*i//B - A*(i//B)

print(ans)

Solution (Python):
import math
A, B, N = map(int, input().split())
ans = []
if B-1<N:
    sahen = math.floor(A*(B-1)//B)
    uhen = math.floor((B-1)//B)
    uhen = uhen*A
    ans.append(sahen-uhen)

sahen = math.floor(A*N//B)
uhen = math.floor(N//B)
uhen = uhen*A
ans.append(sahen-uhen)

print(max(ans))

Solution (Python):
import math
a,b,n=map(int,input().split())
ans=math.floor(a*min(n,b-1)/b)
print(ans)

Solution (Python):
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))

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

n = min(n,b-1)
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))



print(s)

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

import math

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

Solution (Python):
import math

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

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

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

Solution (Python):
import math

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

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

ans = [math.floor(a*x/b) - a*math.floor(x/b)]
ans.append(math.floor(a*(x-1)/b) - a*math.floor((x-1)/b))
if x < n:
    ans.append(math.floor(a*(x+1)/b) - a*math.floor((x+1)/b))

print(max(ans))

Solution (Python):


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


if __name__ == "__main__":
    main()

Solution (Python):
a, b, n = [int(x) for x in input().split()]
def f(x):
  return a*x//b - a *(x//b)
print(f(min(b - 1, n)))

Solution (Python):
from math import floor, ceil

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


num = min(b-1, n)

print(floor(a*num/b) - a*floor(num/b))

Solution (Python):
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))

Solution (Python):
import math
a, b, n = map(int, input().split())
if b > n:
  print(math.floor(a * n / b))
  quit()
else:
  print(math.floor(a - a / b))

Solution (Python):
import math
import collections
def f(a,b,x):
    return math.floor((a*x)/b) - a*math.floor(x/b)
a,b,n=map(int, input().split())
dd = collections.defaultdict(int)

print(f(a,b,min(b-1,n)))

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

Solution (Python):


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

def func(i):
    return int(i*a/b) - a*int(i/b)

print(func(min(b-1, n)))

Solution (Python):
import math
a, b, n = list(map(int, input().split()))
output = 0
if n < b:
  output = math.floor(a * n / b)
else:
  output = math.floor(a * (b-1) / b)
print(output)

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

Solution (Python):
def readinput():
    a,b,n=list(map(int,input().split()))
    return a,b,n

def main(a,b,n):
    m=int(min(b,n)*a/b)+1
    maxdif=0
    for xx in range(0,m):
        if b*xx%a==0:
            x=b*xx//a
        else:
            x=int(b/a*xx)+1
        maxdif=max(maxdif,int(a*x/b)-a*int(x/b))
    return maxdif

if __name__=='__main__':
    a,b,n=readinput()
    ans=main(a,b,n)
    print(ans)

Solution (Python):
import math
a,b,n=map(int,input().split())
def f(x):
  return math.floor(a*x/b)-a*(math.floor(x/b))


if n>=(b-1):
  print(f(b-1))
else:
  print(f(n))

Solution (Python):
import sys
A,B,N = map(int, input().split())


def calc(a,b,x):
    num = ((a*x)//b)-a*(x//b)
    return num


if B == N:
    X = N-1
    print(calc(A,B,X))
    sys.exit()
if B < N:
    X = B-1
    print(calc(A,B,X))
    sys.exit()
if B > N:
    X = N
    print(calc(A,B,X))
    sys.exit()

Solution (Python):
import math
a, b, n = map(int, input().split())

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

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

Solution (Python):
import math
a, b, n = map(int, input().split())

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

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

Solution (Python):
def main():
    a, b, n = list(map(int, input().split()))
    
    limit = 0
    if n >= b-1:
        limit = b-1
    else:
        limit = n
    
    floor_sub = int(limit * a / b) - int(limit / b) * a
    print(floor_sub)

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
import math

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

M = 0
t = min(b-1, n)
M = math.floor(a*t/b) - a*math.floor(t/b)

print(M)

Solution (Python):
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))

Solution (Python):
import math
a, b, n = map(int,input().split())



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

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

Solution (Python):
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))

Solution (Python):
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))

Solution (Python):
import math
A,B,N = map(int,input().split())

x = min(N,B-1)

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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

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

Solution (Python):
import sys

import math







input = sys.stdin.readline

getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = 10 ** 20
MOD = 1000000007

def solve():
    a, b, n = getList()
    if n >= b-1:
        x = b - 1
    else:
        x = n
    print(math.floor((a * x) / b) - a * math.floor(x/b))
    return
def main():
    n = getN()
    for _ in range(n):
        solve()
if __name__ == "__main__":
    
    solve()

Solution (Python):
import sys
import math
def IL(): return map(int,sys.stdin.readline().rstrip().split())
 
def Main():
    a,b,n = IL()
    x = min(b-1,n)
    print(a*x//b)
    return
 
if __name__=='__main__':
    Main()

Solution (Python):
import sys
import math
def IL(): return map(int,sys.stdin.readline().rstrip().split())

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

if __name__=='__main__':
    Main()

Solution (Python):


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

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

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

print(f(min(b-1,n)))

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

val = min(B-1, N)
ans = (A*val/B/1.0)//1
print(int(ans))

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

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

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

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

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

x = min(b-1, n)
print(a*x//b - a*(x//b))

Solution (Python):
A, B, N = map(int, input().split())
x = min(B-1, N)

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

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

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

Solution (Python):
import math
def main():
  a,b,n=map(int,input().split())
  if(b>n):
    print(math.floor(a*n/b)-a*math.floor(n/b))
    return
  if(n>=b):
    print(math.floor(a*(b-1)/b)-a*math.floor((b-1)/b))
    return
    
main()

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

Solution (Python):
import math

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

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

print(min(ans1, ans2))

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

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

Solution (Python):
def resolve():
    A, B, N = map(int, input().split())
    if B <= N+1:
        print(A*(B-1)//B)
    else:
        print(A*N//B)
resolve()

Solution (Python):
from math import floor


def main():
    A, B, N = map(int, input().split())
    if N >= B-1:
        x = B - 1
    else:
        x = N

    print(floor((A*x)/B) - A*floor(x/B))


if __name__ == '__main__':
    main()

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

def f(x):
    return (a*x)//b - a * (x//b)
if((b-1)>n):
    print(f(n))
else:
    print(f(b-1))

Solution (Python):
a,b,n=[int(x) for x in input().rstrip().split()]
if b<=n:
  n=b-1

print(int((a*n)/b)-a*int(n/b))

Solution (Python):
import math
A,B,N = [int(x) for x in input().split(' ')]
if N/B >= 1:
  print(int(A+math.floor(-float(A)/float(B))))
else:
  print(int(math.floor(float(N)*float(A)/float(B))))

Solution (Python):
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)

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

Solution (Python):
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()

Solution (Python):
def fact(n):
    ans = 1
    for i in range(2, n+1):
        ans*= i
    return ans
def comb(n, c):
    return fact(n)//(fact(n-c)*c)

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

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

Solution (Python):
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))

Solution (Python):

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

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

x = min(n, b-1)
print(a*x//b - a * (x//b))

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

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

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

Solution (Python):
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))

Solution (Python):
from math import floor
a, b, n = map(int, input().split())

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

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

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

if __name__ == "__main__":
    main()

Solution (Python):
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 B!=1 else print(0)
if __name__=='__main__':main()

Solution (Python):
import math

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

if N >= B-1:  
    beta = (B-1)/B
    print(math.floor(A * beta))

else:
    beta = N/B
    print(math.floor(A * beta))

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

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

print(ans)

Solution (Python):

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

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

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

if __name__ == "__main__":
    main()

Solution (Python):





A, B, N = [int(i) for i in input().split()]
x = 0
if N >= B:
    x = B-1
else:
    x = N 
y = (A * x)// B - A * (x//B)
print(y)

Solution (Python):
A,B,N = map(int, input().split())
t = min(B-1,N)
print(int(A*t/B)-A*int(t/B))

Solution (Python):
import math
a,b,c=map(int,input().split())
if b>c:
    print(math.floor((a*c)/b)-a*(math.floor(c/b)))
else:
    print(math.floor((a*(b-1))/b)-a*(math.floor((b-1)/b)))

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

Solution (Python):
A, B, N = map(int, input().split())
cnt = min(B-1, N)
result = int(A*cnt/B)-A*int(cnt/B)
  
print(result)

Solution (Python):
A, B, N = [int(i) for i in input().split(' ')]

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

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

print(m)

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

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

Solution (Python):
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)))

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


if __name__ == "__main__":
    solve()

Solution (Python):
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)

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

i=min(B-1,N)


tmp=(A*i)//B-A*(i//B)

        
print(tmp)

Solution (Python):
A,B,N =list(map(int,input().split()))
kai = 0
if B <= N:
	kai = int(A*(B-1)/B)
else:
	kai = int(A*N/B)
print(kai)

Solution (Python):
import sys
input = sys.stdin.readline



def main():
    A, B, N = [int(i) for i in input().strip().split()]
    ans = 0
    if N >= B:
        if A >= B:
            n = range(B - 1, N + 1, B)[-1]
        else:
            n = range(B - 1, N + 1, B)[0]
        ans = ((A * n) // B) - (A * (n // B))
    else:
        ans = ((A * N) // B) - (A * (N // B))
    return ans


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

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

a,b,n = na()

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

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

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

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