"""simple docstring"""






import copy
import random

from transformers import CLIPTokenizer
class        snake_case (				__UpperCAmelCase       ):




					"""simple docstring"""

					def __init__(       self     :			int					,*lowerCamelCase__     :			int					,**lowerCamelCase__     :			str    ):
									super().__init__(*lowerCamelCase__					,**lowerCamelCase__    )
									UpperCAmelCase__    =							{}







					def 	__lowerCAmelCase		(       self     :			List[str]					,lowerCamelCase__     :			Optional[int]					,*lowerCamelCase__     :			str					,**lowerCamelCase__     :			Tuple    ):
									UpperCAmelCase__    =							super().add_tokens(lowerCamelCase__					,*lowerCamelCase__					,**lowerCamelCase__    )
									if num_added_tokens == 0:
													raise ValueError(
													    f'''The tokenizer already contains the token {placeholder_token}. Please pass a different'''
													    ' `placeholder_token` that is not already in the tokenizer.'    )







					def 	__lowerCAmelCase		(       self     :			Dict					,lowerCamelCase__     :			Dict					,*lowerCamelCase__     :			Union[str, Any]					,lowerCamelCase__     :			str=1					,**lowerCamelCase__     :			Tuple    ):
									UpperCAmelCase__    =							[]
									if num_vec_per_token == 1:
													self.try_adding_tokens(lowerCamelCase__					,*lowerCamelCase__					,**lowerCamelCase__    )
													output.append(lowerCamelCase__    )
									else:
													UpperCAmelCase__    =							[]
													for i in range(lowerCamelCase__    ):
																	UpperCAmelCase__    =							placeholder_token + f'''_{i}'''
																	self.try_adding_tokens(lowerCamelCase__					,*lowerCamelCase__					,**lowerCamelCase__    )
																	output.append(lowerCamelCase__    )
        # handle cases where there is a new placeholder token that contains the current placeholder token but is larger
									for token in self.token_map:
													if token in placeholder_token:
																	raise ValueError(
																	    f'''The tokenizer already has placeholder token {token} that can get confused with'''
																	    f''' {placeholder_token}keep placeholder tokens independent'''    )
									UpperCAmelCase__    =							output







					def 	__lowerCAmelCase		(       self     :			Optional[int]					,lowerCamelCase__     :			Optional[int]					,lowerCamelCase__     :			Any=False					,lowerCamelCase__     :			int=1.0    ):
									if isinstance(lowerCamelCase__					,lowerCamelCase__    ):
													UpperCAmelCase__    =							[]
													for i in range(len(lowerCamelCase__    )    ):
																	output.append(self.replace_placeholder_tokens_in_text(text[i]					,vector_shuffle=lowerCamelCase__    )    )
													return output
									for placeholder_token in self.token_map:
													if placeholder_token in text:
																	UpperCAmelCase__    =							self.token_map[placeholder_token]
																	UpperCAmelCase__    =							tokens[: 1 + int(len(lowerCamelCase__    ) * prop_tokens_to_load    )]
																	if vector_shuffle:
																					UpperCAmelCase__    =							copy.copy(lowerCamelCase__    )
																					random.shuffle(lowerCamelCase__    )
																	UpperCAmelCase__    =							text.replace(lowerCamelCase__					,' '.join(lowerCamelCase__    )    )
									return text







					def __call__(       self     :			Tuple					,lowerCamelCase__     :			List[str]					,*lowerCamelCase__     :			int					,lowerCamelCase__     :			Tuple=False					,lowerCamelCase__     :			Optional[int]=1.0					,**lowerCamelCase__     :			int    ):
									return super().__call__(
									    self.replace_placeholder_tokens_in_text(
									        lowerCamelCase__					,vector_shuffle=lowerCamelCase__					,prop_tokens_to_load=lowerCamelCase__    )					,*lowerCamelCase__					,**lowerCamelCase__					,)







					def 	__lowerCAmelCase		(       self     :			Optional[int]					,lowerCamelCase__     :			Optional[int]					,*lowerCamelCase__     :			Union[str, Any]					,lowerCamelCase__     :			Optional[int]=False					,lowerCamelCase__     :			Union[str, Any]=1.0					,**lowerCamelCase__     :			Dict    ):
									return super().encode(
									    self.replace_placeholder_tokens_in_text(
									        lowerCamelCase__					,vector_shuffle=lowerCamelCase__					,prop_tokens_to_load=lowerCamelCase__    )					,*lowerCamelCase__					,**lowerCamelCase__					,)




"""simple docstring"""






from __future__ import annotations

from math import ceil, floor, sqrt



def 						a_		(      lowerCamelCase = 2_0_0_0_0_0_0 ):
				UpperCAmelCase__    =							[0]
				UpperCAmelCase__    =							42

				for idx in range(1      ,    ceil(sqrt(target * 2 ) * 1.1 ) ):
								triangle_numbers.append(triangle_numbers[-1] + idx )

				# we want this to be as close as possible to target
				UpperCAmelCase__    =							0
				# the area corresponding to the grid that gives the product closest to target
				UpperCAmelCase__    =							0
				# an estimate of b, using the quadratic formula
				UpperCAmelCase__    =							42
				# the largest integer less than b_estimate
				UpperCAmelCase__    =							42
				# the largest integer less than b_estimate
				UpperCAmelCase__    =							42
				# the triangle number corresponding to b_floor
				UpperCAmelCase__    =							42
				# the triangle number corresponding to b_ceil
				UpperCAmelCase__    =							42

				for idx_a, triangle_a in enumerate(triangle_numbers[1:]      ,    1 ):
								UpperCAmelCase__    =							(-1 + sqrt(1 + 8 * target / triangle_a )) / 2
								UpperCAmelCase__    =							floor(lowerCamelCase )
								UpperCAmelCase__    =							ceil(lowerCamelCase )
								UpperCAmelCase__    =							triangle_numbers[b_floor]
								UpperCAmelCase__    =							triangle_numbers[b_ceil]

								if abs(target - triangle_b_first_guess * triangle_a ) < abs(
								    target - best_product ):
												UpperCAmelCase__    =							triangle_b_first_guess * triangle_a
												UpperCAmelCase__    =							idx_a * b_floor

								if abs(target - triangle_b_second_guess * triangle_a ) < abs(
								    target - best_product ):
												UpperCAmelCase__    =							triangle_b_second_guess * triangle_a
												UpperCAmelCase__    =							idx_a * b_ceil

				return area


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



