def generate_weighted_list(st, ed, ratio=(20, 2, 1)):

    """
    Generate an integer list consists of [st, ed].
    Ratio of each integer in the list is determined using ratio parameter.

    For example, st = 1, ed = 6, ratio = (20, 2, 1),
    output = [ 20 1s, 20 2s, 2 3s, 2 4s, 1 5s, 1 6s ]
    """

    nums = [i for i in range(st, ed+1)]

    n_boundary = len(ratio)
    boundary_offset = (ed - st + n_boundary) // n_boundary

    choices = []
    for i, n in enumerate(nums):
        r = ratio[i // boundary_offset]
        choices.extend([n] * r)

    return choices