'''simple docstring'''




import math






class 		__A       :






       def 			_snake_case						(      self				,     UpperCamelCase_				,     UpperCamelCase_      ):
              __UpperCAmelCase  :				Dict       				=		0.0
              __UpperCAmelCase  :				List[str]       				=		0.0
              for i in range(len(UpperCamelCase_      )      ):
                     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 			_snake_case						(      self				,     UpperCamelCase_				,     UpperCamelCase_				,     UpperCamelCase_				,     UpperCamelCase_      ):
              for i in range(len(UpperCamelCase_      )      ):
                     weights[j][i] += alpha * (sample[i] - weights[j][i])
              return weights





def _lowercase	(      )					->       None:





       """simple docstring"""


       __UpperCAmelCase  :				Any       				=		[[1, 1, 0, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 0, 1, 1]]

       # weight initialization ( n, C )
       __UpperCAmelCase  :				Union[str, Any]       				=		[[0.2, 0.6, 0.5, 0.9], [0.8, 0.4, 0.7, 0.3]]

       # training
       __UpperCAmelCase  :				str       				=		SelfOrganizingMap()
       __UpperCAmelCase  :				Any       				=		3
       __UpperCAmelCase  :				Union[str, Any]       				=		0.5

       for _ in range(lowerCamelCase__						):
              for j in range(len(lowerCamelCase__						)						):
                     # training sample
                     __UpperCAmelCase  :				Optional[Any]       				=		training_samples[j]

                     # Compute the winning vector
                     __UpperCAmelCase  :				Tuple       				=		self_organizing_map.get_winner(lowerCamelCase__							,    lowerCamelCase__						)

                     # Update the winning vector
                     __UpperCAmelCase  :				Dict       				=		self_organizing_map.update(lowerCamelCase__							,    lowerCamelCase__							,    lowerCamelCase__							,    lowerCamelCase__						)

    # classify test sample
       __UpperCAmelCase  :				Any       				=		[0, 0, 0, 1]
       __UpperCAmelCase  :				Any       				=		self_organizing_map.get_winner(lowerCamelCase__							,    lowerCamelCase__						)

       # 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()







'''simple docstring'''




def _lowercase	(      lowerCamelCase__ = 100						)					->       int:





       """simple docstring"""


       __UpperCAmelCase  :				Optional[Any]       				=		(n * (n + 1) // 2) ** 2
       __UpperCAmelCase  :				Any       				=		n * (n + 1) * (2 * n + 1) // 6
       return sum_cubes - sum_squares


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






