def 			A__      (	snake_case_ :		Optional[int]       ,				snake_case_ :		int      ):
 SCREAMING_SNAKE_CASE__:   int=      0
 SCREAMING_SNAKE_CASE__:   Dict=      len(snake_case_      ) - 1

 while left <= right:
  # avoid divided by 0 during interpolation
  if sorted_collection[left] == sorted_collection[right]:
   if sorted_collection[left] == item:
    return left
   else:
    return None

  SCREAMING_SNAKE_CASE__:   Any=      left + ((item - sorted_collection[left]) * (right - left)) // (
      sorted_collection[right] - sorted_collection[left]
  )

  # out of range check
  if point < 0 or point >= len(snake_case_      ):
   return None

  SCREAMING_SNAKE_CASE__:   Union[str, Any]=      sorted_collection[point]
  if current_item == item:
   return point
  else:
   if point < left:
    SCREAMING_SNAKE_CASE__:   List[str]=      left
    SCREAMING_SNAKE_CASE__:   Optional[Any]=      point
   elif point > right:
    SCREAMING_SNAKE_CASE__:   Any=      right
    SCREAMING_SNAKE_CASE__:   Tuple=      point
   else:
    if item < current_item:
     SCREAMING_SNAKE_CASE__:   List[Any]=      point - 1
    else:
     SCREAMING_SNAKE_CASE__:   str=      point + 1
 return None







def 			A__      (	snake_case_ :		int       ,				snake_case_ :		Union[str, Any]       ,				snake_case_ :		List[str]       ,				snake_case_ :		List[str]      ):

 # avoid divided by 0 during interpolation
 if sorted_collection[left] == sorted_collection[right]:
  if sorted_collection[left] == item:
   return left
  else:
   return None

 SCREAMING_SNAKE_CASE__:   int=      left + ((item - sorted_collection[left]) * (right - left)) // (
     sorted_collection[right] - sorted_collection[left]
 )

 # out of range check
 if point < 0 or point >= len(snake_case_      ):
  return None

 if sorted_collection[point] == item:
  return point
 elif point < left:
  return interpolation_search_by_recursion(snake_case_       ,				snake_case_       ,				snake_case_       ,				snake_case_      )
 elif point > right:
  return interpolation_search_by_recursion(snake_case_       ,				snake_case_       ,				snake_case_       ,				snake_case_      )
 else:
  if sorted_collection[point] > item:
   return interpolation_search_by_recursion(
       snake_case_       ,				snake_case_       ,				snake_case_       ,				point - 1      )
  else:
   return interpolation_search_by_recursion(
       snake_case_       ,				snake_case_       ,				point + 1       ,				snake_case_      )







def 			A__      (	snake_case_ :		str      ):
 if collection != sorted(snake_case_      ):
  raise ValueError('''Collection must be ascending sorted'''      )
 return True


if __name__ == "__main__":
      import sys
      lowercase_     :   Optional[Any] 				=				0
      if debug == 1:
            lowercase_     :   List[str] 				=				[1_0, 3_0, 4_0, 4_5, 5_0, 6_6, 7_7, 9_3]
            try:
                  __assert_sorted(collection)
            except ValueError:
                  sys.exit('Sequence must be ascending sorted to apply interpolation search')
            lowercase_     :   Union[str, Any] 				=				6_7

      lowercase_     :   List[str] 				=				interpolation_search(collection, target)
      if result is not None:
            print(f'''{target} found at positions: {result}''')
      else:
            print('Not found')


import os







def 			A__      (	snake_case_ :		str = "matrix.txt"      ):
 with open(os.path.join(os.path.dirname(snake_case_      )       ,				snake_case_      )      ) as in_file:
  SCREAMING_SNAKE_CASE__:   Dict=      in_file.read()

 SCREAMING_SNAKE_CASE__:   Optional[int]=      [[int(snake_case_      ) for cell in row.split(''','''      )] for row in data.strip().splitlines()]
 SCREAMING_SNAKE_CASE__:   int=      [[0 for cell in row] for row in grid]
 SCREAMING_SNAKE_CASE__:   Dict=      len(grid[0]      )

 SCREAMING_SNAKE_CASE__:   Dict=      [[0 for i in range(snake_case_      )] for j in range(snake_case_      )]
 SCREAMING_SNAKE_CASE__:   Optional[int]=      grid[0][0]
 for i in range(1       ,				snake_case_      ):
  SCREAMING_SNAKE_CASE__:   Optional[int]=      grid[0][i] + dp[0][i - 1]
 for i in range(1       ,				snake_case_      ):
  SCREAMING_SNAKE_CASE__:   List[Any]=      grid[i][0] + dp[i - 1][0]

 for i in range(1       ,				snake_case_      ):
  for j in range(1       ,				snake_case_      ):
   SCREAMING_SNAKE_CASE__:   Dict=      grid[i][j] + min(dp[i - 1][j]       ,				dp[i][j - 1]      )

 return dp[-1][-1]


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

