def progression(b, q, lim) -> list:
    nums = []
    nums.append(b)
    while b > lim:
        b *= q
        if b > lim:
            nums.append(b)
    return nums


def mult(nums) -> float:
    res = 0
    for i in nums:
        res += i
    return res


if __name__ == "__main__":
    b, q, lim = map(float, input("Please, enter b, q, lim: ").split())
    nums = progression(b, q, lim)
    print("Progression:", nums)
    print("Sum:", mult(nums))

c470f994c72be4acc457c82b3918ddc48807e007
<mask token>

<mask token>


def mult(nums) ->float:
    res = 0
    for i in nums:
        res += i
    return res


<mask token>

def progression(b, q, lim) ->list:
    nums = []
    nums.append(b)
    while b > lim:
        b *= q
        if b > lim:
            nums.append(b)
    return nums


def mult(nums) ->float:
    res = 0
    for i in nums:
        res += i
    return res


<mask token>

def progression(b, q, lim) ->list:
    nums = []
    nums.append(b)
    while b > lim:
        b *= q
        if b > lim:
            nums.append(b)
    return nums


def mult(nums) ->float:
    res = 0
    for i in nums:
        res += i
    return res


if __name__ == '__main__':
    b, q, lim = map(float, input('Please, enter b, q, lim: ').split())
    nums = progression(b, q, lim)
    print('Progression:', nums)
    print('Sum:', mult(nums))

def progression(b, q, lim) -> list:
    nums = []
    nums.append(b)
    while b > lim:
        b *= q
        if b > lim:
            nums.append(b)
    return nums


def mult(nums) -> float:
    res = 0
    for i in nums:
        res += i
    return res


if __name__ == "__main__":
    b, q, lim = map(float, input("Please, enter b, q, lim: ").split())
    nums = progression(b, q, lim)
    print("Progression:", nums)
    print("Sum:", mult(nums))
