




import numpy as np
from cva import destroyAllWindows, imread, imshow, waitKey





class 			lowerCamelCase_				:


 '''simple docstring'''







 def __init__(				self    :						str							,							_lowerCAmelCase    :						Tuple							,							_lowerCAmelCase    :						int							,							_lowerCAmelCase    :						int		):
       if dst_width < 0 or dst_height < 0:
             raise ValueError('Destination width/height should be > 0'		)

       SCREAMING_SNAKE_CASE_      		=     img
       SCREAMING_SNAKE_CASE_      		=     img.shape[1]
       SCREAMING_SNAKE_CASE_      		=     img.shape[0]
       SCREAMING_SNAKE_CASE_      		=     dst_width
       SCREAMING_SNAKE_CASE_      		=     dst_height

       SCREAMING_SNAKE_CASE_      		=     self.src_w / self.dst_w
       SCREAMING_SNAKE_CASE_      		=     self.src_h / self.dst_h

       SCREAMING_SNAKE_CASE_      		=     SCREAMING_SNAKE_CASE_      		=     (
           np.ones((self.dst_h, self.dst_w, 3)							,							np.uinta		) * 255
       )



 def  lowerCAmelCase_    (				self    :						Optional[int]		):
       for i in range(self.dst_h		):
             for j in range(self.dst_w		):
                   SCREAMING_SNAKE_CASE_      		=     self.img[self.get_y(_lowerCAmelCase		)][self.get_x(_lowerCAmelCase		)]



 def  lowerCAmelCase_    (				self    :						str							,							_lowerCAmelCase    :						int		):
       return int(self.ratio_x * x		)




 def  lowerCAmelCase_    (				self    :						Tuple							,							_lowerCAmelCase    :						int		):
       return int(self.ratio_y * y		)


if __name__ == "__main__":
   lowerCamelCase__							,				lowerCamelCase__					:  Optional[int]      							=				800, 600
   lowerCamelCase__					:  Any      							=				imread('image_data/lena.jpg', 1)
   lowerCamelCase__					:  List[str]      							=				NearestNeighbour(im, dst_w, dst_h)
   n.process()

   imshow(
       f'''Image resized from: {im.shape[1]}x{im.shape[0]} to {dst_w}x{dst_h}''', n.output
   )
   waitKey(0)
   destroyAllWindows()





from __future__ import annotations

from collections.abc import Generator

def    UpperCAmelCase_				( )   ->					Generator[int, None, None]:
      SCREAMING_SNAKE_CASE_      		=     {}
      SCREAMING_SNAKE_CASE_      		=     2
      while True:
            SCREAMING_SNAKE_CASE_      		=     factor_map.pop(__UpperCAmelCase     ,     __UpperCAmelCase				)
            if factor:
                  SCREAMING_SNAKE_CASE_      		=     factor + prime
                  while x in factor_map:
                        x += factor
                  SCREAMING_SNAKE_CASE_      		=     factor
            else:
                  SCREAMING_SNAKE_CASE_      		=     prime
                  yield prime
            prime += 1

def    UpperCAmelCase_				( __UpperCAmelCase		:      float = 1E10				)   ->					int:
      SCREAMING_SNAKE_CASE_      		=     sieve()

      SCREAMING_SNAKE_CASE_      		=     1
      while True:
            SCREAMING_SNAKE_CASE_      		=     next(__UpperCAmelCase				)
            if (2 * prime * n) > limit:
                  return n
            # Ignore the next prime as the reminder will be 2.
            next(__UpperCAmelCase				)
            n += 2


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