ZhenlongDai/ACPR huggingface dataset:
Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
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
    for i in range(max(1,N-10**7),N+1):
        ans = max(floor(A*i/B)-A*floor(i/B),ans)
    print(ans)


    

if __name__ == '__main__':
    main()

Failing test case input:
-2 2 1

Expected output:
-1


Actual output:
0


Fixed submission (verdict: Accepted):
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()

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A,B,N = map(int, input().split())

def f(a, b, n):
    fl1 = (a * (n + 1)) 
    fl2 = (n + 1) 
    fl = fl1 - a * fl2
    return fl
   

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

Failing test case input:
9 6 5

Expected output:
7


Actual output:
0


Fixed submission (verdict: Accepted):
A,B,N = map(int, input().split())

def f(a, b, n):
   
    
    
    
   return int(a * n / b) - a * int(n / b)

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

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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*(b+1)/b)-a*math.floor((b+1)/b))

Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
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))
Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
import math
import fractions
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(10**7)

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

m = -1

for x in range(1, N+1):
    res = math.floor(A * x / B) - A * math.floor(x / B)
    print(res)
    if res >= m:
        m = res
    elif res == 0:
        break
    else:
        break

print(m)


Failing test case input:
11 10 1

Expected output:
1


Actual output:
1
1


Fixed submission (verdict: Accepted):
import sys
import math
import fractions
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(10**7)

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







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

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, B, N = map(int, input().split())

x = B - 1
ans = (A*x)

print(ans)

Failing test case input:
1 260 4

Expected output:
0


Actual output:
259


Fixed submission (verdict: Accepted):
A, B, N = map(int, input().split())
if N >= B:
    x = B - 1
else:
    x = N
