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


if math.floor(N / B) > 0:
    ans_x = B - 1
else:
    ans_x = N

l = math.floor((A * ans_x) / B)
r = A * math.floor(ans_x / B)

ans = l - r

print(ans)

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

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from operator import mul


sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
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)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


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

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

Solution (Python):
def target(x):
    return (A * x) // B - A * (x // B)


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

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

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

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

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


if __name__ == "__main__":
    main()

Solution (Python):
import math
b = list(map(int,input().split()))
ans=0
check=0
if b[2]>b[1]-1:
    check = math.floor((b[0]*(b[1]-1))/b[1]) - b[0]*math.floor((b[1]-1)/b[1])
else:
    check = math.floor((b[0]*b[2])/b[1]) - b[0]*math.floor(b[2]/b[1])
if check>ans:
    ans=check
print(ans)

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

Solution (Python):
import math
if __name__ == "__main__": 
	string = input()
	l = string.split(" ")
	a = int(l[0])
	b = int(l[1])
	n = int(l[2])
	ans = 0
	ni = min(n,b-1)
	f = math.floor((a*(ni))/b)
	s = math.floor((ni)/b)
	temp = int(f) - (a*int(s))
	ans = temp
	
	
	
	
	
	
	
	
	
	
	print(ans)

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

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())
tmp = int(n/b)
result = 0
if tmp != 0:
    result = b - 1
else:
    result = n
print(math.floor((a*result)/b) - a*math.floor(result/b))

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

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

print(ans)

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

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

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

Solution (Python):
import math


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

    x = min(b-1, n)

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

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

def fl(i):
  return ((A * i) // B) - (A * (i // B))

if B <= N:
  print(int(fl(B - 1)))
else:
  print(int(fl(N)))

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

Solution (Python):
A,B,N = map(int,input().split())
S = 0
n = N // B
r = N % B
if B > N:
    S = (A*N)//B
else:
    if  r == 0:
        S = (A*(N-1))//B - A * ((N-1)//B)
    elif r == B - 1:
        S = (A*N)//B - A * (N//B)
    else:
        S = (A*(n*B-1))//B - A * ((n*B-1)//B)

print(S)

Solution (Python):
a,b,n=map(int, input().split())
from math import floor
cand1=a*n//b-a*(n//b)
x=n//b*b-1
if x<0:
    x=n-1
cand2=a*x//b-a*(x//b)
print(max(cand2,cand1))

Solution (Python):
import math

def main(A, B, N):
    x = min(B-1, N)
    answer = math.floor(A * x / B) - A * math.floor(x / B)
    print(answer)

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

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

Solution (Python):
def resolve():
    '''
    code here
    '''
    A,B,N = [int(item) for item in input().split()]

    def func(x):
        first = int(A * x / B)
        second = A * int(x/B)
        return first - second

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

if __name__ == "__main__":
    resolve()

Solution (Python):

import sys
import numpy as np
import math

def solve(A: int, B: int, N: int):
    x = min(B-1, N)
    print(math.floor(A*x/B)-A*math.floor(x/B))
    return



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):
a, b, n = [int(x) for x in input().split()]

y = min(b-1, n)

print((a*y)//b)

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

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

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

Solution (Python):



import math as mt

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

    maxn = 0
    
    if N >= B:
        maxn = mt.floor(A*(B-1)/B) - A*mt.floor((B-1)/B)
    else:
        maxn = mt.floor(A*N/B) - A*mt.floor(N/B)
    
    print(maxn)


if __name__ == '__main__':
    main()

Solution (Python):
import math

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

x = min(N, B-1)

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

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

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

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

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

Solution (Python):

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

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

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

print(ans)

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

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


if __name__ == '__main__':
    main()

Solution (Python):
import math

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

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

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

Solution (Python):
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

A,B,N = FLI()

def f(x):
  return (A*x)//B - A * (x//B)
max = 0
x = min(B-1,N)

print(f(x))

Solution (Python):
A,B,N=[int(x) for x in input().rstrip().split()]
ans=0
now=0
aa=0

cnt=0

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):
def main():
    from builtins import int, map, list, print, max
    import sys, math
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

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


