Buggy python submission (verdict: Runtime Error):
A, B, N = map(floor, input().split())
from math import floor

if B > N:
    ans = floor(A*N/B)
    print(ans)
else:
    ans = floor(A*N/B) - A*floor(N/B)
    ans_2nd = 0
    x = (N//B)*B - 1
    temp = floor((A*x)/B) - A*floor(x/B)
    # while ans <= temp and x >= 0:
    #     ans = temp
    #     temp = floor(A*x/B) - A*floor(x/B)
    #     x -= B
    # while ans_2nd <= temp and x >= 0:
    #     ans_2nd = temp
    #     temp = floor(A*x/B) - A*floor(x/B)
    #     x -= B
    # prfloor(max(ans, ans_2nd))
    print(max(temp, ans))

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

# if B > N:
#     ans = floor(A*N/B)
#     print(ans)
# else:
#     ans = floor(A*N/B) - A*floor(N/B)
#     ans_2nd = 0
#     x = (N//B)*B - 1
#     temp = floor((A*x)/B) - A*floor(x/B)
#     # while ans <= temp and x >= 0:
#     #     ans = temp
#     #     temp = floor(A*x/B) - A*floor(x/B)
#     #     x -= B
#     # while ans_2nd <= temp and x >= 0:
#     #     ans_2nd = temp
#     #     temp = floor(A*x/B) - A*floor(x/B)
#     #     x -= B
#     # prfloor(max(ans, ans_2nd))
#     print(max(temp, ans))

Buggy python submission (verdict: Runtime Error):
A, B, N = map(floor, input().split())
from math import floor

if B > N:
    ans = floor(A*N/B)
    print(ans)
else:
    ans = floor(A*N/B) - A*floor(N/B)
    ans_2nd = 0
    x = (N//B)*B - 1
    temp = floor(A*x/B) - A*floor(x/B)
    # while ans <= temp and x >= 0:
    #     ans = temp
    #     temp = floor(A*x/B) - A*floor(x/B)
    #     x -= B
    # while ans_2nd <= temp and x >= 0:
    #     ans_2nd = temp
    #     temp = floor(A*x/B) - A*floor(x/B)
    #     x -= B
    # prfloor(max(ans, ans_2nd))
    print(max(temp, ans))

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

# if B > N:
#     ans = floor(A*N/B)
#     print(ans)
# else:
#     ans = floor(A*N/B) - A*floor(N/B)
#     ans_2nd = 0
#     x = (N//B)*B - 1
#     temp = floor((A*x)/B) - A*floor(x/B)
#     # while ans <= temp and x >= 0:
#     #     ans = temp
#     #     temp = floor(A*x/B) - A*floor(x/B)
#     #     x -= B
#     # while ans_2nd <= temp and x >= 0:
#     #     ans_2nd = temp
#     #     temp = floor(A*x/B) - A*floor(x/B)
#     #     x -= B
#     # prfloor(max(ans, ans_2nd))
#     print(max(temp, ans))

Buggy python submission (verdict: Runtime Error):
A, B, N = map(floor, input().split())
from math import floor

if B > N:
    ans = floor(A*N/B)
    prfloor(ans)
else:
    ans = floor(A*N/B) - A*floor(N/B)
    ans_2nd = 0
    x = (N//B)*B - 1
    temp = floor(A*x/B) - A*floor(x/B)
    # while ans <= temp and x >= 0:
    #     ans = temp
    #     temp = floor(A*x/B) - A*floor(x/B)
    #     x -= B
    # while ans_2nd <= temp and x >= 0:
    #     ans_2nd = temp
    #     temp = floor(A*x/B) - A*floor(x/B)
    #     x -= B
    # prfloor(max(ans, ans_2nd))
    prfloor(max(temp, ans))

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

# if B > N:
#     ans = floor(A*N/B)
#     print(ans)
# else:
#     ans = floor(A*N/B) - A*floor(N/B)
#     ans_2nd = 0
#     x = (N//B)*B - 1
#     temp = floor((A*x)/B) - A*floor(x/B)
#     # while ans <= temp and x >= 0:
#     #     ans = temp
#     #     temp = floor(A*x/B) - A*floor(x/B)
#     #     x -= B
#     # while ans_2nd <= temp and x >= 0:
#     #     ans_2nd = temp
#     #     temp = floor(A*x/B) - A*floor(x/B)
#     #     x -= B
#     # prfloor(max(ans, ans_2nd))
#     print(max(temp, ans))

Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = map(int, input().split())

if B > N:
    ans = int(A*N/B)
    print(ans)
else:
    t = int(A*N/B)- A*int(N/B)
    ans = 0
    x = (N//B)*B - 1
    while True:
        temp = int(A*x/B) - A*int(x/B)
        # if ans > temp:
        #     break
        # ans = temp
        ans = max(ans, temp)
        x -= B
        if x < 0:
            break
    print(max(ans, t))

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

# if B > N:
#     ans = floor(A*N/B)
#     print(ans)
# else:
#     ans = floor(A*N/B) - A*floor(N/B)
#     ans_2nd = 0
#     x = (N//B)*B - 1
#     temp = floor((A*x)/B) - A*floor(x/B)
#     # while ans <= temp and x >= 0:
#     #     ans = temp
#     #     temp = floor(A*x/B) - A*floor(x/B)
#     #     x -= B
#     # while ans_2nd <= temp and x >= 0:
#     #     ans_2nd = temp
#     #     temp = floor(A*x/B) - A*floor(x/B)
#     #     x -= B
#     # prfloor(max(ans, ans_2nd))
#     print(max(temp, ans))

Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = map(int, input().split())

if B > N:
    ans = int(A*N/B)
    print(ans)
else:
    ans = 0    
    x = B - 1
    while True:
        temp = int(A*x/B) - A*int(x/B)
        if ans > temp:
            break
        ans = temp
        x += B
        if x > N:
            break
    print(ans)

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

# if B > N:
#     ans = floor(A*N/B)
#     print(ans)
# else:
#     ans = floor(A*N/B) - A*floor(N/B)
#     ans_2nd = 0
#     x = (N//B)*B - 1
#     temp = floor((A*x)/B) - A*floor(x/B)
#     # while ans <= temp and x >= 0:
#     #     ans = temp
#     #     temp = floor(A*x/B) - A*floor(x/B)
#     #     x -= B
#     # while ans_2nd <= temp and x >= 0:
#     #     ans_2nd = temp
#     #     temp = floor(A*x/B) - A*floor(x/B)
#     #     x -= B
#     # prfloor(max(ans, ans_2nd))
#     print(max(temp, ans))