print( (A*x

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b, n = map(int, input().split())
ans = max(int((a*n)/b) - a*int(n/b), int((a*b-1)/b) - a*int(b-1/b))
print(ans)


Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
a, b, n = map(int, input().split())
x = min(b-1, n)
ans = int((a*x)/b) - a*int(x/b)
print(ans)

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import math
a,b,n=map(int,input().split())
ans=0
for i in range(n):
  c=math.floor(a*i/b)-a*math.floor(i/b)
  ans=max(ans,c)
print(ans)

Failing test case input:
56 12 1

Expected output:
4


Actual output:
0


Fixed submission (verdict: Accepted):
import math
a,b,n=map(int,input().split())
ans=0
if b>n:
  ans=math.floor(a*n/b)
else:
  
  ans=math.floor(a*(b-1)/b)
print(ans)

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
a,b,n=map(int,input().split())
max=-2
lim=min(n,b)
for i in range(1,lim+1):
    s=math.floor(a*i/b)
    if s>max:
        max=s
print(int(max))


Failing test case input:
14 7 8

Expected output:
12


Actual output:
14


Fixed submission (verdict: Accepted):
import math
a,b,n=map(int,input().split())
max=-2
if n<b:
    max=math.floor(a*n/b)
else:
    
    max=math.floor(a*(b-1)/b)
    

print(max)
Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
A,B,N = map(int, input().split())

def calc(x):
    y = math.floor(A * x / B) - A * math.floor(x / B)
    return y

max_v = 0

if N < B:
    max_v = calc(N)
else:
    max_v = calc(B)





print(max_v)


Failing test case input:
14 7 8

Expected output:
12


Actual output:
0


Fixed submission (verdict: Accepted):
import math
A,B,N = map(int, input().split())

def calc(x):
    y = math.floor(A * x / B) - A * math.floor(x / B)
    return y

max_v = 0

if N < B:
    max_v = calc(N)
else:
    max_v = calc(B-1)





print(max_v)

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,n = map(int,input().split())
l = (a*n)
n = b-1
m = (a*n)
print(max(l,m))
	

Failing test case input:
1 15 1

Expected output:
0


Actual output:
14


Fixed submission (verdict: Accepted):
a,b,n = map(int,input().split())
if n >= b:
	n = b-1
	print((a*n)
else:
	print((a*n)

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import math
import sys
input = sys.stdin.readline

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

print(min(B-1, N))


Failing test case input:
0 486 4

Expected output:
0


Actual output:
4


Fixed submission (verdict: Accepted):
import math
import sys
input = sys.stdin.readline

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

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A,B,N=map(int,input().split())

if B<N:
	C=B
else:
	C=N

x=int(A*C/B)
y=int(C/B)
z=x-A*y

print(z)

Failing test case input:
14 7 8

Expected output:
12


Actual output:
0


Fixed submission (verdict: Accepted):
A,B,N=map(int,input().split())
if B==N:
	C=B-1
elif B<N:
	C=B-1
else:
	C=N
x=int(A*C/B)
y=int(C/B)
z=x-A*y
print(z)

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, B, N = map(int, input().split())
if B == 1:
    result = 0
elif N >= B-1:
    result = B-1
else:
    result = int(A*N/B) - A*int(N/B)
    
print(result)

Failing test case input:
9 6 5

Expected output:
7


Actual output:
5


Fixed submission (verdict: Accepted):
A, B, N = map(int, input().split())
if B == 1:
    result = 0
elif N >= B - 1:
    result = int(A*(B-1)/B) - A*int((B-1)/B)
else:
    result = int(A*N/B) - A*int(N/B)
    
print(result)

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import math
a, b, n = map(int, input().split())

n = min(n, b)


mem = {}
m = 0


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


Failing test case input:
14 7 8

Expected output:
12


Actual output:
0


Fixed submission (verdict: Accepted):
import math
a, b, n = map(int, input().split())

n = min(n, b-1)

print(math.floor(a * n / b) - a * math.floor(n / b))
Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math                                                       
A, B, N = map(int, input().split())



maxR = -1
maxX = 0





R = math.floor(A*N/B) - A * math.floor(N/B)
print (R)


Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
import math                                                       
A, B, N = map(int, input().split())


T = N
maxR = -1
maxT = 0

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

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,n=map(int,input().split())
score=0
if (n<b):
    print( int(a*n/b))


else:
    c = int(n/b)
    score = 0
    for i in range(1,c+1):
        n_ = b*i-1
        t = int(a*i/b)-a*int(i/b)
        score = max(score,t)
    t = t = int(a*n/b)-a*int(n/b)
    score = max(score,t)
    print(score)

Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
a,b,n=map(int,input().split())
score=0
if (n<b):
    print( int(a*n/b))
elif(b==1):
    print(0)
else:
    c = int(n/b)
    score = 0
    for i in range(1,c+1):
        n_ = b*i-1
        t = int(a*n_/b)-a*int(n_/b)
        score = max(score,t)
    t = int(a*n/b)-a*int(n/b)
    score = max(score,t)
    print(score)

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)
    
    if r >= ans:
        ans = r
    else:
        break

print(r)

Failing test case input:
14 7 8

Expected output:
12


Actual output:
0


Fixed submission (verdict: Accepted):
A, B, N = list(map(int, input().split()))

from math import floor








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

print(ans)

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
import math
import fractions
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(10**7)

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

m = 0
for x in range(1, min(A+1, N+1)):
    res = math.floor(A * x / B) - A * math.floor(x / B)
    m = max(res, m)

print(m)


Failing test case input:
-2 2 1

Expected output:
-1


Actual output:
0


Fixed submission (verdict: Accepted):
import sys
import math
import fractions
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(10**7)

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







if B > N:
    x = N
    res = math.floor(A * x / B) - A * math.floor(x / B)
    print(res)
else:
    x = B - 1
    res = math.floor(A * x / B) - A * math.floor(x / B)
    print(res)
Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
import math
import fractions
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(10**7)

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

m = -1







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


Failing test case input:
2 15 0

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
import sys
import math
import fractions
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(10**7)

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







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

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
import itertools

import time
import math

sys.setrecursionlimit(10 ** 7)

from collections import defaultdict

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

x = min(b, n)
if b == n:
    x = b - 1
if x == 0:
    print(a)
    exit()
ans = math.floor((a * x) / b) - a * math.floor(x / b)
print(ans)

Failing test case input:
11 10 0

Expected output:
0


Actual output:
11


Fixed submission (verdict: Accepted):
import sys
import itertools

import time
import math

sys.setrecursionlimit(10 ** 7)

from collections import defaultdict

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

x = min(b - 1, n)





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

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    A, B, N = list(map(int, input().split(' ')))
    N %= B
    print(int(A * N / B))


if __name__ == '__main__':
    main()

Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
def main():
    A, B, N = list(map(int, input().split(' ')))
    x = N if N < B else B - 1
    print(A * x 


if __name__ == '__main__':
    main()

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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))


Failing test case input:
14 7 8

Expected output:
12


Actual output:
0


Fixed submission (verdict: Accepted):
a, b, n = map(int, input().split())


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


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

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math

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

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

Failing test case input:
14 7 8

Expected output:
12


Actual output:
14


Fixed submission (verdict: Accepted):
import math

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

print(math.floor(a*x/b))
Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
Nlist = list(map(int, input().split()))

A = Nlist[0]; B = Nlist[1]; N = Nlist[2]

print(int(A*(N%B)/B))

Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
Nlist = list(map(int, input().split()))

A = Nlist[0]; B = Nlist[1]; N = Nlist[2]

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

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys

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

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

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

Failing test case input:
14 7 8

Expected output:
12


Actual output:
13


Fixed submission (verdict: Accepted):
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))

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math


