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

Solution (Python):
temp=list(map(int,input().rstrip().split()))
a=temp[0]
b=temp[1]
n=temp[2]
if (b-1)<n :
  x=(b-1)
else :
  x=n
v=((a*x)//b)-(a*(x//b))
print(v)

Solution (Python):
from math import floor

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)  
to_index = lambda x: int(x) - 1  
print_list_in_2D = lambda x: print(*x, sep="\n")  


def input_int():
    return int(input())

def map_int_input():
    return map(int, input())

MII = map_int_input

def MII_split():
    return map(int, input().split())

def MII_to_index():
    return map(to_index, input())

def MII_split_to_index():
    return map(to_index, input().split())


def list_int_inputs():
    return list(map(int, input()))

LII = list_int_inputs

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


def LII_2D(rows_number):
    return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number):
    return [LII_split() for _ in range(rows_number)]

import math

A, B, N = MII_split()

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









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

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

Solution (Python):
A,B,N = [int(i) for i in input().split()]
t = min([N,B-1])
print((A*t//B))

Solution (Python):
L=list(map(int,input().split()))
A=L[0]
B=L[1]
N=L[2]
if N>=B-1:
    print(int(A*(B-1)/B))
else:
    print(int(A*N/B))

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

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

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

Solution (Python):
"""
~~ author : dokueki
~~ created : 07~05~2020
"""

import sys
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)-1
sys.setrecursionlimit(10**7)
mod = 1000000007


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def Try():
    a, b, n = map(int, sys.stdin.readline().split())
    x = min(b - 1, n)
    print((a*x)//b - a*(x//b))


def main():
    Try()


if __name__ == "__main__":
    try:
        IOE()
    except:
        pass
    main()

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

Solution (Python):
import sys
import math
from decimal import *
sys.setrecursionlimit(10**6)


def main(input, print):
    a, b, n = map(Decimal, input().split())
    l = 0
    r = n
    ans = math.floor(a*n/b) - a*math.floor(n/b)
    while r-l > 1:
        mid = (l+r)//2
        t = math.floor(a*mid/b) - a*math.floor(mid/b)
        if ans > t:
            r = mid
        else:
            ans = t
            l = mid

    print(ans)


if __name__ == '__main__':
    main(sys.stdin.readline, print)

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

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

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

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

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

print(A*x//B)

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())
x = min(b -1, n)
ans = int(a * x/ 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())
y = min(b-1, n)
ans = a*y//b - y//b * a
print(ans)

Solution (Python):
def main():
    A, B, max_v = map(int, input().split())

    x = min((B-1), max_v)
    answer = A * x // B

    print(answer)


if __name__ == "__main__":
    main()

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

print(ans)

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

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

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

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

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


print(a)

Solution (Python):
def q4():
    import math
    A, B, N = (int(i) for i in input().split())
    x = B - 1 if N >= B else N
    ans = math.floor(x*A//B) - A * math.floor(x//B)
    return ans
 
 
if __name__ == '__main__':
    ans = q4()
    print(ans)

Solution (Python):
def q4():
    import math
    A, B, N = (int(i) for i in input().split())
    x = B - 1 if N >= B else N
    ans = math.floor(x*A//B) - A * math.floor(x//B)
    return ans


if __name__ == '__main__':
    ans = q4()
    print(ans)

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

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

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

print((a*x)//b - a*(x//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):
import math

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

left, right = 0, n

while abs(right - left) > 3:
    mid1 = (right * 2 + left) // 3 + 1
    mid2 = (right + left * 2) // 3
    if f(mid1) <= f(mid2):
        
        right = mid1
    else:
        
        left = mid2
ans = 0
for i in range(left, right + 1):
    ans = max(ans, f(i))

print(max(ans, f(0), f(n)))

Solution (Python):
import math

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

left, right = 0, n

while abs(right - left) > 3:
    mid1 = (right * 2 + left) // 3 + 1
    mid2 = (right + left * 2) // 3
    if f(mid1) <= f(mid2):
        
        right = mid1
    else:
        
        left = mid2
ans = 0
for i in range(left, right + 1):
    ans = max(ans, f(i))
print(max(ans, f(0), f(n)))

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

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())
x = min(n, b - 1)
print(((a * x) // b) - (a * (x // b)))

Solution (Python):
import sys,math

input = sys.stdin.readline
 

def inp():
    return(int(input()))
def inara():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
def invr():
    return(map(int,input().split()))



a,b,n=invr()
ans=-1

hi=n
lo=0

while hi>=lo:
	mid=(hi+lo)//2
	temp=(a*mid)//b-a*(mid//b)
	if temp>=ans:
		lo=mid+1
		ans=temp
	else:
		hi=mid-1
print(ans)

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

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

Solution (Python):
import sys
a, b, n = [int(i) for i in sys.stdin.readline().split()]
x = min(b-1, n)
print(int(x / b * a) - int(x / b) * a)

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

Nomin = floor(A/B*N)

print(Nomin)

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


if b <= n:
    beta = ( b-1 )/b - int( ( b-1 )/b )

elif b > n:
    beta = n/b - int( n/b )

ans = int( a * beta )
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())

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

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

Solution (Python):
s = input().split(' ')
a = int(s[0])
b = int(s[1])
n = int(s[2])

i = min(b-1, n)
ans = 0
d1 = (a * i) // b
d2 = (i // b)
ans = d1 - (a * d2)
print(ans)

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

Solution (Python):
import  math

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

Solution (Python):
A, B, N = [int(_) for _ in input().split()]
x = min(B-1, N)
print((A * x) // B)

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

m = min(b-1, n)

print(a * m // 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)
print(f(min(N,B-1)))

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

Solution (Python):
def i():
    return int(input())
def i2():
    return map(int,input().split())
def s():
    return str(input())
def l():
    return list(input())
def intl():
    return list(int(k) for k in input().split())

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

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

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

else:
    print(a * n // b)

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

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

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

    return calc(min(n, b-1))

print(m())

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

Solution (Python):
from sys import stdin
A,B,N=list(map(int, (stdin.readline().strip().split())))

if B-1<=N:C=B-1
else:C=N
a=(A*C)//B
b=A*(C//B)
print(a-b)

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








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

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

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

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

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

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

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

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

main()

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





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

print(int(A*x/B))

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B, N = MAP()

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

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B, N = MAP()

x = min(N, B-1)

print((A*x)//B)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B, N = MAP()

x = min(N, B-1)

print(int(A*x/B))

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

Solution (Python):
import math

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

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

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

Solution (Python):

def main():
    import sys
    imput = sys.stdin.readline
    
    
    A, B, N = map(int, input().split())

    
    
    
    

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

if __name__ == "__main__":
    main()

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

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

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

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

Solution (Python):


import sys

A,B,N = (int(x) for x in input().split())
ans =0
if B <=N:
    ans =int(A*(B-1)/B) 
else:
    ans =int(A*N/B)
print(ans)

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

Solution (Python):

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)

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

ans = 0

if n < b:
    ans = int(a*n/b)
    print(ans)

else:
    ans = int(a * (b - 1) / b)
    print(ans)

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

Solution (Python):


import sys


def solve(A: int, B: int, N: int):
    def f(x: int) -> int:
        return int(A*x/B) - A*int(x/B)
    print(f(min(B-1, N)))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    N = int(next(tokens))  
    solve(A, B, N)


if __name__ == '__main__':
    main()

Solution (Python):
import math
a,b,n = map(int,input().split())
if b <= 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,c=map(int,input().split())
if c+1>=b:
    ans=int(a*(b-1)/b)
else:
    ans=int(a*c/b)
print(ans)

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

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

Solution (Python):
import math

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

if b <= 10**6:
    maxVal = 0

    for i in range(b):
        if i > n:
            break
        val = math.floor(a*i/b)-a*math.floor(i/b)
        if val > maxVal:
            maxVal = val

    print(maxVal)
elif n > b:
    print(a-1)
elif n == b:
    m = n - 1
    print(math.floor(a*m/b)-a*math.floor(m/b))
else:
    print(math.floor(a*n/b)-a*math.floor(n/b))

Solution (Python):
A, B, N = [eval(v) for v in input().strip().split(" ")]

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

Solution (Python):
import math

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

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

Solution (Python):
import math


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


A, B, n = map(int, input().split())
print(eq_value(A, B, min(B-1, n)))

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    a,b,n=map(int,input().split())
    if n>=b:
        print(a*(b-1)//b)  
    else:
        print(a*n//b)  

if __name__=='__main__':
    main()

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    a,b,n=map(int,input().split())
    if n>=b:
        print(a*(b-1)//b)  
    else:
        print(a*n//b)  

if __name__=='__main__':
    main()

Solution (Python):
def solve(a, b, n):
    def f(x):
        return a*x//b - a*(x//b)
    y = min(b-1,n)
    return max(f(y-i) for i in range(min([a,b,n])))
assert solve(5, 7, 4) == 2
assert solve(11, 10, 9) == 9

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

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

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

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

Solution (Python):
import math

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




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

print(m)

Solution (Python):


























import math

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

def resolve_v1(A, B, N):
    maxM = 0
    for x in range(N+1): 
        M = calcM(A, B, x)
        maxM = max(maxM, M)

    return maxM

def resolve_v2(A, B, N):
    
    maxM = calcM(A, B, N)

    for x in filter(lambda x: (x + 1) % B == 0, range(N+1)): 
        maxM = max(maxM, calcM(A, B, x))
    return maxM


def resolve_v3(A, B, N):
    return calcM(A, B, min(N, B - 1))

if __name__ == '__main__':
    A, B, N = map(int, input().split())
    M = resolve_v3(A, B, N)
    print(M)

Solution (Python):


























import math

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

def resolve_v1(A, B, N):
    maxM = 0
    for x in range(N+1): 
        M = calcM(A, B, x)
        maxM = max(maxM, M)

    return maxM

def resolve_v2(A, B, N):
    
    maxM = calcM(A, B, N)

    for x in filter(lambda x: (x + 1) % B == 0, range(N+1)): 
        maxM = max(maxM, calcM(A, B, x))
    return maxM


def resolve_v3(A, B, N):
    maxM = calcM(A, B, N)

    k, r = divmod(N, B)
    if k and B * k -1 <= N:
        
        maxM = max(maxM, calcM(A, B, B - 1))
    
    

    maxM = calcM(A, B, min(N, B - 1))


    return maxM

if __name__ == '__main__':
    A, B, N = map(int, input().split())
    M = resolve_v3(A, B, N)
    print(M)

Solution (Python):


























import math

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

def resolve_v1(A, B, N):
    maxM = 0
    for x in range(N+1): 
        M = calcM(A, B, x)
        maxM = max(maxM, M)

    return maxM

def resolve_v2(A, B, N):
    
    maxM = calcM(A, B, N)

    for x in filter(lambda x: (x + 1) % B == 0, range(N+1)): 
        maxM = max(maxM, calcM(A, B, x))
    return maxM


def resolve_v3(A, B, N):
    maxM = calcM(A, B, N)

    k, r = divmod(N, B)
    if k and B * k -1 <= N:
        
        maxM = max(maxM, calcM(A, B, k * B - 1))
    
    

    maxM = calcM(A, B, min(N, B - 1))


    return maxM

if __name__ == '__main__':
    A, B, N = map(int, input().split())
    M = resolve_v3(A, B, N)
    print(M)

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

Solution (Python):
A, B, N = [int(x) for x in input().split()]
def func(A, B, x):
    return int(A * x / B) - A * int(x/B)

if B <= N:
    print(func(A, B, B - 1))
else:
    print(func(A, B, N))

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

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

Solution (Python):

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

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

Solution (Python):
import math

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

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


ans=floor(A,B,min(B-1,N))

print(ans)

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


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


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

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

print(A)

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

max_score = 0
y = min(b, n)

for x in range(max(y - 100000, 1) , min(y + 200000, n+1)):
    score = a * x // b - a * ( x // b )
    if score > max_score:
        max_score = score
print(max_score)

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

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)


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

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

Solution (Python):
import math

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

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

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

Q = N % B
answer = 0

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

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

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

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

max = 0

    
        

if(N < (B-1)):
    max = floor(N)
else:
    max = floor(B-1)

print(max)

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

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

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

Solution (Python):
import math
import sys

a, b, n = map(int, sys.stdin.readline().rstrip().split())
tmp = min(b - 1, n)

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

Solution (Python):
from math import floor
def Main(A, B, N):
    if N < B:
        return floor(A*N/B)-A*floor(N/B)
    else:
        return floor(A*(B-1)/B)-A*floor((B-1)/B)

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

if __name__ == '__main__':
    main()

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

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

Solution (Python):

import math

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

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

Solution (Python):
import math

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

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

Solution (Python):
from sys import stdout, stdin
from queue import Queue
from collections import defaultdict
import math
a,b,n = map(int, stdin.readline().strip().split())
x = min(b - 1, n)
ans = math.floor(a * x / b) - a * math.floor(x / b)
stdout.writelines(str(ans) + '\n')

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

print((A*x)//B)

Solution (Python):

"""
Created on Tue May  5 22:13:53 2020

@author: shinba
"""


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

m = min(B-1,N)

print(int(A*m/B))

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

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

Solution (Python):
import math

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

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

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

Solution (Python):
from sys import stdin, stdout
from collections import defaultdict
import math
from queue import Queue

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

x = min(b - 1, n)

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

stdout.writelines(str(ans) + '\n')

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

if __name__ == "__main__":
    main()

Solution (Python):
import math

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

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

ans = math.floor(a*n/b) - a*math.floor(n/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())

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

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

Solution (Python):
from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10 ** 10




A, B, N = [int(x) for x in stdin.readline().rstrip().split()]

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

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

print(ans)

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

if B==1:
  print(0)
else:
  tb = B - 1
  tp_pre = 0
  while(True):
    tp = (A*tb)//B - A*(tb//B)
    if tp > tp_pre:
      tp_pre = tp
    tb += B
    if tb > N:
      break
  if (B > N):
    print((A*N)//B - A*(N//B))
  else:
    print(int(tp_pre))

Solution (Python):
from math import floor

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

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

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

from math import floor
def f(x): return floor(A*x/B)

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

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

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(int(result))

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


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


if n < b:
    print(f(n))
else:
    print(f(b - 1))

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 math
def equation(a,b,n):
  return math.floor((a*n)/b)-a*math.floor(n/b)
d,e,f = map(int,input().split())
K = min(e-1,f)
print(equation(d,e,K))

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

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

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

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):
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:
    print((A*(N)) // B  - A * ((N) // B ))
else:
    print((A*(B-1)) // B  - A * ((B-1) // B ))

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

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

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

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

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    a,b,n = LI()
    r = 0
    if b < 10**6:
        for k in range(1,min(b,n+1)):
            u = a*k//b - a*(k//b)
            if r < u:
                r = u
        return r

    i = 1
    while True:
        t = b*i
        if t % a == 0:
            k = t // a
        else:
            k = t // a + 1
        if k > n:
            break
        u = a*k//b - a*(k//b)
        if r < u:
            r = u
        i += 1

    return r


print(main())

Solution (Python):

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

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

else:
    print(math.floor(a*(b-1)/b))

Solution (Python):







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

if __name__ == "__main__":
    main()