





'''simple docstring'''

from __future__ import annotations

from math import ceil, floor, sqrt





def 						UpperCamelCase				(							_lowerCamelCase					:					int = 2_00_00_00       ):
    A__				=			[0]
    A__				=			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
    A__				=			0
    # the area corresponding to the grid that gives the product closest to target
    A__				=			0
    # an estimate of b, using the quadratic formula
    A__				=			42
    # the largest integer less than b_estimate
    A__				=			42
    # the largest integer less than b_estimate
    A__				=			42
    # the triangle number corresponding to b_floor
    A__				=			42
    # the triangle number corresponding to b_ceil
    A__				=			42

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

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

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

    return area


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








"""simple docstring"""







from typing import Union

import fire
import torch
from tqdm import tqdm

def 				UpperCamelCase_    (    lowerCAmelCase__      :				str    ,   lowerCAmelCase__      :				str = "cpu"    ,   lowerCAmelCase__      :				Union[str, None] = None						)						->   None:

  """simple docstring"""




  lowerCAmelCase_   :				Any								= torch.load(lowerCAmelCase__    ,   map_location=lowerCAmelCase__						)
  for k, v in tqdm(state_dict.items()						):
    if not isinstance(lowerCAmelCase__    ,   torch.Tensor						):
      raise TypeError('FP16 conversion only works on paths that are saved state dicts, like pytorch_model.bin'						)
    lowerCAmelCase_   :				str								= v.half()
  if save_path is None:  # overwrite src_path
    lowerCAmelCase_   :				Dict								= src_path
  torch.save(lowerCAmelCase__    ,   lowerCAmelCase__						)


if __name__ == "__main__":
     fire.Fire(convert)