def main():
    A, B, N = list(map(int, input().split(' ')))
    N %= B
    print(math.floor(A * N / B))


if __name__ == '__main__':
    main()

Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
def main():
    A, B, N = list(map(int, input().split(' ')))
    x = N if N < B else B - 1
    print(A * x 


if __name__ == '__main__':
    main()

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,n=map(int,input().split())

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

Failing test case input:
14 7 8

Expected output:
12


Actual output:
12.0


Fixed submission (verdict: Accepted):
a,b,n=map(int,input().split())
if n>=b:
    print(int((b-1)/b*a))
else:
    print(int(n/b*a))

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
arr = input().split(" ")
a, b, n = int(arr[0]), int(arr[1]), int(arr[2])
if b<=n:
  k = a
else:
  k = (a*((n-1)))
print(k)


Failing test case input:
1 260 4

Expected output:
0


Actual output:
3


Fixed submission (verdict: Accepted):
arr = input().split(" ")
a, b, n = int(arr[0]), int(arr[1]), int(arr[2])
if b<=n:
   k = int((a*(b-1))/b)
else:
   k = int((a*n)/b)
print(k)

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
A,B,N=map(int,input().split())
ans=0
if B!=1:
    while N%B==0:
        N = N-1
ans = math.floor(A*N/B)-A*math.floor(N/B)
print(ans) 

Failing test case input:
2 20 0

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
import math
A,B,N=map(float,input().split())
if N >= B:
    N = B-1
ans = math.floor(A*N/B) - A*math.floor(N/B)
print(int(ans))
Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
A, B, N = map(int, input().split())

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

x = N if N < B else B
print(f(A, B, x))

Failing test case input:
14 7 8

Expected output:
12


Actual output:
0


Fixed submission (verdict: Accepted):
import math
A, B, N = map(int, input().split())

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

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

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
A,B,N = list(map(int,input().split()))

print(min(N,B-1))

Failing test case input:
0 73 3

Expected output:
0


Actual output:
3


Fixed submission (verdict: Accepted):
A,B,N = list(map(int,input().split()))

s = min(N,B-1)

print((A*s)

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import math
A, B, N = map(int, input().split())

left = -1
right = N
def check(x):
    global A, B
    return math.floor(A * x / B) - A * math.floor(x / B)

if B == N:
    print(check(N - 1))
else:
    print(check(N))


Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
import math
A, B, N = map(int, input().split())

left = -1
right = N
def check(x):
    global A, B
    return math.floor(A * x / B) - A * math.floor(x / B)

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

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from math import floor, ceil

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



num = n-n%b

print(max(floor(a*n/b) - a*floor(n/b), floor(a*num/b) - a*floor(num/b)))




Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
from math import floor, ceil

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


num = min(b-1, n)

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

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,n=map(int,input().split())
if b==0:
  print(0)
else:
  print(int(a*(b-1)/b)-a*int((b-1)/b))

Failing test case input:
2 8 0

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
a,b,n=map(int,input().split())
if n>=b:
  print(int(a*(b-1)/b)-a*int((b-1)/b))
else:
  print(int(a*n/b)-a*int(n/b))

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import math
A, B, N = map(int, input().split())


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


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


Failing test case input:
14 7 8

Expected output:
12


Actual output:
13


Fixed submission (verdict: Accepted):
import math
A, B, N = map(int, input().split())


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


if B == 1 or A == 1:
    print(0)
else:
    print(f(B-1) if N >= B else f(N))
Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
a, b, n = map(int, input().split())

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

near_0 =  1/(10**13)
if n <= b:
    print(calc(n))
else:
    print(calc(b-near_0))

Failing test case input:
14 7 8

Expected output:
12


Actual output:
13


Fixed submission (verdict: Accepted):
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))

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
a,b,n = list(map(int,input().split()))
m=n-10
if m<0:m=0

