





def 		__magic_name__				( lowercase_				)		->					int:


						'''simple docstring'''


						UpperCamelCase  							= 0
						while num > 0:
												digit_sum += num % 10
												num //= 10
						return digit_sum
def 		__magic_name__				( lowercase_ = 100				)		->					int:


						'''simple docstring'''


						UpperCamelCase  							= 1
						UpperCamelCase  							= 2

						for i in range(2						,		max_n + 1				):
												UpperCamelCase  							= pre_numerator
												UpperCamelCase  							= 2 * i // 3 if i % 3 == 0 else 1
												UpperCamelCase  							= cur_numerator
												UpperCamelCase  							= e_cont * pre_numerator + temp

						return sum_digits(_UpperCAmelCase				)


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






import math




class   __lowercase						:






	def       _a(self				: Dict      ,	snake_case				: list[list[float]]      ,	snake_case				: list[int]    ) ->			int:
							_lowercase       :	List[Any]           =   0.0
							_lowercase       :	Any           =   0.0
							for i in range(len(snake_case    )    ):
													da += math.pow((sample[i] - weights[0][i])      ,	2    )
													da += math.pow((sample[i] - weights[1][i])      ,	2    )
													return 0 if da > da else 1
							return 0






	def       _a(self				: Dict      ,	snake_case				: list[list[int | float]]      ,	snake_case				: list[int]      ,	snake_case				: int      ,	snake_case				: float    ) ->			list[list[int | float]]:
							for i in range(len(snake_case    )    ):
													weights[j][i] += alpha * (sample[i] - weights[j][i])
							return weights



def 		UpperCamelCase     (       )   ->			None:






						'''simple docstring'''

						_lowercase       :	Union[str, Any]           =   [[1, 1, 0, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 0, 1, 1]]

						# weight initialization ( n, C )
						_lowercase       :	Tuple           =   [[0.2, 0.6, 0.5, 0.9], [0.8, 0.4, 0.7, 0.3]]

						# training
						_lowercase       :	List[Any]           =   SelfOrganizingMap()
						_lowercase       :	Any           =   3
						_lowercase       :	Optional[Any]           =   0.5

						for _ in range(_UpperCAmelCase  ):
												for j in range(len(_UpperCAmelCase  )  ):
																		# training sample
																		_lowercase       :	Optional[int]           =   training_samples[j]

																		# Compute the winning vector
																		_lowercase       :	Tuple           =   self_organizing_map.get_winner(_UpperCAmelCase ,			_UpperCAmelCase  )

																		# Update the winning vector
																		_lowercase       :	str           =   self_organizing_map.update(_UpperCAmelCase ,			_UpperCAmelCase ,			_UpperCAmelCase ,			_UpperCAmelCase  )

    # classify test sample
						_lowercase       :	Any           =   [0, 0, 0, 1]
						_lowercase       :	Dict           =   self_organizing_map.get_winner(_UpperCAmelCase ,			_UpperCAmelCase  )

						# results
						print(f"""Clusters that the test sample belongs to : {winner}"""  )
						print(f"""Weights that have been trained : {weights}"""  )


# running the main() function
if __name__ == "__main__":
							main()




