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



Sample input:
5 7 4


Sample output:
2

Submission status: Wrong Answer

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


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


if b < n:
    print(calc(b))
else:
    print(calc(n))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#D
A,B,N = map(int,input().split())
ans = 0
#print("A =",A,"B =",B,"N =",N)
for x in range(abs(B-A),B+A):
    if x > N:
        break
    left = (A*x)//B
    right = A*(x//B)
    #print("x =",x,left,right)
    ans = max(ans,left-right)
print(ans)

Submission status: Wrong Answer

Solution code:
#D
A,B,N = map(int,input().split())
ans = 0
print("A =",A,"B =",B,"N =",N)
for x in range(abs(B-A),B+A):
    if x > N:
        break
    left = (A*x)//B
    right = A*(x//B)
    #print("x =",x,left,right)
    ans = max(ans,left-right)
print(ans)

Submission status: Wrong Answer

Solution code:
#D
A,B,N = map(int,input().split())
ans = 0
for x in range(1,min(10**6+1,N+1)):
    left = A*x//B
    right = A*(x//B)
    #print("x =",x,left,right)
    ans = max(ans,left-right)
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,n=[int(x) for x in input().split()]
print(min(b-1,n))

Submission status: Wrong Answer

Solution code:
import math
a,b,n=[int(x) for x in input().split()]
x=min(b-1,n-1)
max=-10**9
for i in range(a,x+1):
  f=(a*x)//b-(a*(x//b))
  if f>max:
    max=f
print(max)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if n <= b - 1:
    x = n
else:
    x = b - (n%b + 1)

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

Submission status: Wrong Answer

Solution code:
A,B,N = map(int,input().split())
max_num = 0
num = 0
for i in range(1,N+1):
  if (A*i//B) - A*(i//B) > max_num:
    max_num = (A*i//B) - A*(i//B)
    num = i
    
print(i)

Submission status: Wrong Answer

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

ans1=math.floor(a*n/b)-a*math.floor(n/b)
ans2=math.floor(a*(b-1)/b)
if n<=(b-1):
  print(ans1)
else:
  print(max(ans1,ans2))

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

ans1=math.floor(a*n/b)-a*math.floor(n/b)
ans2=math.floor(a*(b-1)/b)
if n<(b-1):
  print(ans1)
else:
  print(max(ans1,ans2))

Submission status: Wrong Answer

Solution code:
import numpy as np


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

    ans = int(np.floor(a*n/b)) - int(a*np.floor(n/b))
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,n=map(int,input().split())
r=min(n,b)
print((a*r)//b)

Submission status: Wrong Answer

Solution code:
a, b, n = map(int, input().split())
x = max(n, (n//b)*b - 1)

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

Submission status: Wrong Answer

Solution code:
import math
A,B,N = map(int,input().split())
siki = 0
k = math.floor(N/B)
m = k*B
if (B-1) <= N:
    siki = math.floor((A*(B-1))/B)-A*math.floor((B-1)/B)
elif B>N:
    siki = math.floor((A*N)/B)-A*math.floor((N/B))

Submission status: Wrong Answer

Solution code:
import math
A,B,N = map(int,input().split())
siki = 0
if (B-1) <= N:
    siki = math.floor((A*(B-1))/B)-A*math.floor((B-1)/B)
else:
    for i in range(N):
        temp = math.floor((A*i)/B)-A*math.floor(i/B)
        if temp > siki:
            siki = temp
print(siki)

Submission status: Wrong Answer

Solution code:
import sys
sys.stdin.readline

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

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

print(A * N //B)

Submission status: Wrong Answer

Solution code:
_, b, n = map(int, input().split())

print(min(b - 1, n))

Submission status: Wrong Answer

Solution code:
A ,B ,N = map(int, input().split())
max_val = 0
i = 1

x = N
if B < N :
    x = int(N / B) * B - 1

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

print(val)

Submission status: Wrong Answer

Solution code:
import math
import random
A, B, N = map(int, input().split())
def floor(x):
  return math.floor(x)

max = floor( A* random.randrange(N) / B) - A * floor(random.randrange(N) / B)
print(max)

Submission status: Wrong Answer

Solution code:
A ,B ,N = map(int, input().split())
max_val = 0
i = 1

lim = N
if B < N :
    lim = B - 1

val = int(A*lim/B)

print(val)

Submission status: Wrong Answer

Solution code:
A ,B ,N = map(int, input().split())
max_val = 0
i = 1

# lim = N - 1
# if B < N :
#     lim = B - 1

for i in range(N+1):
    val = int(A*i/B)
    # print(i)
    if max_val < val:
        max_val = val
    i += 1
    # print(val)

print(max_val)

Submission status: Wrong Answer

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

def floor(t):
    return int(t)

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

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
a,b,n=map(Decimal,input().split())
if n<b:
  x=n
else:
  x=n%b
  if x==0:
    x=b-1
import math
print(math.floor(a*x/b)-a*math.floor(x/b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
A,B,N = map(int, input().split())
c = 0
if B > N:
	c = (math.floor(A * N / B))-(A * (math.floor(N / B)))
elif B < N:
	c = (math.floor(A * (B-1) / B))-(A * (math.floor((B - 1) / B)))
print(c)

Submission status: Wrong Answer

Solution code:
def floor(a):
    return int(a)

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

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

    print(max_amount)

Submission status: Wrong Answer

Solution code:
def floor(a):
    return int(a)

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

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

    print(max_amount)

Submission status: Wrong Answer

Solution code:
def floor(a):
    return int(a)

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

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

    print(max_amount)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve(string):
    a, b, n = map(int, string.split())
    return str(a * (b - 1) // b) if b < n else str(a * n // b)


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Submission status: Wrong Answer

Solution code:
A, B, N = [ int(i) for i in input().strip().split(' ')]
max_floor = 0
if B >= N:
    max_floor = int(A * N / B) - A * int(N/B)
    print(max_floor)
else:
    floor = int(A * (B-1) / B) - A * int((B-1)/B)
    if max_floor < floor:
        max_floor = floor
    print(max_floor)

Submission status: Wrong Answer

Solution code:
A, B, N = [ int(i) for i in input().strip().split(' ')]
max_floor = 0
if B >= N:
    max_floor = int(A * N / B) - A * int(N/B)
    print(max_floor)
else:
    for x in range(B, N, B):
        floor = int(A * x / B) - A * int(x/B)
        if max_floor < floor:
            max_floor = floor
    print(max_floor)

Submission status: Wrong Answer

Solution code:
import math


def main():
    a, b, n = map(int, input().split())
    if b == 1:
        print(0)
        return
    while True:
        if n % b == 0:
            n -= 1
        else:
            print(math.floor(a*n/b) - a*math.floor(n/b))
            return
    return


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math


def main():
    a, b, n = map(int, input().split())
    while True:
        if n % b == 0:
            n -= 1
        else:
            print(math.floor(a*n/b) - a*math.floor(n/b))
            return
    return


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

def floor(t):
  return math.floor(t)

x = b - 1

max = floor(a * x / b) - a * floor(x / b)
print(max)

Submission status: Wrong Answer

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

def floor(t):
  return math.floor(t)

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

Submission status: Wrong Answer

Solution code:
A, B, N = map(int, input().split())
ans = 0
for x in range(N-B, N+1):
    ans  = max(ans, (A*x)//B-A*(x//B))
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
 
a, b, n = map(int, input().split())
 
ans = -1
 
search_list = [i for i in range(b-100, b+100) if i >= 0 and i <=n]
 
for x in search_list:
    res = math.floor(a*x/b) - a*math.floor(x/b)
    ans = max(ans, res)
 
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

ans = -1

search_list = [i for i in range(b-100000, b+100000) if i >= 1 and i <=n]

for x in search_list:
    res = math.floor(a*x/b) - a*math.floor(x/b)
    ans = max(ans, res)

print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

ans = -1

search_list = [i for i in range(b-10000, b+10000) if i >= 1 and i <=n]

for x in search_list:
    res = math.floor(a*x/b) - a*math.floor(x/b)
    ans = max(ans, res)

print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

ans = -1

search_list = [i for i in range(b-100, b+100) if i >= 1 and i <=n]

for x in search_list:
    res = math.floor(a*x/b) - a*math.floor(x/b)
    ans = max(ans, res)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

from math import floor
ans = -1
for x in range(N+1):
    r = floor(A*x/B) - A * floor(x/B)
    # print(ans, r)
    if r >= ans:
        ans = r
    else:
        break

print(r)

Submission status: Wrong Answer

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

def f(x):
    return int(a*x/b)-a*int(x/b)
    
ma=max(f(int(n/b)*n-1),f(n))
print(ma)

Submission status: Wrong Answer

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

def f(x):
    return int(a*x/b)-a*int(x/b)
    
ma=max(f(int(n/b-1)),f(n))
print(ma)

Submission status: Wrong Answer

Solution code:
A,B,N = map(int,input().split())
ans = max((A*N)//B-A*(N//B),(A*(B-1))//B)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B,N = map(int,input().split())
xi = (N//B)*B
ans = max((A*N)//B-A*(N//B),(A*(B-1))//B-A*(B-1))
print(ans)

Submission status: Wrong Answer

Solution code:
A,B,N = map(int,input().split())
xi = (N//B)*B
ans = max(0,(A*xi)//B-A*(xi//B),A*N//B-A*(N//B))
print(ans)

Submission status: Wrong Answer

Solution code:
A,B,N = map(int,input().split())
xi = (N//B)*B
ans = max((A*xi)//B-A*(xi//B),A*N//B-A*(N//B))
print(ans)

Submission status: Wrong Answer

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


print(max(calc(a, b, n), calc(a, b, b-1)))

Submission status: Wrong Answer

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


print(max(calc(a, b, n), calc(a, b, n-1)))

Submission status: Wrong Answer

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

mm = max(0,(b * (n//b)) - 1)
print(max(calc(a,b,n), calc(a,b,mm)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
A,B,N=map(int,input().split())
print(math.floor(A*(N%B)/B))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1  # 入力した数字に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()))

# 2次元リスト化
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)

# max = 0
# for x in range(min(B + 1, N + 1)):
#     if x > N:
#         break
#     fx = f(x)
#     # print(fx)
#     if fx > max:
#         max = fx
print(f(min(B, N)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,n=map(int,input().split())
l=[]
for i in range(1,n+1):
    m=a*i//b
    l.append(m)
print(max(l))

Submission status: Wrong Answer

Solution code:
a,b,n=map(int,input().split())
l=[]
for i in range(1,n+1):
    m=a*i//b-5*(i//b)
    l.append(m)
print(max(l))

Submission status: Wrong Answer

Solution code:
"""
~~ 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())
    ans = []
    if n == 1:
        print(0)
    else:
        for i in range(1, n + 1):
            ans.append(((a * i) // b) - a * (i // b))
            if len(ans) > 1:
                if ans[-1] == 0:
                    break
        if ans[-1] != 0:
            print(ans[-1])
        else:
            print(ans[-2])


def main():
    Try()


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B,N = map(int,input().split())
x = B-1
a = 0
while x >= (B-1)*9/10:
  if a < A*x//B - A*(x//B):
    a = A*x//B - A*(x//B)
    x -= 1
  else:
    x -= 1
print(a)

Submission status: Wrong Answer

Solution code:
A,B,N = map(int,input().split())
x = 0
a = 0
while x <= B-1:
  if a < A*x//B - A*(x//B):
    a = A*x//B - A*(x//B)
    x += 1
  else:
    x += 1
print(a)

Submission status: Wrong Answer

Solution code:
A,B,N = map(int,input().split())
x = N
a = 0
while x>99999*N//100000:
  if x%B != 0 and a < A*x//B - A*(x//B):
    a = A*x//B - A*(x//B)
    x -= 1
  else:
    x -= 1
print(a)

Submission status: Wrong Answer

Solution code:
A,B,N = map(int,input().split())
x = N
a = 0
while x>999999*N//1000000:
  if x%B != 0 and a < A*x//B - A*(x//B):
    a = A*x//B - A*(x//B)
    x -= 1
  else:
    x -= 1
print(a)

Submission status: Wrong Answer

Solution code:
a,b,n=map(int,input().split())
ans=0
for x in range(1,1000000):
  f=(a*x)//b-a*(x//b)
  ans = max(f,ans)
print(ans)

Submission status: Wrong Answer

Solution code:
A,B,N = map(int,input().split())
x = N
while x>0:
  if x%B != 0:
    print(A*x//B - A*(x//B))
    break
  else:
    x -= 1

Submission status: Wrong Answer

Solution code:
import sys
import math
sys.setrecursionlimit(10**6)


def main(input, print):
    a, b, n = map(int, 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)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3


def main() -> None:
    A, B, N = rmi()
    X = N if N % B != 0 else N - 1
    max_score = 0
    for x in range(X, max(X - 100, 0), -1):
        score = (A * x) // B - A * (x // B)
        max_score = max(max_score, score)
    w(max_score)


def r() -> str:
    return input().strip()


def ri() -> int:
    return int(r())


def rmi(delim: str = ' ') -> tuple:
    return tuple(map(int, input().split(delim)))


def w(data) -> None:
    print(data)


def wm(*data, delim: str = ' ') -> None:
    print(delim.join(map(str, data)))


if __name__ == '__main__':
    import sys
    sys.setrecursionlimit(10**9)
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3


def main() -> None:
    A, B, N = rmi()
    x = N if N % B != 0 else N - 1
    score = (A * x) // B - A * (x // B)
    w(score)


def r() -> str:
    return input().strip()


def ri() -> int:
    return int(r())


def rmi(delim: str = ' ') -> tuple:
    return tuple(map(int, input().split(delim)))


def w(data) -> None:
    print(data)


def wm(*data, delim: str = ' ') -> None:
    print(delim.join(map(str, data)))


if __name__ == '__main__':
    import sys
    sys.setrecursionlimit(10**9)
    main()

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

left, right = 0, n
# 答えが整数になる場合このrightとleftの幅を3未満にするとバグる
while abs(right - left) > 3:
    mid1 = (right * 2 + left) // 3 + 1
    mid2 = (right + left * 2) // 3
    if f(mid1) <= f(mid2):
        # 上限を下げる（最小値をとるxはもうちょい下めの数だな）
        right = mid1
    else:
        # 下限を上げる（最小値をとるxはもうちょい上めの数だな）
        left = mid2
ans = 0
for i in range(left, right + 1):
    ans = max(ans, f(i))
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,n = map(int,input().split(" "))
if n < b:
    print((a * n) // b)
else:
    print(0)

Submission status: Wrong Answer

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

ans = 0

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

print(ans)

Submission status: Wrong Answer

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

ans = 0

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
import numpy as np
c1,c2,c3 = (int(x) for x in input().split())
c5 =int(0) 
for i in range(c3-100,c3 + 1):
    c4 = math.floor(c1*i/c2) - c1*math.floor(i/c2)
    if c5 <=c4:
        c5 = c4
print(c5)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np
c1,c2,c3 = (int(x) for x in input().split())
c5 =int(0) 
for i in range(c3-10,c3 + 1):
    c4 = math.floor(c1*i/c2) - c1*math.floor(i/c2)
    if c5 <=c4:
        c5 = c4
print(c5)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np
c1,c2,c3 = (int(x) for x in input().split())
c5 =int(0) 
for i in range(1,c3):
    c4 = math.floor(c1*i/c2) - c1*math.floor(i/c2)
    
    if c5 <c4:
        c5 = c4

    
print(c5)

Submission status: Wrong Answer

Solution code:
from math import floor
A,B,N = map(int,input().split())
ab = A/B
befNom = 0
while all:
    Nomin = floor(ab*N)
    if(Nomin < befNom):
        break
    befNom = Nomin
    N-=1

print(befNom)

Submission status: Wrong Answer

Solution code:
from math import floor
A,B,N = map(int,input().split())
ab = A/B
befNom = 0
while all:
    Nomin = floor(ab*N)
    if(Nomin >= befNom):
        break
    befNom = Nomin
    N-=1

print(Nomin)

Submission status: Wrong Answer

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

Nomin = floor(A*N/B)
print(Nomin)

Submission status: Wrong Answer

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

while all:
    Nomin.append(floor(A*N/B))
    N-=1
    if(N==0):
        break
print(Nomin[0])

Submission status: Wrong Answer

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

ans = 0
eps = 0.000000001
d1 = (a * i) / b
d1 = int(d1+eps)
d2 = (i / b)
d2 = int(d2+eps)
ansi = int(d1 - (a * d2))
ans = max(ans, ansi) 
print(ans)

Submission status: Wrong Answer

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

ans = 0
eps = 0.000000001
if(a * i < b):
    d1 = 0
else:
    d1 = (a * i) / b
    d1 = int(d1+eps)
    d2 = (i / b)
    d2 = int(d2+eps)
ansi = int(d1 - (a * d2))
ans = max(ans, ansi) 
print(ans)

Submission status: Wrong Answer

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

ans = 0
eps = 0.000000001
if(a * i < b):
    d1 = 0
else:
    d1 = (a * i) / b
    if(d1 < eps):
        d1 = 0
    else:
        d1 = int(d1+eps)
if(i < b):
    d2 = 0
else:
    d2 = (i // b)
    if(d2 < eps):
        d2 = 0
    else:
        d2 = int(d2+eps)
ansi = int(d1 - (a * d2))
ans = max(ans, ansi) 
print(ans)

Submission status: Wrong Answer

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

ans = 0
eps = 0.000000001
if(a * i < b):
    d1 = 0
else:
    d1 = (a * i) / b
    if(d1 < eps):
        d1 = 0
    else:
        d1 = int(d1)
if(i < b):
    d2 = 0
else:
    d2 = (i // b)
    if(d2 < eps):
        d2 = 0
    else:
        d2 = int(d2)
ansi = int(d1 - (a * d2))
ans = max(ans, ansi) 
print(ans)

Submission status: Wrong Answer

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

ans = 0
if(a * i < b):
    d1 = 0
else:
    d1 = (a * i) // b
if(i < b):
    d2 = 0
else:
    d2 = (i // b)
ansi = d1 - (a * d2)
ans = max(ans, ansi) 
print(ans)

Submission status: Wrong Answer

Solution code:
import math
A,B,N = map(int,input().split())
point = 0
ans = 0
#for x in range(0,N+1):
x=N
#print(math.floor(A*x/B)-A*math.floor(x/B))
    #print(point)
    #print("p")
#    if point<math.floor(A*x/B)-A*math.floor(x/B):
point = math.floor(A*x/B)-A*math.floor(x/B)
print(point)

Submission status: Wrong Answer

Solution code:
import math
A,B,N = map(int,input().split())
point = 0
ans = 0
for x in range(0,N):
    #print(math.floor(A*x/B)-A*math.floor(x/B))
    #print(point)
    #print("p")
    if point<math.floor(A*x/B)-A*math.floor(x/B):
        point = math.floor(A*x/B)-A*math.floor(x/B)
print(point)

Submission status: Wrong Answer

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

ans = -1
for i in range(n, n-10000, -1):
    if(i < 0):
        break
    d1 = (a * i) // b
    d2 = (i // b)
    ansi = d1 - (a * d2)
    ans = max(ans, ansi) 
print(ans)

Submission status: Wrong Answer

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

d1 = (a * n) // b
d2 = (n // b)
ans = d1 - (a * d2)
print(ans)

Submission status: Wrong Answer

Solution code:
import math
A,B,N = map(int,input().split())
point = 0
ans = 0
for x in range(0,N):
    #print(math.floor(A*x/B)-A*math.floor(x/B))
    #print(point)
    #print("p")
    if point<math.floor(A*x/B)-A*math.floor(x/B):
        point = A*math.floor(x/B)-A*math.floor(x/B)
        ans = x
print(ans)

Submission status: Wrong Answer

Solution code:
import math
A,B,N = map(int,input().split())
point = 0
ans = 0
for x in range(0,N):
    #print(math.floor(A*x/B)-A*math.floor(x/B))
    #print(point)
    #print("p")
    if point<math.floor(A*x/B)-A*math.floor(x/B):
        print("a")
        point = A*math.floor(x/B)-A*math.floor(x/B)
        ans = x
print(ans)

Submission status: Wrong Answer

Solution code:
n = input().split()
n = [int(i) for i in n]
 
l = []
for i in range(n[2]):
  x = i+1
  a = n[0]*x
  b = x // n[1]
  a = a//n[1]
  b = b*5
  c = a-b
  l.append(c)

d = max(l)
ans = l.index(d)+1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input().split()
n = [int(i) for i in n]

l = []
for i in range(n[2]):
  x = i+1
  a = n[0]*x
  b = x // n[1]
  a = a//n[1]
  b = b*5
  c = a-b
  l.append(c)

print(max(l))

Submission status: Wrong Answer

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

print(min(b-1, n))

Submission status: Wrong Answer

Solution code:
import math

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

max = 0
for i in range(B):
    value = math.floor(A*i/B) - A*math.floor(i/B)
    if value > max:
        max=value
print(max)

Submission status: Wrong Answer

Solution code:
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()
print( a*(b-1)//b )

Submission status: Wrong Answer

Solution code:
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()
c=0
d=0
for i in range(n+1):
	if c < int(a*i/b):
		c=int(a*i/b)
	if d > int(i/b):
		d=int(i/b)
print(c-a*d)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

d = []
for i in range(0,nums[1]):
    d0 = []
    a = math.floor(nums[0]*i/nums[1]) - nums[0] * math.floor(i/nums[1])
    d0.append(a)
    d.append(max(d0))

print(max(d))

Submission status: Wrong Answer

Solution code:
import math

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

d = []
for i in range(0,nums[1]+1):
    d0 = []
    a = math.floor(nums[0]*i/nums[1]) - nums[0] * math.floor(i/nums[1])
    d0.append(a)
    d.append(max(d0))

print(max(d))

Submission status: Wrong Answer

Solution code:
import math
A, B, N = map(int, input().split())
max = -1
max_x = -1
for x in range(N):
    diff = math.floor(A * x / B) - A * math.floor(x / B)
    if diff > max:
        max_x = x
        max = diff

print(max_x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
a,b,n = map(int,input().split())
c = max(0,n // b * b - 1)
ans = max(math.floor(a * c / b) - a * math.floor(c / b), math.floor(a * n / b) - a * math.floor(n / b))

print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

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