ans_l=[(math.floor(a*x/b)-a*math.floor(x/b)) for x in range(m,n+1)]
print(max(ans_l))



Failing test case input:
-2 2 1

Expected output:
-1


Actual output:
0


Fixed submission (verdict: Accepted):
import math
a,b,n = list(map(int,input().split()))
if b-1>=n:
    x=n
else:x=b-1
print(math.floor(a*x/b)-a*math.floor(x/b))

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b, n = map(int, input().split())
def calc(x):
    return int(a*x/b)-a*int(x/b)
print(calc(min(b,n)))

Failing test case input:
14 7 8

Expected output:
12


Actual output:
0


Fixed submission (verdict: Accepted):
a, b, n = map(int, input().split())
def calc(x):
    return int(a*x/b)-a*int(x/b)
print(calc(min(b-1,n)))

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import math
A, B, N = list(map(int, input().split()))
ans = 0
if B+1 < N:
    C = B+1
else:
    C = N
for i in range(1, C+1):
    val = math.floor(A*i/B) - A*math.floor(i/B)
    print("i", i, "val", val)
    ans = max(ans, val)

print(ans)


Failing test case input:
1 44 1

Expected output:
0


Actual output:
i 1 val 0
0


Fixed submission (verdict: Accepted):
import math
A, B, N = list(map(int, input().split()))
ans = 0
if B+1 < N:
    C = B+1
else:
    C = N
if B
    D = 1
elif B
  	D = B
else:
    D = B
for i in range(1, C+1, D):
    val = math.floor(A*i/B) - A*math.floor(i/B)
    
    ans = max(ans, val)

print(ans)

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A,B,N = map(int,input().split())
def f(x):
  f = int(A*x/B)-A*int(x/B)
  return f
if(f(B-1)< f(N)):
  print(f(N))
else:
  print(f(B-1))

Failing test case input:
10 12 1

Expected output:
0


Actual output:
9


Fixed submission (verdict: Accepted):
A,B,N = map(int,input().split())
def f(x):
  f = int((A*x)/B)-A*int(x/B)
  return f
if(B-1 < N):
  print(f(B-1))
else:
  print(f(N))

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, B, N = map(int, input().split())
if N < B:
  print(int(A * N / B))
else:
  print(int(A * (N % B) / B))

Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
A, B, N = map(int, input().split())
if N < B:
  print(int(A * N / B))
