

from __future__ import annotations

from cmath import sqrt



def   __UpperCAmelCase					(      __a :     int						,__a :     int						,__a :     int      )     ->	tuple[complex, complex]:

					"""simple docstring"""

					if a == 0:
										raise ValueError('''Coefficient \'a\' must not be zero.'''      )
					_a      :       Dict   =						b * b - 4 * a * c

					_a      :       Union[str, Any]   =						(-b + sqrt(__a      )) / (2 * a)
					_a      :       Optional[int]   =						(-b - sqrt(__a      )) / (2 * a)

					return (
					    root_a.real if not root_a.imag else root_a,
					    root_a.real if not root_a.imag else root_a,
					)



def   __UpperCAmelCase					(      )     ->	List[str]:

					"""simple docstring"""

					_a ,   _a      :       Optional[int]   =						quadratic_roots(a=5						,b=6						,c=1      )
					print(F"""The solutions are: {solutiona} and {solutiona}"""      )


if __name__ == "__main__":
			main()






'''simple docstring'''



UpperCAmelCase					:			Tuple       =	range(2, 2_0 + 1)
UpperCAmelCase					:			int       =	[1_0**k for k in range(ks[-1] + 1)]
UpperCAmelCase					:			dict[int, dict[int, list[list[int]]]]       =	{}







def   a__			(    a__ ,       a__ ,       a__ ,       a__		):




     """simple docstring"""


     __SCREAMING_SNAKE_CASE      = sum(a_i[j] for j in range(a__ ,       len(a__		)		)		)
     __SCREAMING_SNAKE_CASE      = sum(a_i[j] * base[j] for j in range(min(len(a__		) ,       a__		)		)		)

     __SCREAMING_SNAKE_CASE  ,     __SCREAMING_SNAKE_CASE      = 0, 0
     __SCREAMING_SNAKE_CASE      = n - i

     __SCREAMING_SNAKE_CASE      = memo.get(a__		)

     if sub_memo is not None:
          __SCREAMING_SNAKE_CASE      = sub_memo.get(a__		)

          if jumps is not None and len(a__		) > 0:
               # find and make the largest jump without going over
               __SCREAMING_SNAKE_CASE      = -1
               for _k in range(len(a__		) - 1 ,       -1 ,       -1		):
                    if jumps[_k][2] <= k and jumps[_k][1] <= max_dn:
                         __SCREAMING_SNAKE_CASE      = _k
                         break

               if max_jump >= 0:
                    __SCREAMING_SNAKE_CASE  ,     __SCREAMING_SNAKE_CASE  ,     __SCREAMING_SNAKE_CASE      = jumps[max_jump]
                    # since the difference between jumps is cached, add c
                    __SCREAMING_SNAKE_CASE      = diff + c
                    for j in range(min(a__ ,       len(a__		)		)		):
                         __SCREAMING_SNAKE_CASE  ,     __SCREAMING_SNAKE_CASE      = divmod(a__ ,       10		)
                    if new_c > 0:
                         add(a__ ,       a__ ,       a__		)

          else:
               __SCREAMING_SNAKE_CASE      = []
     else:
          __SCREAMING_SNAKE_CASE      = {c: []}
          __SCREAMING_SNAKE_CASE      = sub_memo

     if dn >= max_dn or c + diff >= base[k]:
          return diff, dn

     if k > ks[0]:
          while True:
               # keep doing smaller jumps
               __SCREAMING_SNAKE_CASE  ,     __SCREAMING_SNAKE_CASE      = next_term(a__ ,       k - 1 ,       i + dn ,       a__		)
               diff += _diff
               dn += terms_jumped

               if dn >= max_dn or c + diff >= base[k]:
                    break
     else:
          # would be too small a jump, just compute sequential terms instead
          __SCREAMING_SNAKE_CASE  ,     __SCREAMING_SNAKE_CASE      = compute(a__ ,       a__ ,       i + dn ,       a__		)
          diff += _diff
          dn += terms_jumped

     __SCREAMING_SNAKE_CASE      = sub_memo[c]

     # keep jumps sorted by # of terms skipped
     __SCREAMING_SNAKE_CASE      = 0
     while j < len(a__		):
          if jumps[j][1] > dn:
               break
          j += 1

     # cache the jump for this value digitsum(b) and c
     sub_memo[c].insert(a__ ,       (diff, dn, k)		)
     return (diff, dn)







def   a__			(    a__ ,       a__ ,       a__ ,       a__		):




     """simple docstring"""


     if i >= n:
          return 0, i
     if k > len(a__		):
          a_i.extend([0 for _ in range(k - len(a__		)		)]		)

     # note: a_i -> b * 10^k + c
     # ds_b -> digitsum(b)
     # ds_c -> digitsum(c)
     __SCREAMING_SNAKE_CASE      = i
     __SCREAMING_SNAKE_CASE  ,     __SCREAMING_SNAKE_CASE  ,     __SCREAMING_SNAKE_CASE      = 0, 0, 0
     for j in range(len(a__		)		):
          if j >= k:
               ds_b += a_i[j]
          else:
               ds_c += a_i[j]

     while i < n:
          i += 1
          __SCREAMING_SNAKE_CASE      = ds_c + ds_b
          diff += addend
          __SCREAMING_SNAKE_CASE      = 0
          for j in range(a__		):
               __SCREAMING_SNAKE_CASE      = a_i[j] + addend
               __SCREAMING_SNAKE_CASE  ,     __SCREAMING_SNAKE_CASE      = divmod(a__ ,       10		)

               ds_c += a_i[j]

          if addend > 0:
               break

     if addend > 0:
          add(a__ ,       a__ ,       a__		)
     return diff, i - start_i







def   a__			(    a__ ,       a__ ,       a__		):




     """simple docstring"""


     for j in range(a__ ,       len(a__		)		):
          __SCREAMING_SNAKE_CASE      = digits[j] + addend
          if s >= 10:
               __SCREAMING_SNAKE_CASE  ,     __SCREAMING_SNAKE_CASE      = divmod(a__ ,       10		)
               __SCREAMING_SNAKE_CASE      = addend // 10 + quotient
          else:
               __SCREAMING_SNAKE_CASE      = s
               __SCREAMING_SNAKE_CASE      = addend // 10

          if addend == 0:
               break

     while addend > 0:
          __SCREAMING_SNAKE_CASE  ,     __SCREAMING_SNAKE_CASE      = divmod(a__ ,       10		)
          digits.append(a__		)







def   a__			(    a__ = 10**15		):




     """simple docstring"""


     __SCREAMING_SNAKE_CASE      = [1]
     __SCREAMING_SNAKE_CASE      = 1
     __SCREAMING_SNAKE_CASE      = 0
     while True:
          __SCREAMING_SNAKE_CASE  ,     __SCREAMING_SNAKE_CASE      = next_term(a__ ,       20 ,       i + dn ,       a__		)
          dn += terms_jumped
          if dn == n - i:
               break

     __SCREAMING_SNAKE_CASE      = 0
     for j in range(len(a__		)		):
          a_n += digits[j] * 10**j
     return a_n


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






