


from __future__ import annotations

import math






def 							__lowercase     (				__lowerCAmelCase							:       int      ,					__lowerCAmelCase							:       int      ,					__lowerCAmelCase							:       bool      ,					__lowerCAmelCase							:       list[int]      ,					__lowerCAmelCase							:       float     ):

							if depth < 0:
														raise ValueError('Depth cannot be less than 0'     )

							if len(__lowerCAmelCase     ) == 0:
														raise ValueError('Scores cannot be empty'     )

							if depth == height:
														return scores[node_index]

							if is_max:
														return max(
														    minimax(depth + 1      ,					node_index * 2      ,					__lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase     )      ,					minimax(depth + 1      ,					node_index * 2 + 1      ,					__lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase     )      ,					)

							return min(
							    minimax(depth + 1      ,					node_index * 2      ,					__lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase     )      ,					minimax(depth + 1      ,					node_index * 2 + 1      ,					__lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase     )      ,					)






def 							__lowercase     (				):
							a__    =  [9_0, 2_3, 6, 3_3, 2_1, 6_5, 1_2_3, 3_4_4_2_3]
							a__    =  math.log(len(__lowerCAmelCase     )      ,					2     )
							print('Optimal value : '      ,					end=''     )
							print(minimax(0      ,					0      ,					__lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase     )     )


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						main()








from decimal import Decimal, getcontext
from math import ceil, factorial






def 							__lowercase     (				__lowerCAmelCase							:       int     ):

							if not isinstance(__lowerCAmelCase      ,					__lowerCAmelCase     ):
														raise TypeError('Undefined for non-integers'     )
							elif precision < 1:
														raise ValueError('Undefined for non-natural numbers'     )

							a__    =  precision
							a__    =  ceil(precision / 1_4     )
							a__    =  4_2_6_8_8_0 * Decimal(1_0_0_0_5     ).sqrt()
							a__    =  1
							a__    =  1_3_5_9_1_4_0_9
							a__    =  Decimal(__lowerCAmelCase     )
							for k in range(1      ,					__lowerCAmelCase     ):
														a__    =  factorial(6 * k     ) // (factorial(3 * k     ) * factorial(__lowerCAmelCase     ) ** 3)
														linear_term += 5_4_5_1_4_0_1_3_4
														exponential_term *= -2_6_2_5_3_7_4_1_2_6_4_0_7_6_8_0_0_0
														partial_sum += Decimal(multinomial_term * linear_term     ) / exponential_term
							return str(constant_term / partial_sum     )[:-1]


if __name__ == "__main__":
						snake_case							: Tuple      =   50
						print(f"""The first {n} digits of pi is: {pi(n)}""")




