






"""simple docstring"""






def       _A    (__a					,       __a							)				-> int:
    """simple docstring"""






    SCREAMING_SNAKE_CASE_   :						Optional[Any]							=	[1]
    for i in range(2					,       __a							):
        factorials.append(factorials[-1] * i							)
    assert 0 <= k < factorials[-1] * n, "k out of bounds"

    SCREAMING_SNAKE_CASE_   :						Dict							=	[]
    SCREAMING_SNAKE_CASE_   :						Tuple							=	list(range(__a							)							)

    # Find permutation
    while factorials:
        SCREAMING_SNAKE_CASE_   :						Dict							=	factorials.pop()
        SCREAMING_SNAKE_CASE_		,    SCREAMING_SNAKE_CASE_   :						Dict							=	divmod(__a					,       __a							)
        permutation.append(elements[number]							)
        elements.remove(elements[number]							)
    permutation.append(elements[0]							)

    return permutation


if __name__ == "__main__":
  import doctest

  doctest.testmod()










"""simple docstring"""






def       _A    (__a = 1_00							)				-> int:
    """simple docstring"""






    SCREAMING_SNAKE_CASE_   :						int							=	(n * (n + 1) // 2) ** 2
    SCREAMING_SNAKE_CASE_   :						Optional[Any]							=	n * (n + 1) * (2 * n + 1) // 6
    return sum_cubes - sum_squares


if __name__ == "__main__":
  print(f'''{solution() = }''')


