import random




class    a__				:






     @staticmethod
     def        SCREAMING_SNAKE_CASE__       (			a		:		str   ):





         """simple docstring"""



         __lowerCamelCase          =  [ord(a_   ) for i in text]
         __lowerCamelCase          =  []
         __lowerCamelCase          =  []
         for i in plain:
             __lowerCamelCase          =  random.randint(1  ,    3_00   )
             __lowerCamelCase          =  (i + k) * k
             cipher.append(a_   )
             key.append(a_   )
         return cipher, key






     @staticmethod
     def        SCREAMING_SNAKE_CASE__       (			a		:		list[int]  ,    a		:		list[int]   ):





         """simple docstring"""



         __lowerCamelCase          =  []
         for i in range(len(a_   )   ):
             __lowerCamelCase          =  int((cipher[i] - (key[i]) ** 2) / key[i]   )
             plain.append(chr(a_   )   )
         return "".join(a_   )


if __name__ == "__main__":
  __UpperCAmelCase												=Onepad().encrypt("Hello")
  print(c, k)
  print(Onepad().decrypt(c, k))

'''simple docstring'''




from bisect import bisect
from itertools import accumulate






def __lowerCAmelCase			(							UpperCamelCase__    ,  UpperCamelCase__    ,  UpperCamelCase__    ,  UpperCamelCase__    )     ->   str:
    __lowerCamelCase          =  sorted(zip(UpperCamelCase__    ,  UpperCamelCase__    )    ,  key=lambda UpperCamelCase__    : x[0] / x[1]    ,  reverse=UpperCamelCase__    )
    __lowerCamelCase     ,  __lowerCamelCase          =  [i[0] for i in r], [i[1] for i in r]
    __lowerCamelCase          =  list(accumulate(UpperCamelCase__    )    )
    __lowerCamelCase          =  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()
