import random


def rand_pl(m: int) -> int:
    """
    Random integer distributed by a power law in the limit of the parameter m

    E.g.:

    With m = 2
    returns 1 80% of the time
    returns 2 20% of the time

    With m = 3
    returns 1 73.47% of the time
    returns 2 18.37% of the time
    returns 3  8.16% of the time
    """
    weight = (i**-2 for i in range(1, m+1))
    chs = random.choices(range(1, m+1), tuple(weight))
    return chs[0]