"""simple docstring"""


from typing import SupportsIndex

import numpy as np
from scipy.ndimage import convolve







def        __a (		A     ,					A     ,					A   ):






     '''simple docstring'''



     lowercase__								=				np.stack((horizontal_flow, vertical_flow)     ,					2   )

     # Create a grid of all pixel coordinates and subtract the flow to get the
     # target pixels coordinates
     lowercase__								=				np.stack(
         np.meshgrid(np.arange(0     ,					image.shape[1]   )     ,					np.arange(0     ,					image.shape[0]   )   )     ,					2   )
     lowercase__								=				np.round(grid - flow   ).astype(np.intaa   )

     # Find the locations outside of the original image
     lowercase__								=				(grid < 0) | (grid >= np.array([image.shape[1], image.shape[0]]   ))
     lowercase__								=				0

     lowercase__								=				image[grid[:, :, 1], grid[:, :, 0]]

     # Set pixels at invalid locations to 0
     lowercase__								=				0

     return warped







def        __a (		A     ,					A     ,					A     ,					A = None     ,					):






     '''simple docstring'''



     if alpha is None:
          lowercase__								=				0.1

     # Initialize flow
     lowercase__								=				np.zeros_like(__A   )
     lowercase__								=				np.zeros_like(__A   )

     # Prepare kernels for the calculation of the derivatives and the average velocity
     lowercase__								=				np.array([[-1, 1], [-1, 1]]   ) * 0.25
     lowercase__								=				np.array([[-1, -1], [1, 1]]   ) * 0.25
     lowercase__								=				np.array([[1, 1], [1, 1]]   ) * 0.25
     lowercase__								=				np.array(
         [[1 / 12, 1 / 6, 1 / 12], [1 / 6, 0, 1 / 6], [1 / 12, 1 / 6, 1 / 12]]   )

     # Iteratively refine the flow
     for _ in range(__A   ):
          lowercase__								=				warp(__A     ,					__A     ,					__A   )
          lowercase__								=				convolve(__A     ,					__A   ) + convolve(__A     ,					__A   )
          lowercase__								=				convolve(__A     ,					__A   ) + convolve(__A     ,					__A   )
          lowercase__								=				convolve(__A     ,					__A   ) + convolve(__A     ,					-kernel_t   )

          lowercase__								=				convolve(__A     ,					__A   )
          lowercase__								=				convolve(__A     ,					__A   )

          # This updates the flow as proposed in the paper (Step 12)
          lowercase__								=				(
              derivative_x * avg_horizontal_velocity
              + derivative_y * avg_vertical_velocity
              + derivative_t
          )
          lowercase__								=				update / (alpha**2 + derivative_x**2 + derivative_y**2)

          lowercase__								=				avg_horizontal_velocity - derivative_x * update
          lowercase__								=				avg_vertical_velocity - derivative_y * update

     return horizontal_flow, vertical_flow


if __name__ == "__main__":
 import doctest

 doctest.testmod()







A__										=      10**8





def 				__a							(       __A						):
    if n % 10 == 0:
        return False
    SCREAMING_SNAKE_CASE__         =    str(__A						)
    return s == s[::-1]





def 				__a							(       ):
    SCREAMING_SNAKE_CASE__         =    set()
    SCREAMING_SNAKE_CASE__         =    1
    SCREAMING_SNAKE_CASE__         =    5
    while sum_squares < LIMIT:
        SCREAMING_SNAKE_CASE__         =    first_square + 1
        while sum_squares < LIMIT:
            if is_palindrome(__A						):
                answer.add(__A						)
            last_square += 1
            sum_squares += last_square**2
        first_square += 1
        SCREAMING_SNAKE_CASE__         =    first_square**2 + (first_square + 1) ** 2

    return sum(__A						)


if __name__ == "__main__":
  print(solution())