if __name__ == '__main__':
    main()

Solution (Python):
a,b,n=map(int,input().split())
a1=a*n//b
i=(n+1)//b
if i!=0:
    a2=a*(b-1)//b
    print(a2)
else:
    print(a1)

Solution (Python):
import math

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

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

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

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

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

Solution (Python):

import bisect
import heapq
import itertools
import math
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from math import gcd
from operator import add, itemgetter, mul, xor
def cmb(n,r,mod):
  bunshi=1
  bunbo=1
  for i in range(r):
    bunbo = bunbo*(i+1)%mod
    bunshi = bunshi*(n-i)%mod
  return (bunshi*pow(bunbo,mod-2,mod))%mod
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]
a,b,n = MI()
if n >= b:
  n = b-1
  print(math.floor(a*n/b)-a*math.floor(n/b))
else:
  print(math.floor(a*n/b)-a*math.floor(n/b))

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

Solution (Python):
from math import floor, gcd

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

def main():
    A, B, N = list(map(int, input().split(' ')))
    
    tmp = 0
    
    
    
    a = f(min(B-1, N), A, B)
    print(a)
    
    
main()

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

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

Solution (Python):
import math

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

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

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

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

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

print(ans)

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


resolve()

Solution (Python):
import numpy as np
if __name__ == "__main__":
    
    
    
    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())







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


max_num = h(min(B - 1, N))
print(max_num)

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

Solution (Python):

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

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

Solution (Python):
import sys
from io import StringIO
import unittest
import math

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

    
    

    
    
    
    
    
    

    n = min(b - 1, n)

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

    
    
    print(ans)

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """5 7 4"""
        output = """2"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """11 10 9"""
        output = """9"""
        self.assertIO(input, output)

if __name__ == "__main__":
    
    resolve()

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

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

print(ans)

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


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

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

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


num = list(map(int, input().split()))
a = num[0]
b = num[1]
n = num[2]
x = (int(n/b) + 1) * b - 1
max_num = f(a, b, min(b-1, n))
print(max_num)

Solution (Python):



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


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


def main():
    ans = f(min(B - 1, N))
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import math

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

m = b/a
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):
import math


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

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

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

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    


if __name__ == '__main__':
    main()

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))
elif n==b:
    print(F(n-1))
else:
    print(F(b-1))

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

Solution (Python):
import sys
import itertools
import collections

A, B, N = 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())

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

def check(x):
    return math.floor((A * x) / B)
            
print(check(x))

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

Solution (Python):
from math import floor

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

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

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

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

Solution (Python):
import math
A,B,N = map(int,input().split())
max = 0
m = []
def f(x):
  return math.floor(A*x/B) - A*math.floor(x/B)

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

Solution (Python):

import sys
import math
from bisect import bisect_left




def solve(A: int, B: int, N: int):
    def func(x):
        return math.floor(A/B * (x%B))

    leftmost = 1
    rightmost = min(N,B)
    midpoint = rightmost // 2
    
    midpoint = min(N,B-1)
    ans = math.floor(A*midpoint/B) - A*math.floor(midpoint/B)
    print(ans)

    
    
    
    
    
    

    
    
    
    
    
    

    
    return



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):
a, b, n = [int(i) for i in input().split()]
m = b - 1 if n >= b else n

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

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

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

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

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

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

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

    if temp_curr <= temp_prev:
        break

print(max(temp_curr, temp_prev))

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

def main():
    A, B, N = map(int, input().split())
    ans = -1
    for x in range(min(B-1, N), max(min(B-1, N)-N, -1), min(-B+1, -1)):
        ans = max(ans, f(x, A, B))
    print(ans)

if __name__ == '__main__':
    main()

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

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

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

if b == 1:
    r = [0]
else:
    i = 0
    r = [int((a*n)/b)-a*int(n/b)]
    while b*i-1 <= n:
        r.append(int((a*(b*i-1))/b)-a*int((b*i-1)/b))
        i += 1
print(max(r))

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

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

Solution (Python):
A, B, N = list(map(int,input().split()))
MAX = float('inf')*(-1)
a = int(A/B)
b = B
if N < B:
    MAX = (A * N // B) - A * (N // B)
else:
    MAX = (A * (B-1) // B) - A * ((B-1) // B)
print(MAX)

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

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

Solution (Python):
import math
A,B,N = map(int,input().split())
max = 0
m = []
def f(x):
  return math.floor(A*x/B) - A*math.floor(x/B)

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

Solution (Python):
import math

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

b=0

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

c=math.floor(A*b/B)-A*math.floor(b/B)
print(c)

Solution (Python):
import math

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

c = 0
ans = 0
for i in range(1,10**7) :
    x = b*i-1
    if x > n :
        x = n
        c = 1
    ans = max(ans,math.floor((a*x)/b)-a*math.floor(x/b))
    if c == 1 :
        break

print(ans)

Solution (Python):
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

A, B, N = MAP()

left, right = 0, N

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




























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

print(ans)

Solution (Python):

"""
Created on Sat May  2 22:26:54 2020

