




'''simple docstring'''




import math

def  _UpperCamelCase   (					SCREAMING_SNAKE_CASE__      :   Optional[int]							,    SCREAMING_SNAKE_CASE__      :   Any							):
 '''simple docstring'''





 if initial_intensity < 0:
  raise ValueError("""The value of intensity cannot be negative"""							)
  # handling of negative values of initial intensity
 if angle < 0 or angle > 360:
  raise ValueError("""In Malus Law, the angle is in the range 0-360 degrees"""							)
  # handling of values out of allowed range
 return initial_intensity * (math.cos(math.radians(_UpperCAmelCase							)							) ** 2)


if __name__ == "__main__":
    import doctest

    doctest.testmod(name='malus_law')







def 			SCREAMING_SNAKE_CASE (			_UpperCAmelCase		,      _UpperCAmelCase					)     ->	Union[str, Any]:
    lowerCamelCase__       : List[Any]   					=						[1]
    for i in range(2		,      _UpperCAmelCase					):
        factorials.append(factorials[-1] * i					)
    assert 0 <= k < factorials[-1] * n, "k out of bounds"

    lowerCamelCase__       : str   					=						[]
    lowerCamelCase__       : Optional[Any]   					=						list(range(_UpperCAmelCase					)					)

    # Find permutation
    while factorials:
        lowerCamelCase__       : List[str]   					=						factorials.pop()
        lowerCamelCase__					,				lowerCamelCase__       : Tuple   					=						divmod(_UpperCAmelCase		,      _UpperCAmelCase					)
        permutation.append(elements[number]					)
        elements.remove(elements[number]					)
    permutation.append(elements[0]					)

    return permutation


if __name__ == "__main__":
    import doctest

    doctest.testmod()





