



"""simple docstring"""
_lowerCAmelCase       :Optional[int]	=   {
    'joule': 1.0,
    'kilojoule': 1_000,
    'megajoule': 1_000_000,
    'gigajoule': 1_000_000_000,
    'wattsecond': 1.0,
    'watthour': 3_600,
    'kilowatthour': 3_600_000,
    'newtonmeter': 1.0,
    'calorie_nutr': 4_186.8,
    'kilocalorie_nutr': 4_186_800.00,
    'electronvolt': 1.602_176_634E-19,
    'britishthermalunit_it': 1_055.05_585,
    'footpound': 1.355818,
}





def 					lowerCamelCase_		(UpperCamelCase__						:						str	,			UpperCamelCase__						:						str	,			UpperCamelCase__						:						float				):
    if to_type not in ENERGY_CONVERSION or from_type not in ENERGY_CONVERSION:
        _UpperCAmelCase				:    Dict											=       (
            F'Incorrect \'from_type\' or \'to_type\' value: {from_type!r}, {to_type!r}\n'
            F'Valid values are: {", ".join(_UpperCamelCase				)}'
        )
        raise ValueError(_UpperCamelCase				)
    return value * ENERGY_CONVERSION[from_type] / ENERGY_CONVERSION[to_type]


if __name__ == "__main__":
  import doctest

  doctest.testmod()







from __future__ import annotations

from math import ceil, floor, sqrt





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

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

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

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

   return area


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