@author: Kanaru Sato
"""

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

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

if a == 1:
    print(0)
elif n < b:
    floorspecial(n)
else:
    p = (n//b)*b
    p = p-1
    floorspecial(p)

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

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

def floor(t):
  return int(t)

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
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 = N

ans1 = (A * (B-1)//B) - A * ((B-1) // B)
ans2 = ((A * N)//B) - A * (N // B)



if N < B:
    print(ans2)
else:
    
    print(ans1)



exit()

memo = [0] * (B+1)
ma = 0
for x in range(1, B+1):
    memo[x] = int((A * (x)/B)) - A * ((x)  // B)
    ma = max(memo[x], ma)

print(memo)



if N >= B:
    ans = ma
else:
    ans = memo[N]
print(ans)

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

def floor(m):
    return int(m)

if n>=b:
    x=b-1
    c= floor(a*x/b) - a*floor(x/b)
else:
    x=n
    c= floor(a*x/b) - a*floor(x/b)

print(c)

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

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

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

ans = 0
i = 1
while True:
    i += max(1, (B-1)//A+1)
    if i > N:
        break
    tmp = ((A*i)//B) - (A*(i//B))
    if tmp > ans:
        ans = tmp
    else:
        break
        
print(ans)

Solution (Python):
import math

A, B, N = map(int, input().split())
max = 0
temp = 0
bk_temp = 0

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

print(max)

Solution (Python):

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

score = 0

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

Solution (Python):
import math

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

c = 0
ans = -1
for i in range(1,10**7) :
    x = b*i-1
    if x > n :
        x = n
        c = 1
    if ans > math.floor((a*x)/b)-a*math.floor(x/b) :
        break
    ans = math.floor((a*x)/b)-a*math.floor(x/b)
    if c == 1 :
        break

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

import sys


def solve(A: int, B: int, N: int):
    def f(x):
        return A * x // B - A * (x // B)
    if B - 1 <= N:
        print(f(B - 1))
    else:
        print(f(N))
    return



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):
a, b, n = map(int, input().split())

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

Solution (Python):
import sys,os
from collections import defaultdict, deque
from math import ceil, floor
if sys.version_info[1] >= 5:
    from math import gcd
else:
    from fractions import gcd
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    MOD = 10**9+7

    A,B,N = LMIIS()

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

    
    
    
    
    

if __name__ == '__main__':
    main()

Solution (Python):
from math import floor

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

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

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]

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

def main():
    A,B,N = MI()
    """
    max = 0
    m = 0
    for x in range(0, N+1):
        ai = a(A,B,x)
        if max < ai :
            max = ai
        elif ai<0 and m == 0:
            max = ai
            m +=1

        print(x,a(A,B,x))
    """
    if N >= B:
        x = (N//B)*B-1
    elif N == B:
        x = N-1
    elif N < B:
        x = N
    print(a(A,B,x))

    



    


if __name__ == "__main__":
	main()

Solution (Python):
from math import floor

line = [int(ch) for ch in input().split()]
a = line[0]; b = line[1]; n = line[2]
if b <= n:
    x = b-1
else:
    x = n
res = floor(a*x/b) - a*floor(x/b)
print(res)

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

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

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

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

if N < B:
    print((A*N)//B)
elif N == B:
    NN = N-1
    print((A*NN)//B)
else:
    
    wN = N % B
    wwN = B * wN -1
    sahen1 = (A*wwN)//B
    uhen1 = A * (wwN//B)
    kouho1 = sahen1 - uhen1

    sahen2 = (A*N)//B
    uhen2 = A * (N//B)
    kouho2 = sahen2 - uhen2
    print(max(kouho1,kouho2))

Solution (Python):

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

Solution (Python):
def mapint_inp():
    return map(int, input().split())

def intinp():
    return int(input())

A, B, N = mapint_inp()

from math import floor

S_1 = (A*N)//B
S_2 = A*(N//B)
if N < B:
    print(S_1-S_2)
else:
    print(((A*(B-1))//B))

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

Solution (Python):
import math

a,b,n=map(int, 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

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

if n >= b:
    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=B-1
def f(t):
    return int(t//1)
if N>=B:
    M=f(A*x/B)-A*f(x/B)
    print (M)
else:
    N=f(A*N/B)-A*f(N/B)
    print (N)

Solution (Python):
import sys
import math
import bisect







INF = sys.maxsize
MOD = 10 ** 9 + 7



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

left = 1
right = n

ans = 0
num = 0
while abs(left - right) > 10 ** (-2):
    tmp_left = left + (right - left) / 3
    tmp_right = left + 2 * (right - left) / 3

    c_left = math.floor(a * left / b) - a * math.floor(left / b)
    c_right = math.floor(a * right / b) - a * math.floor(right / b)

    f_left = math.floor(a * tmp_left / b) - a * math.floor(tmp_left / b)
    f_right = math.floor(a * tmp_right / b) - a * math.floor(tmp_right / b)

    if c_left <= f_left <= f_right:
        left = tmp_left
        if ans < f_left:
            ans = f_left
            num = tmp_left

    elif f_left >= f_right >= c_right:
        right = tmp_right
        if ans < f_right:
            ans = f_right
            num = tmp_right
    else:
        if c_left > c_right:
            right = tmp_right
            if ans < f_right:
                ans = f_right
                num = tmp_right
        else:
            left = tmp_left
            if ans < f_left:
                ans = f_left
                num = tmp_left

ans1 = math.floor(a * int(num) / b) - a * math.floor(int(num) / b)
ans2 = math.floor(a * int(num + 1) / b) - a * math.floor(int(num + 1) / b)

print(int(max(ans1, ans2)))

Solution (Python):

import math

in_a = list(map(int, input().split()))
A = in_a[0]
B = in_a[1]
N = in_a[2]

ans = 0

if ( B>N ):
  X = N
  ans = math.floor(A*X/B) - ( A * math.floor(X/B) )
  
else:
  X = B - 1
  ans = math.floor(A*X/B) - ( A * math.floor(X/B) )

print(ans)

Solution (Python):
import math

params0 = list(map(lambda x: int(x), input().split(' ')))
paramA = params0[0]
paramB = params0[1]
paramN = params0[2]

a = 0
if paramN > paramB - 1:
    a = paramB - 1
else:
    a = paramN

print(math.floor(paramA * a / paramB) - (paramA * math.floor(a / paramB)))

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

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

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

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

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

x = 0

if N >= 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 b>n:
    print(math.floor(a*n/b))
else:
    x = b-1
    print(math.floor(a*x/b))