



'''simple docstring'''



from __future__ import annotations
def        UpperCAmelCase (    A	:					float       ,		A	:					float       ,		A	:					float					):
							if days_between_payments <= 0:
														raise ValueError('''days_between_payments must be > 0'''					)
							if daily_interest_rate < 0:
														raise ValueError('''daily_interest_rate must be >= 0'''					)
							if principal <= 0:
														raise ValueError('''principal must be > 0'''					)
							return principal * daily_interest_rate * days_between_payments
def        UpperCAmelCase (    A	:					float       ,		A	:					float       ,		A	:					float       ,		):
							if number_of_compounding_periods <= 0:
														raise ValueError('''number_of_compounding_periods must be > 0'''					)
							if nominal_annual_interest_rate_percentage < 0:
														raise ValueError('''nominal_annual_interest_rate_percentage must be >= 0'''					)
							if principal <= 0:
														raise ValueError('''principal must be > 0'''					)

							return principal * (
							    (1 + nominal_annual_interest_rate_percentage) ** number_of_compounding_periods
							    - 1
							)
def        UpperCAmelCase (    A	:					float       ,		A	:					float       ,		A	:					float       ,		):
							if number_of_years <= 0:
														raise ValueError('''number_of_years must be > 0'''					)
							if nominal_annual_percentage_rate < 0:
														raise ValueError('''nominal_annual_percentage_rate must be >= 0'''					)
							if principal <= 0:
														raise ValueError('''principal must be > 0'''					)

							return compound_interest(
							    A       ,		nominal_annual_percentage_rate / 365       ,		number_of_years * 365					)


if __name__ == "__main__":
							import doctest

							doctest.testmod()









'''simple docstring'''



from math import pow
def        UpperCAmelCase (    A	:					int       ,		A	:					int       ,		A	:					int       ,		A	:					int       ,		A	:					int       ,		):
							if current_sum == needed_sum:
														# If the sum of the powers is equal to needed_sum, then we have a solution.
														solutions_count += 1
														return current_sum, solutions_count

							SCREAMING_SNAKE_CASE       :   Tuple         =      int(pow(A       ,		A					)					)
							if current_sum + i_to_n <= needed_sum:
														# If the sum of the powers is less than needed_sum, then continue adding powers.
														current_sum += i_to_n
														SCREAMING_SNAKE_CASE       ,SCREAMING_SNAKE_CASE       :   Dict         =      backtrack(
														    A       ,		A       ,		current_number + 1       ,		A       ,		A					)
														current_sum -= i_to_n
							if i_to_n < needed_sum:
														# If the power of i is less than needed_sum, then try with the next power.
														SCREAMING_SNAKE_CASE       ,SCREAMING_SNAKE_CASE       :   int         =      backtrack(
														    A       ,		A       ,		current_number + 1       ,		A       ,		A					)
							return current_sum, solutions_count
def        UpperCAmelCase (    A	:					int       ,		A	:					int					):
							if not (1 <= needed_sum <= 1000 and 2 <= power <= 10):
														raise ValueError(
														    '''Invalid input\n'''
														    '''needed_sum must be between 1 and 1000, power between 2 and 10.'''					)

							return backtrack(A       ,		A       ,		1       ,		0       ,		0					)[1]  # Return the solutions_count


if __name__ == "__main__":
							import doctest

							doctest.testmod()




