

from collections import defaultdict
from math import ceil, sqrt

def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   int = 1_000_000     ,					SCREAMING_SNAKE_CASE_		:   int = 10      ):



     '''simple docstring'''





     lowercase__   :       defaultdict				=	defaultdict(lowerCAmelCase__      )

     for outer_width in range(3     ,					(t_limit // 4) + 2      ):
          if outer_width * outer_width > t_limit:
               lowercase__   :       int				=	max(
                   ceil(sqrt(outer_width * outer_width - t_limit      )      )     ,					1      )
          else:
               lowercase__   :       Optional[Any]				=	1

          hole_width_lower_bound += (outer_width - hole_width_lower_bound) % 2

          for hole_width in range(lowerCAmelCase__     ,					outer_width - 1     ,					2      ):
               count[outer_width * outer_width - hole_width * hole_width] += 1

     return sum(1 for n in count.values() if 1 <= n <= 10      )


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




from typing import Dict, List, Optional, Union

import numpy as np

from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
from ...image_transforms import (
    center_crop,
    convert_to_rgb,
    get_resize_output_image_size,
    normalize,
    rescale,
    resize,
    to_channel_dimension_format,
)
from ...image_utils import (
    OPENAI_CLIP_MEAN,
    OPENAI_CLIP_STD,
    ChannelDimension,
    ImageInput,
    PILImageResampling,
    make_list_of_images,
    to_numpy_array,
    valid_images,
)
from ...utils import TensorType, is_vision_available, logging


snake_case_        =			logging.get_logger(__name__)


if is_vision_available():
       import PIL


class 				SCREAMING_SNAKE_CASE__ (__snake_case					):
    __lowerCamelCase						:	Optional[Any]														=					["""pixel_values"""]





    def __init__(				self						,       a = True						,       a = None						,       a = PILImageResampling.BICUBIC						,       a = True						,       a = None						,       a = True						,       a = 1 / 255						,       a = True						,       a = None						,       a = None						,       a = True						,       **a						,       ):
         super().__init__(**a)
         lowercase__   :       List[str]				=	size if size is not None else {'shortest_edge': 224}
         lowercase__   :       str				=	get_size_dict(a						,       default_to_square=a)
         lowercase__   :       Optional[int]				=	crop_size if crop_size is not None else {'height': 224, 'width': 224}
         lowercase__   :       Union[str, Any]				=	get_size_dict(a						,       default_to_square=a						,       param_name='crop_size')

         lowercase__   :       List[str]				=	do_resize
         lowercase__   :       List[Any]				=	size
         lowercase__   :       Tuple				=	resample
         lowercase__   :       int				=	do_center_crop
         lowercase__   :       Union[str, Any]				=	crop_size
         lowercase__   :       int				=	do_rescale
         lowercase__   :       List[str]				=	rescale_factor
         lowercase__   :       Tuple				=	do_normalize
         lowercase__   :       str				=	image_mean if image_mean is not None else OPENAI_CLIP_MEAN
         lowercase__   :       Optional[Any]				=	image_std if image_std is not None else OPENAI_CLIP_STD
         lowercase__   :       List[Any]				=	do_convert_rgb





    def 				snake_case_    (				self						,       a						,       a						,       a = PILImageResampling.BICUBIC						,       a = None						,       **a						,       ):
         lowercase__   :       str				=	get_size_dict(a						,       default_to_square=a)
         if "shortest_edge" not in size:
              raise ValueError(f"""The `size` parameter must contain the key `shortest_edge`. Got {size.keys()}""")
         lowercase__   :       str				=	get_resize_output_image_size(a						,       size=size['shortest_edge']						,       default_to_square=a)
         return resize(a						,       size=a						,       resample=a						,       data_format=a						,       **a)





    def 				snake_case_    (				self						,       a						,       a						,       a = None						,       **a						,       ):
         lowercase__   :       List[str]				=	get_size_dict(a)
         if "height" not in size or "width" not in size:
              raise ValueError(f"""The `size` parameter must contain the keys (height, width). Got {size.keys()}""")
         return center_crop(a						,       size=(size['height'], size['width'])						,       data_format=a						,       **a)





    def 				snake_case_    (				self						,       a						,       a						,       a = None						,       **a						,       ):
         return rescale(a						,       scale=a						,       data_format=a						,       **a)





    def 				snake_case_    (				self						,       a						,       a						,       a						,       a = None						,       **a						,       ):
         return normalize(a						,       mean=a						,       std=a						,       data_format=a						,       **a)





    def 				snake_case_    (				self						,       a						,       a = None						,       a = None						,       a = None						,       a = None						,       a = None						,       a = None						,       a = None						,       a = None						,       a = None						,       a = None						,       a = None						,       a = None						,       a = ChannelDimension.FIRST						,       **a						,       ):
         lowercase__   :       int				=	do_resize if do_resize is not None else self.do_resize
         lowercase__   :       Tuple				=	size if size is not None else self.size
         lowercase__   :       Union[str, Any]				=	get_size_dict(a						,       param_name='size'						,       default_to_square=a)
         lowercase__   :       Optional[Any]				=	resample if resample is not None else self.resample
         lowercase__   :       int				=	do_center_crop if do_center_crop is not None else self.do_center_crop
         lowercase__   :       List[Any]				=	crop_size if crop_size is not None else self.crop_size
         lowercase__   :       Union[str, Any]				=	get_size_dict(a						,       param_name='crop_size'						,       default_to_square=a)
         lowercase__   :       Dict				=	do_rescale if do_rescale is not None else self.do_rescale
         lowercase__   :       int				=	rescale_factor if rescale_factor is not None else self.rescale_factor
         lowercase__   :       List[str]				=	do_normalize if do_normalize is not None else self.do_normalize
         lowercase__   :       Optional[Any]				=	image_mean if image_mean is not None else self.image_mean
         lowercase__   :       List[str]				=	image_std if image_std is not None else self.image_std
         lowercase__   :       Any				=	do_convert_rgb if do_convert_rgb is not None else self.do_convert_rgb

         lowercase__   :       str				=	make_list_of_images(a)

         if not valid_images(a):
              raise ValueError(
                  'Invalid image type. Must be of type PIL.Image.Image, numpy.ndarray, '
                  'torch.Tensor, tf.Tensor or jax.ndarray.')

         if do_resize and size is None:
              raise ValueError('Size must be specified if do_resize is True.')

         if do_center_crop and crop_size is None:
              raise ValueError('Crop size must be specified if do_center_crop is True.')

         if do_rescale and rescale_factor is None:
              raise ValueError('Rescale factor must be specified if do_rescale is True.')

         if do_normalize and (image_mean is None or image_std is None):
              raise ValueError('Image mean and std must be specified if do_normalize is True.')

         # PIL RGBA images are converted to RGB
         if do_convert_rgb:
              lowercase__   :       str				=	[convert_to_rgb(a) for image in images]

         # All transformations expect numpy arrays.
         lowercase__   :       Dict				=	[to_numpy_array(a) for image in images]

         if do_resize:
              lowercase__   :       Tuple				=	[self.resize(image=a						,       size=a						,       resample=a) for image in images]

         if do_center_crop:
              lowercase__   :       List[str]				=	[self.center_crop(image=a						,       size=a) for image in images]

         if do_rescale:
              lowercase__   :       str				=	[self.rescale(image=a						,       scale=a) for image in images]

         if do_normalize:
              lowercase__   :       Tuple				=	[self.normalize(image=a						,       mean=a						,       std=a) for image in images]

         lowercase__   :       Optional[int]				=	[to_channel_dimension_format(a						,       a) for image in images]

         lowercase__   :       Dict				=	{'pixel_values': images}
         return BatchFeature(data=a						,       tensor_type=a)

