





import math




def 				snake_case_      (		SCREAMING_SNAKE_CASE__					,	SCREAMING_SNAKE_CASE__       ):







  '''simple docstring'''



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

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


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









'''simple docstring'''



import math


class       __SCREAMING_SNAKE_CASE	:



     '''simple docstring'''






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







def 				snake_case_      (		):







  '''simple docstring'''



  _snake_case     		=				[[1, 1, 0, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 0, 1, 1]]

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

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

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

      # Compute the winning vector
      _snake_case     		=				self_organizing_map.get_winner(SCREAMING_SNAKE_CASE__					,	SCREAMING_SNAKE_CASE__       )

      # Update the winning vector
      _snake_case     		=				self_organizing_map.update(SCREAMING_SNAKE_CASE__					,	SCREAMING_SNAKE_CASE__					,	SCREAMING_SNAKE_CASE__					,	SCREAMING_SNAKE_CASE__       )

    # classify test sample
  _snake_case     		=				[0, 0, 0, 1]
  _snake_case     		=				self_organizing_map.get_winner(SCREAMING_SNAKE_CASE__					,	SCREAMING_SNAKE_CASE__       )

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