else:
  print(int(A * (B - 1) / B))
Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from math import floor
A,B,N=list(map(int,input().split()))
ans = floor(1/B)
print(ans)

Failing test case input:
56 12 1

Expected output:
4


Actual output:
0


Fixed submission (verdict: Accepted):
from math import floor
A,B,N=list(map(int,input().split()))
x=min((B-1),N)
ans=floor(A*x/B)-A*floor(x/B)
print(ans)

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
a,b,n = map(int, input().split())

for x in range(min(b, n), 0, -1):
    score = int(a*x/b) - a*int(x/b)
    if (score > 0):
        print(score)
        break


Failing test case input:
1 15 0

Expected output:
0


Actual output:

Fixed submission (verdict: Accepted):
import math

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

for x in range(min(b, n), 0, -1):
    score = math.floor((a*x)/b) - math.floor(a*(x
    if (score > 0):
        print(score)
        break
else:
    print(0)

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,n=map(int,input().split())
x=[]
x.append(int(a*n/b))
if n>=b:
  x.append(int(a*(b-1)/b))
print(max(x))

Failing test case input:
14 7 8

Expected output:
12


Actual output:
16


Fixed submission (verdict: Accepted):
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))

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
A,B,N=map(int,input().split())
s=math.floor((A*B-1)/B)
t=math.floor((A*N)/B)
print(max(s,t))


Failing test case input:
4 7 4

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
import math
A,B,N=map(int,input().split())
s=math.floor((A*(B-1))/B)
t=math.floor((A*N)/B)
print(min(s,t))

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
a,b,n=map(int,input().split())
c=math.floor((a*n)/b)-(a*math.floor(n/b))
print(c)
  

Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
import math
a,b,n=map(int,input().split())
d=min(n,b-1)
c=math.floor((a*d)/b)-(a*math.floor(d/b))
print(c)

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def resolve():
    
    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 B > 1:
        if B < N:
            print(A-1)
        else:
            print(func(N))
    else:
        print(0)

if __name__ == "__main__":
    resolve()


Failing test case input:
14 7 8

Expected output:
12


Actual output:
13


Fixed submission (verdict: Accepted):
def resolve():
    
    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()
Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
import math

if __name__ == '__main__':
    a, b, n = list(map(lambda x: int(x), sys.stdin.readline().split(' ')))
    old = 0
    x = b - 1
    print(math.floor(a*x/b)-a*math.floor(x/b))

Failing test case input:
11 19 2

Expected output:
1


Actual output:
10


Fixed submission (verdict: Accepted):
import sys
import math

if __name__ == '__main__':
    a, b, n = list(map(lambda x: int(x), sys.stdin.readline().split(' ')))
    old = 0
    if 0 <= b-1 and b-1 <= n:
        x = b - 1
        print(math.floor(a*x/b)-a*math.floor(x/b))
    else:
        x = n
        print(math.floor(a*x/b)-a*math.floor(x/b))

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, B, N = map(int, input().split())
result = int(((N/B-int(N/B))*A))
print(result)

Failing test case input:
14 7 8

Expected output:
12


Actual output:
1


Fixed submission (verdict: Accepted):
A, B, N = map(int, input().split())

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

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def resolve():
    
    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

    res = 0

    resx = N % B
    for i in range(resx-9, resx+1):
        if i >= 1:
            res = max(res, func(i))
    
    print(res)

if __name__ == "__main__":
    resolve()


Failing test case input:
-2 2 1

Expected output:
-1


Actual output:
0


Fixed submission (verdict: Accepted):
def resolve():
    
    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()

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from math import floor
a,b,n = map(int,input().split())

if a < 1:
    n = 1

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


Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
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))))

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
A,B,N = map(int,input().split())

print(min(B-1,N))

