


import math
def   _UpperCamelCase				(						lowerCAmelCase_  ,						lowerCAmelCase_   )						->int:
   UpperCAmelCase							=     len(lowerCAmelCase_   )
   UpperCAmelCase							=     int(math.floor(math.sqrt(lowerCAmelCase_   )   )   )
   UpperCAmelCase							=     0
   while arr[min(lowerCAmelCase_  ,						lowerCAmelCase_   ) - 1] < x:
      UpperCAmelCase							=     step
      step += int(math.floor(math.sqrt(lowerCAmelCase_   )   )   )
      if prev >= n:
         return -1

   while arr[prev] < x:
      UpperCAmelCase							=     prev + 1
      if prev == min(lowerCAmelCase_  ,						lowerCAmelCase_   ):
         return -1
   if arr[prev] == x:
      return prev
   return -1


if __name__ == "__main__":
 __a     =			input("""Enter numbers separated by a comma:\n""").strip()
 __a     =			[int(item) for item in user_input.split(""",""")]
 __a     =			int(input("""Enter the number to be searched:\n"""))
 __a     =			jump_search(arr, x)
 if res == -1:
  print("""Number not found!""")
 else:
  print(F"""Number {x} is at index {res}""")







import math






class   __lowercase				:





      def        _lowercase				(		self						:					Union[str, Any]					,       __lowerCamelCase						:					list[list[float]]					,       __lowerCamelCase						:					list[int]       )    ->   int:






         """simple docstring"""







         UpperCAmelCase							=     0.0
         UpperCAmelCase							=     0.0
         for i in range(len(__lowerCamelCase       )       ):
            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        _lowercase				(		self						:					List[Any]					,       __lowerCamelCase						:					list[list[int | float]]					,       __lowerCamelCase						:					list[int]					,       __lowerCamelCase						:					int					,       __lowerCamelCase						:					float       )    ->   list[list[int | float]]:






         """simple docstring"""







         for i in range(len(__lowerCamelCase       )       ):
            weights[j][i] += alpha * (sample[i] - weights[j][i])
         return weights

def   _UpperCamelCase				(						)						->None:
   # Training Examples ( m, n )
   UpperCAmelCase							=     [[1, 1, 0, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 0, 1, 1]]

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

   # training
   UpperCAmelCase							=     SelfOrganizingMap()
   UpperCAmelCase							=     3
   UpperCAmelCase							=     0.5

   for _ in range(lowerCAmelCase_   ):
      for j in range(len(lowerCAmelCase_   )   ):
         # training sample
         UpperCAmelCase							=     training_samples[j]

         # Compute the winning vector
         UpperCAmelCase							=     self_organizing_map.get_winner(lowerCAmelCase_  ,						lowerCAmelCase_   )

         # Update the winning vector
         UpperCAmelCase							=     self_organizing_map.update(lowerCAmelCase_  ,						lowerCAmelCase_  ,						lowerCAmelCase_  ,						lowerCAmelCase_   )

    # classify test sample
   UpperCAmelCase							=     [0, 0, 0, 1]
   UpperCAmelCase							=     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()



