






def 					SCREAMING_SNAKE_CASE    (			snake_case_ :							int = 100       ):
 snake_case__			:				str       =  (n * (n + 1) // 2) ** 2
 snake_case__			:				int       =  n * (n + 1) * (2 * n + 1) // 6
 return sum_cubes - sum_squares


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 rescale, resize, to_channel_dimension_format
from ...image_utils import (
    ChannelDimension,
    ImageInput,
    PILImageResampling,
    make_list_of_images,
    to_numpy_array,
    valid_images,
)
from ...utils import TensorType, is_vision_available, logging


if is_vision_available():
	import PIL


__lowerCamelCase :      int										=				logging.get_logger(__name__)







def 					SCREAMING_SNAKE_CASE    (			snake_case_ :							int					,  snake_case_ :							Any       ):
	snake_case__			:				List[str]       =  b.T
	snake_case__			:				Union[str, Any]       =  np.sum(np.square(snake_case_       )					,  axis=1       )
	snake_case__			:				Dict       =  np.sum(np.square(snake_case_       )					,  axis=0       )
	snake_case__			:				Dict       =  np.matmul(snake_case_					,  snake_case_       )
	snake_case__			:				Any       =  aa[:, None] - 2 * ab + ba[None, :]
	return d







def 					SCREAMING_SNAKE_CASE    (			snake_case_ :							Optional[int]					,  snake_case_ :							Tuple       ):
	snake_case__			:				Tuple       =  x.reshape(-1					,  3       )
	snake_case__			:				int       =  squared_euclidean_distance(snake_case_					,  snake_case_       )
	return np.argmin(snake_case_					,  axis=1       )





class 							SCREAMING_SNAKE_CASE__						(    UpperCamelCase_						):





					"""simple docstring"""






					a_     =		["pixel_values"]



					def __init__( self					:  str							,		__A					:  Optional[Union[List[List[int]], np.ndarray]] = None							,		__A					:  bool = True							,		__A					:  Dict[str, int] = None							,		__A					:  PILImageResampling = PILImageResampling.BILINEAR							,		__A					:  bool = True							,		__A					:  bool = True							,		**__A					:  Union[str, Any]							,		):
						super().__init__(**__A	)
						snake_case__			:				Optional[int]       =  size if size is not None else {"height": 2_5_6, "width": 2_5_6}
						snake_case__			:				List[Any]       =  get_size_dict(__A	)
						snake_case__			:				Any       =  np.array(__A	) if clusters is not None else None
						snake_case__			:				Optional[Any]       =  do_resize
						snake_case__			:				Any       =  size
						snake_case__			:				List[Any]       =  resample
						snake_case__			:				List[Any]       =  do_normalize
						snake_case__			:				Dict       =  do_color_quantize



					def 	_lowercase					( self					:  List[Any]							,		__A					:  np.ndarray							,		__A					:  Dict[str, int]							,		__A					:  PILImageResampling = PILImageResampling.BILINEAR							,		__A					:  Optional[Union[str, ChannelDimension]] = None							,		**__A					:  int							,		):
						snake_case__			:				List[Any]       =  get_size_dict(__A	)
						if "height" not in size or "width" not in size:
							raise ValueError(f'''Size dictionary must contain both height and width keys. Got {size.keys()}'''	)
						return resize(
						    __A							,		size=(size["height"], size["width"])							,		resample=__A							,		data_format=__A							,		**__A	)



					def 	_lowercase					( self					:  List[Any]							,		__A					:  np.ndarray							,		__A					:  Optional[Union[str, ChannelDimension]] = None							,		):
						snake_case__			:				List[str]       =  rescale(image=__A							,		scale=1 / 1_2_7.5							,		data_format=__A	)
						snake_case__			:				List[Any]       =  image - 1
						return image






					def 	_lowercase					( self					:  Dict							,		__A					:  ImageInput							,		__A					:  bool = None							,		__A					:  Dict[str, int] = None							,		__A					:  PILImageResampling = None							,		__A					:  bool = None							,		__A					:  Optional[bool] = None							,		__A					:  Optional[Union[List[List[int]], np.ndarray]] = None							,		__A					:  Optional[Union[str, TensorType]] = None							,		__A					:  Optional[Union[str, ChannelDimension]] = ChannelDimension.FIRST							,		**__A					:  Optional[int]							,		):
						snake_case__			:				Any       =  do_resize if do_resize is not None else self.do_resize
						snake_case__			:				Union[str, Any]       =  size if size is not None else self.size
						snake_case__			:				Union[str, Any]       =  get_size_dict(__A	)
						snake_case__			:				Optional[Any]       =  resample if resample is not None else self.resample
						snake_case__			:				Tuple       =  do_normalize if do_normalize is not None else self.do_normalize
						snake_case__			:				Optional[Any]       =  do_color_quantize if do_color_quantize is not None else self.do_color_quantize
						snake_case__			:				Union[str, Any]       =  clusters if clusters is not None else self.clusters
						snake_case__			:				Union[str, Any]       =  np.array(__A	)

						snake_case__			:				Any       =  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 or resample is None:
							raise ValueError("Size and resample must be specified if do_resize is True."	)

						if do_color_quantize and clusters is None:
							raise ValueError("Clusters must be specified if do_color_quantize is True."	)

						# All transformations expect numpy arrays.
						snake_case__			:				Optional[Any]       =  [to_numpy_array(__A	) for image in images]

						if do_resize:
							snake_case__			:				List[str]       =  [self.resize(image=__A							,		size=__A							,		resample=__A	) for image in images]

						if do_normalize:
							snake_case__			:				Union[str, Any]       =  [self.normalize(image=__A	) for image in images]

						if do_color_quantize:
							snake_case__			:				int       =  [to_channel_dimension_format(__A							,		ChannelDimension.LAST	) for image in images]
							# color quantize from (batch_size, height, width, 3) to (batch_size, height, width)
							snake_case__			:				int       =  np.array(__A	)
							snake_case__			:				Dict       =  color_quantize(__A							,		__A	).reshape(images.shape[:-1]	)

							# flatten to (batch_size, height*width)
							snake_case__			:				str       =  images.shape[0]
							snake_case__			:				str       =  images.reshape(__A							,		-1	)

							# We need to convert back to a list of images to keep consistent behaviour across processors.
							snake_case__			:				Union[str, Any]       =  list(__A	)
						else:
							snake_case__			:				Any       =  [to_channel_dimension_format(__A							,		__A	) for image in images]

						snake_case__			:				Optional[int]       =  {"input_ids": images}
						return BatchFeature(data=__A							,		tensor_type=__A	)



