




from bisect import bisect
from itertools import accumulate



def      __lowerCAmelCase			(					UpperCamelCase	,      UpperCamelCase	,      UpperCamelCase	,      UpperCamelCase      )     ->	Optional[Any]:
  lowerCAmelCase__				:  Tuple		       =     sorted(zip(UpperCamelCase	,      UpperCamelCase      )	,      key=lambda UpperCamelCase      : x[0] / x[1]	,      reverse=UpperCamelCase      )
  lowerCAmelCase__       ,			lowerCAmelCase__				:  int		       =     [i[0] for i in r], [i[1] for i in r]
  lowerCAmelCase__				:  List[Any]		       =     list(accumulate(UpperCamelCase      )      )
  lowerCAmelCase__				:  Dict		       =     bisect(UpperCamelCase	,      UpperCamelCase      )
  return (
      0
      if k == 0
      else sum(vl[:k]      ) + (w - acc[k - 1]) * (vl[k]) / (wt[k])
      if k != n
      else sum(vl[:k]      )
  )


if __name__ == "__main__":
     import doctest

     doctest.testmod()







from collections import Counter
from timeit import timeit



def      __lowerCAmelCase			(					UpperCamelCase = ""	,      )     ->	bool:
  return sum(c % 2 for c in Counter(input_str.replace(''' '''	,      ''''''      ).lower()      ).values()      ) < 2



def      __lowerCAmelCase			(					UpperCamelCase = ""      )     ->	bool:
  if len(UpperCamelCase      ) == 0:
    return True
  lowerCAmelCase__				:  str		       =     input_str.replace(''' '''	,      ''''''      ).lower()
  # character_freq_dict: Stores the frequency of every character in the input string
  lowerCAmelCase__				:  dict[str, int]		       =     {}

  for character in lower_case_input_str:
    lowerCAmelCase__				:  int		       =     character_freq_dict.get(UpperCamelCase	,      0      ) + 1
  lowerCAmelCase__				:  Any		       =     0

  for character_count in character_freq_dict.values():
    if character_count % 2:
      odd_char += 1
  if odd_char > 1:
    return False
  return True



def      __lowerCAmelCase			(					UpperCamelCase = ""      )     ->	None:
  print('''\nFor string = '''	,      UpperCamelCase	,      ''':'''      )
  print(
      '''> can_string_be_rearranged_as_palindrome_counter()'''	,      '''\tans ='''	,      can_string_be_rearranged_as_palindrome_counter(UpperCamelCase      )	,      '''\ttime ='''	,      timeit(
          '''z.can_string_be_rearranged_as_palindrome_counter(z.check_str)'''	,      setup='''import __main__ as z'''	,      )	,      '''seconds'''	,      )
  print(
      '''> can_string_be_rearranged_as_palindrome()'''	,      '''\tans ='''	,      can_string_be_rearranged_as_palindrome(UpperCamelCase      )	,      '''\ttime ='''	,      timeit(
          '''z.can_string_be_rearranged_as_palindrome(z.check_str)'''	,      setup='''import __main__ as z'''	,      )	,      '''seconds'''	,      )


if __name__ == "__main__":
     lowerCAmelCase_					    = input(
         """Enter string to determine if it can be rearranged as a palindrome or not: """
     ).strip()
     benchmark(check_str)
     lowerCAmelCase_					    = can_string_be_rearranged_as_palindrome_counter(check_str)
     print(F"""{check_str} can {"" if status else "not "}be rearranged as a palindrome""")