Failing test case input:
1 34 1

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
A,B,N = map(int,input().split())
x = min(B-1,N)
print((A*x)

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,n = map(int,input().split())


x = b-1

if b > n:
  res = int(a/b)

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


Failing test case input:
11 10 0

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
a,b,n = map(int,input().split())


x = b-1

if b > n:
  res = int((a/b)*n)

else :
  res = int((a/b)*(b-1))
  
print(res)
Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    A, B, N = list(map(int, input().split(' ')))
    N %= B
    n = 0
    while B * (n + 1) <= A * N:
        n += 1
    print(n)


if __name__ == '__main__':
    main()

Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
def main():
    A, B, N = list(map(int, input().split(' ')))
    x = N if N < B else B - 1
    print(A * x 


if __name__ == '__main__':
    main()

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
import math
input = sys.stdin.readline


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

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


Failing test case input:
14 7 8

Expected output:
12


Actual output:
13


Fixed submission (verdict: Accepted):
import sys
import math
input = sys.stdin.readline


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

if N > B - 1 and A <= B:
  print (A-1)
elif A > B  and N >= B - 1 :
  N = B - 1
  y = math.floor( A * N /B) - A * math.floor( N / B)
  print(y )

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

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
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)

Failing test case input:
-2 2 1

Expected output:
-1


Actual output:
1


Fixed submission (verdict: Accepted):
a,b,n = map(int,input().split())

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

w=min(n,b-1) 
ma=f(w)
print(ma)

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b, n = map(int, input().split())

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

if n >= b-1:
    ans = floor(b-1)
else:
    ans = floor(n-1)




print(ans)


Failing test case input:
56 12 1

Expected output:
4


Actual output:
0


Fixed submission (verdict: Accepted):
a, b, n = map(int, input().split())

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

if n >= b-1:
    ans = floor(b-1)
else:
    ans = floor(n)

print(ans)

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,n = map(int, input().split())

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

Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
a,b,n = map(int, input().split())

x =  min(b-1, n)
print(int(a*x/b) - a*int(x/b))
Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):



def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10 ** 6)
    from math import floor
    

    def dump(*args):
        sys.stderr.write(str(args))

    a, b, n = map(int, input().split())
    last = -1
    ans = -1

    def evaluate(number):
        return floor(a*number/b)-a*floor(number/b)

    for i in range(n, 0, -1):
        t = evaluate(i)
        ans = max(ans, t)
        
        if t < last:
            break
    print(ans)


if __name__ == '__main__':
    main()


Failing test case input:
2 20 0

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):



def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10 ** 6)
    from math import floor
    

    def dump(*args):
        sys.stderr.write(str(args))

    a, b, n = map(int, input().split())
    last = -1
    ans = -1

    def evaluate(number):
        return floor(a * number / b) - a * floor(number / b)

    
    
    print(max(evaluate(min(b, n)), evaluate(min(b-1, n))))


if __name__ == '__main__':
    main()

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
import bisect
import math





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

    print(max(aa, bb))

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

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


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


if __name__ == "__main__":
    main()


Failing test case input:
2 260 4

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
import bisect
import math





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

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

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


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


if __name__ == "__main__":
    main()

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math

A,B,N=map(int,input().split())
print(math.floor(A/B*(~-B/B if B<N else N)))


Failing test case input:
14 7 8

Expected output:
12


Actual output:
1


Fixed submission (verdict: Accepted):
import math

A,B,N=map(int,input().split())
print(math.floor(A/B*(~-B if N>=B else N)))

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from math import floor
A, B, N = map(int,input().split())

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

Failing test case input:
2 260 4

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
from math import floor
A, B, N = map(int,input().split())

x=min(N,B-1)
print(floor(A*x/B)-A*floor(x/B))
Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
a,b,n=map(int, input().split())
x=n%b
if n==0:
    print(0)
else:
    if x==0:
        x=b-1
    num1=math.floor((a*x)/b)
    num2=a*math.floor(x/b)
    print(num1-num2)

Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
import math
a,b,n=map(int, input().split())
x=n%b
if n==0:
    print(0)
