






'''simple docstring'''

from __future__ import annotations

from collections.abc import Callable

_A				:    Dict     						=list[list[float | int]]







def 						__UpperCamelCase				(							_lowercase,				_lowercase					) ->			Dict:
	_lowercase					:       int       =		len(_A					)
	_lowercase					:       Matrix       =		[[0 for _ in range(size + 1					)] for _ in range(_A					)]
	_lowercase					:       int
	_lowercase					:       int
	_lowercase					:       int
	_lowercase					:       int
	_lowercase					:       int
	_lowercase					:       float

	for row in range(_A					):
		for col in range(_A					):
			_lowercase					:       Tuple       =		matrix[row][col]

		_lowercase					:       List[str]       =		vector[row][0]

	_lowercase					:       int       =		0
	_lowercase					:       List[Any]       =		0
	while row < size and col < size:
		# pivoting
		_lowercase					:       List[Any]       =		max((abs(augmented[rowa][col]					), rowa) for rowa in range(_A,				_A					)					)[
		    1
		]
		if augmented[pivot_row][col] == 0:
			col += 1
			continue
		else:
			_lowercase					:       List[Any]       =		augmented[pivot_row], augmented[row]

		for rowa in range(row + 1,				_A					):
			_lowercase					:       Union[str, Any]       =		augmented[rowa][col] / augmented[row][col]
			_lowercase					:       int       =		0
			for cola in range(col + 1,				size + 1					):
				augmented[rowa][cola] -= augmented[row][cola] * ratio

		row += 1
		col += 1

	# back substitution
	for col in range(1,				_A					):
		for row in range(_A					):
			_lowercase					:       Any       =		augmented[row][col] / augmented[col][col]
			for cola in range(_A,				size + 1					):
				augmented[row][cola] -= augmented[col][cola] * ratio

    # round to get rid of numbers like 2.000000000000004
	return [
	    [round(augmented[row][size] / augmented[row][row],				10					)] for row in range(_A					)
	]







def 						__UpperCamelCase				(							_lowercase					) ->			int:
	_lowercase					:       int       =		len(_A					)
	_lowercase					:       Matrix       =		[[0 for _ in range(_A					)] for _ in range(_A					)]
	_lowercase					:       Matrix       =		[[0] for _ in range(_A					)]
	_lowercase					:       Matrix
	_lowercase					:       int
	_lowercase					:       int
	_lowercase					:       int

	for x_val, y_val in enumerate(_A					):
		for col in range(_A					):
			_lowercase					:       List[Any]       =		(x_val + 1) ** (size - col - 1)
		_lowercase					:       str       =		y_val

	_lowercase					:       Optional[int]       =		solve(_A,				_A					)

	def interpolated_func(_lowercase					) -> int:
		return sum(
		    round(coeffs[x_val][0]					) * (var ** (size - x_val - 1))
		    for x_val in range(_A					)					)

	return interpolated_func







def 						__UpperCamelCase				(							_lowercase					) ->			Any:
	return (
	    1
	    - variable
	    + variable**2
	    - variable**3
	    + variable**4
	    - variable**5
	    + variable**6
	    - variable**7
	    + variable**8
	    - variable**9
	    + variable**10
	)







def 						__UpperCamelCase				(							_lowercase = question_function,				_lowercase = 10					) ->			int:
	_lowercase					:       list[int]       =		[func(_A					) for x_val in range(1,				order + 1					)]

	_lowercase					:       list[Callable[[int], int]]       =		[
	    interpolate(data_points[:max_coeff]					) for max_coeff in range(1,				order + 1					)
	]

	_lowercase					:       int       =		0
	_lowercase					:       Callable[[int], int]
	_lowercase					:       int

	for poly in polynomials:
		_lowercase					:       Any       =		1
		while func(_A					) == poly(_A					):
			x_val += 1

		ret += poly(_A					)

	return ret


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





'''simple docstring'''

from ...configuration_utils import PretrainedConfig
from ...utils import logging


_A				:    Dict     						=logging.get_logger(__name__)

_A				:    Dict     						={
    # See all MEGATRON_BERT models at https://huggingface.co/models?filter=bert
}



class 		lowerCamelCase__      (						A     ):




					'''simple docstring'''



					A_						    =						"""megatron-bert"""




					def __init__(  self				:	int     ,  UpperCamelCase_				:	int=2_9056     ,  UpperCamelCase_				:	Optional[int]=1024     ,  UpperCamelCase_				:	Optional[Any]=24     ,  UpperCamelCase_				:	List[Any]=16     ,  UpperCamelCase_				:	Optional[int]=4096     ,  UpperCamelCase_				:	Optional[Any]="gelu"     ,  UpperCamelCase_				:	List[Any]=0.1     ,  UpperCamelCase_				:	Union[str, Any]=0.1     ,  UpperCamelCase_				:	int=512     ,  UpperCamelCase_				:	Dict=2     ,  UpperCamelCase_				:	Union[str, Any]=0.02     ,  UpperCamelCase_				:	Any=1E-12     ,  UpperCamelCase_				:	Tuple=0     ,  UpperCamelCase_				:	Optional[int]="absolute"     ,  UpperCamelCase_				:	Optional[Any]=True     ,  **UpperCamelCase_				:	Any     ,  )  ->       List[Any]:



						'''simple docstring'''





						super().__init__(pad_token_id=UpperCamelCase_     ,  **UpperCamelCase_					)

						_lowercase					:       Dict       =		vocab_size
						_lowercase					:       Any       =		hidden_size
						_lowercase					:       Union[str, Any]       =		num_hidden_layers
						_lowercase					:       Dict       =		num_attention_heads
						_lowercase					:       Dict       =		hidden_act
						_lowercase					:       Optional[Any]       =		intermediate_size
						_lowercase					:       Optional[int]       =		hidden_dropout_prob
						_lowercase					:       Optional[Any]       =		attention_probs_dropout_prob
						_lowercase					:       Any       =		max_position_embeddings
						_lowercase					:       str       =		type_vocab_size
						_lowercase					:       Optional[Any]       =		initializer_range
						_lowercase					:       List[str]       =		layer_norm_eps
						_lowercase					:       List[Any]       =		position_embedding_type
						_lowercase					:       Optional[Any]       =		use_cache
