Buggy python submission (verdict: Runtime Error):
    #!/usr/bin/env python3
    import sys
    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))  # type: int
        B = int(next(tokens))  # type: int
        N = int(next(tokens))  # type: int
        solve(A, B, N)
     
    if __name__ == '__main__':
        main()

Fixed submission:
#!/usr/bin/env python3
import sys
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))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(A, B, N)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
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))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(A, B, N)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys
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))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(A, B, N)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
import math

def solve(A: int, B: int, N: int):
    # max_pos = 0
    # max_v = 0
    # for x in range(1, B):
    #     v = math.floor(A*x/B) - A*math.floor(x/B)
    #     if v > max_v:
    #         max_v = v
    #         max_pos = x
    #p = max([math.floor(A*x/B) - A*math.floor(x/B) for x in range(1, B+1)])

    print(max([math.floor(A*x/B) - A*math.floor(x/B) for x in range(1, min(B, N+1))]))

    #r = A % B
    #print(max([A//B * x + math.floor((r * x)/B) for x in range(1, min(B+1, N+1))]))
    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))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(A, B, N)

if __name__ == '__main__':
    main()



Fixed submission:
#!/usr/bin/env python3
import sys
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))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(A, B, N)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys
import math

def solve(A: int, B: int, N: int):
    print(max([math.floor(A*x/B) - A*math.floor(x/B) for x in range(1, min(B+1, N+1))]))
    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))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(A, B, N)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys
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))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(A, B, N)

if __name__ == '__main__':
    main()