else:
    if x==0 or n>=b:
        x=b-1
    num1=math.floor((a*x)/b)
    num2=a*math.floor(x/b)
    print(num1-num2)

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math                                                       
A, B, N = map(int, input().split())



maxR = -1
maxX = 0
for x in range(0, N+1):
    R = math.floor(A*x/B) - A * math.floor(x/B)
    if R >= maxR:
        maxR = R
        maxX = x
print (maxX)

Failing test case input:
1 36 3

Expected output:
0


Actual output:
3


Fixed submission (verdict: Accepted):
import math                                                       
A, B, N = map(int, input().split())


T = N
maxR = -1
maxT = 0

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

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):



from math import *
from copy import *					
from heapq import *					
from string import *				
from random import *				
from bisect import *				
from sys import stdin				
from sys import maxsize				
from operator import *				
from itertools import *				
from collections import Counter		
from collections import defaultdict 



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

def solve(a,b,n):
	x = n-1
	if(b >= n):
		x = n
	return f(a,b,x)


a,b,n = list(map(int, stdin.readline().rstrip().split()))
ans = solve(a,b,n)
print(ans)



Failing test case input:
14 7 8

Expected output:
12


Actual output:
0


Fixed submission (verdict: Accepted):



from math import *
from copy import *					
from heapq import *					
from string import *				
from random import *				
from bisect import *				
from sys import stdin				
from sys import maxsize				
from operator import *				
from itertools import *				
from collections import Counter		
from collections import defaultdict 



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

def solve(a,b,n):
	x = b-1
	if(b > n):
		x = n
	return floor(a*x/b)


a,b,n = list(map(int, stdin.readline().rstrip().split()))
ans = solve(a,b,n)
print(ans)

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
 
a,b,n = map(int,input().split())
cnt = 0
t = 0

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



Failing test case input:
14 7 8

Expected output:
12


Actual output:
16


Fixed submission (verdict: Accepted):
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))
Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def resolve():
    
    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

    res = 0

    for i in range(N-10, N+1):
        if i >= 1:
            res = max(res, func(i))
    
    print(res)

if __name__ == "__main__":
    resolve()


Failing test case input:
-2 2 1

Expected output:
-1


Actual output:
0


Fixed submission (verdict: Accepted):
def resolve():
    
    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()

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
A,B,N = map(int,input().split())
m = min(B,N)
num = math.floor((A*m)/B) - A * math.floor(m / B)
print(num)

Failing test case input:
14 7 8

Expected output:
12


Actual output:
0


Fixed submission (verdict: Accepted):
import math
A,B,N = map(int,input().split())
m = min(B-1,N)
num = math.floor((A*m)/B) - A * math.floor(m / B)
print(num)

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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))


Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
import math
a,b,n = map(int, input().split())

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

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

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

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import math
A,B,N=map(int,input().split())
han=0
kot=0
i=0
if B-1>=N:
    print(math.floor(A*N/B)-A*math.floor(N/B))
    i=1
else:
    for a in range(B-1,N-5,B):
        if han<(math.floor(A*a/B)-A*math.floor(a/B)):
            han=(math.floor(A*a/B)-A*math.floor(a/B))
            kot=a

if i==0:
    print(han)

Failing test case input:
14 7 8

Expected output:
12


Actual output:
0


Fixed submission (verdict: Accepted):
import math
A,B,N=map(int,input().split())
han=0
kot=0
i=0
if B==1:
    print(0)
    exit()
if B-1>=N:
    print(math.floor(A*N/B)-A*math.floor(N/B))
    i=1
else:
    for a in range(B-1,N,B):
        if han<(math.floor(A*a/B)-A*math.floor(a/B)):
            han=(math.floor(A*a/B)-A*math.floor(a/B))
            kot=a

if i==0:
    print(han)

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
from math import floor

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

print(floor(A/B*N))

Failing test case input:
14 7 8

Expected output:
12


Actual output:
16


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
from math import floor

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

if N<B:
    print(floor(A/B*N))
