

"""simple docstring"""


import torch

from transformers import AutoTokenizer





class 					snake_case			(       A__						):

				def __init__(			self							:       Union[str, Any]  ,						UpperCamelCase__							:       Dict)->     Optional[Any]:



						'''simple docstring'''


						__lowerCAmelCase: Any					   =    AutoTokenizer.from_pretrained(_lowerCAmelCase)

				def 							lowercase_  (			self							:       str  ,						UpperCamelCase__							:       Union[str, Any])->     Optional[int]:



						'''simple docstring'''


						if isinstance(_lowerCAmelCase  ,						_lowerCAmelCase) and all(isinstance(_x  ,						_lowerCAmelCase) for _x in x):
								__lowerCAmelCase: Any					   =    None
								for l in x:
										__lowerCAmelCase: List[str]					   =    self.tokenizer(
										    _lowerCAmelCase  ,						padding="max_length"  ,						max_length=3_8_4  ,						truncation=_lowerCAmelCase  ,						return_tensors="pt"  ,						)
										__lowerCAmelCase: Optional[int]					   =    torch.tensor([len(_lowerCAmelCase)])
										if d is not None:
												for k in d.keys():
														__lowerCAmelCase: Tuple					   =    torch.cat((d[k], t[k])  ,						0)
										else:
												__lowerCAmelCase: int					   =    t

								__lowerCAmelCase: str					   =    torch.tensor(self.tokenizer.convert_tokens_to_ids("[E]"))
								__lowerCAmelCase: Tuple					   =    torch.tensor(self.tokenizer.convert_tokens_to_ids("[/E]"))

						elif isinstance(_lowerCAmelCase  ,						_lowerCAmelCase) and all(isinstance(_x  ,						_lowerCAmelCase) for _x in x):
								__lowerCAmelCase: Any					   =    self.tokenizer(
								    _lowerCAmelCase  ,						padding="max_length"  ,						max_length=3_8_4  ,						truncation=_lowerCAmelCase  ,						return_tensors="pt"  ,						)

						else:
								raise Exception(
								    "Type of parameter x was not recognized! Only `list of strings` for query or `list of lists of"
								    " strings` for supports are supported.")

						return d




				def 							lowercase_  (			self							:       Optional[int]  ,						UpperCamelCase__							:       Tuple  ,						UpperCamelCase__							:       Dict  ,						UpperCamelCase__							:       Optional[int]  ,						UpperCamelCase__							:       Dict  ,						UpperCamelCase__							:       Dict=0.70)->     Any:



						'''simple docstring'''


						__lowerCAmelCase: Union[str, Any]					   =    []
						for idx in range(len(W_query["input_ids"])):
								__lowerCAmelCase: List[str]					   =    range(p_start.shape[1])

								__lowerCAmelCase: Tuple					   =    []
								for start_id in start_indexes:
										for end_id in end_indexes:
												if start_id < end_id:
														output.append(
														    (
														        start_id,
														        end_id,
														        p_start[idx][start_id].item(),
														        p_end[idx][end_id].item(),
														    ))

								output.sort(key=lambda UpperCamelCase__: (tup[2] * tup[3])  ,						reverse=_lowerCAmelCase)
								__lowerCAmelCase: int					   =    []
								for k in range(len(_lowerCAmelCase)):
										if output[k][2] * output[k][3] >= thresh:
												__lowerCAmelCase   ,				__lowerCAmelCase: int					   =    output[k][0], output[k][1]
												__lowerCAmelCase: int					   =    self.tokenizer.decode(W_query["input_ids"][idx][c_start_pos:c_end_pos])
												temp.append((decoded, output[k][2] * output[k][3]))

								final_outputs.append(_lowerCAmelCase)

						return final_outputs





"""simple docstring"""


def 					a__					(					__SCREAMING_SNAKE_CASE = 1_0_0_0				)			->			int:
		__lowerCAmelCase: int					   =    0
		__lowerCAmelCase: Optional[int]					   =    0
		while 1:
				num += 3
				if num >= n:
						break
				total += num
				num += 2
				if num >= n:
						break
				total += num
				num += 1
				if num >= n:
						break
				total += num
				num += 3
				if num >= n:
						break
				total += num
				num += 1
				if num >= n:
						break
				total += num
				num += 2
				if num >= n:
						break
				total += num
				num += 3
				if num >= n:
						break
				total += num
		return total


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