else:
    print(floor(A/B*(B-1)))
Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def resolve():
    
    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

    res = 0

    for i in range(N-A, N+1):
        if i >= 1:
            res = max(res, func(i))
    
    print(res)

if __name__ == "__main__":
    resolve()


Failing test case input:
-2 2 1

Expected output:
-1


Actual output:
0


Fixed submission (verdict: Accepted):
def resolve():
    
    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()

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,n=map(int,input().split())
if b==1:
    print(0)
elif n>=b:
    print(int(b-1)/b*a)
else:
    print(int(n/b*a))

Failing test case input:
14 7 8

Expected output:
12


Actual output:
12.0


Fixed submission (verdict: Accepted):
a,b,n=map(int,input().split())
if n>=b:
    print(int((b-1)/b*a))
else:
    print(int(n/b*a))

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
A,B,N=map(float,input().split())
if N == B:
    N = N-1
ans = math.floor((A*N/B)) - A*math.floor(N/B)
print(int(ans))

Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
import math
A,B,N=map(float,input().split())
if N >= B:
    N = B-1
ans = math.floor(A*N/B) - A*math.floor(N/B)
print(int(ans))

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
a,b,n=map(int, input().split())
x=n%b
if x==0:
    x=b-1
num1=math.floor((a*x)/b)
num2=a*math.floor(x/b)
print(num1-num2)

Failing test case input:
2 8 0

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
import math
a,b,n=map(int, input().split())
x=n%b
if n==0:
    print(0)
else:
    if x==0 or n>=b:
        x=b-1
    num1=math.floor((a*x)/b)
    num2=a*math.floor(x/b)
    print(num1-num2)

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, B, N = map(int, input().split(" "))
ans = 0
x = B-1
floor1 = int(A*x/B)
floor2 = int(A*N/B) - A * int(N/B)
print(max(floor1,floor2))

Failing test case input:
7 20 1

Expected output:
0


Actual output:
6


Fixed submission (verdict: Accepted):
A, B, N = map(int, input().split(" "))
ans = 0
x = min(B-1,N)
floor = int(A*x/B) - A * int(x/B)
print(floor)

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from math import floor
a,b,n = map(int,input().split())
print (floor((a*n)/b) - a*(floor(n/b)))


Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
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))))
Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
A,B,N = map(int, input().split())
import math 

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


Failing test case input:
-2 2 1

Expected output:
-1


Actual output:
-3


Fixed submission (verdict: Accepted):
A,B,N = map(int, input().split())
import math 

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

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from math import floor
a, b, n = map(int, input().split())

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

Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
from math import floor
a, b, n = map(int, input().split())
n = min(b-1, n)
ans = floor(a*(n)/b) - a*floor((n)/b)
print(ans)

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
from math import floor

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


Failing test case input:
14 7 8

Expected output:
12


Actual output:
13


Fixed submission (verdict: Accepted):
from math import floor

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

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math                                                       
A, B, N = map(int, input().split())



maxR = -1
maxX = 0
for x in range(1, N+1):
    R = math.floor(A*x/B) - A * math.floor(x/B)
    if R >= maxR:
        maxR = R
        maxX = x
print (maxX)

Failing test case input:
0 23 5

Expected output:
0


Actual output:
5


Fixed submission (verdict: Accepted):
import math                                                       
A, B, N = map(int, input().split())


T = N
maxR = -1
maxT = 0

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

Problem: p02696
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math

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

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


Failing test case input:
14 7 8

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
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)

Problem: p02696
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
a,b,n = map(int, input().split())

for x in range(min(b, n), 0, -1):
    score = (a*x)
    if (score > 0):
        print(score)
        break


Failing test case input:
0 34 3

Expected output:
0


Actual output:

Fixed submission (verdict: Accepted):
import math

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

for x in range(min(b, n), 0, -1):
    score = math.floor((a*x)/b) - math.floor(a*(x
    if (score > 0):
        print(score)
        break
else:
    print(0)