"注意标点符号"
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld

题目描述

"In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly used for lossless data compression. The process of finding or using such a code proceeds by means of Huffman coding, an algorithm developed by David A. Huffman while he was a Sc.D. student at MIT, and published in the 1952 paper 'A Method for the Construction of Minimum-Redundancy Codes'.

When constructing a Huffman tree, we need to know the constructed character set and the probability of occurrence of each character. A commonly used character set contains 26 English letters(Case insensitive), a pair of mysterious characters gives the frequency of occurrence of each character.

The simplest purpose for Huffman coding is to compress the text segments for network transmission.
You need to build a Huffman tree based on the frequency of each character occurrence, then output the weighted path length(WPL) of this Huffman tree.

Finally, Maplef_ Snow gave a string with an unknown meaning:skvqpzcgxjkszcrq"

输入描述:

Nothing.

输出描述:

A integer, representing the WPL of the tree, 
示例1

输入

复制
266400261802547418

输出

复制
U2FsdGVkX18xUyGDQz0fins4uZYwPhVuSzkW8rBU37O1DEiZPsHy0IyTEsARgIOMqM0Yd7ezFBb2JgROuVQe4A==

说明

The encryption algorithm for the sample output is: AES(AES($pass,$key),$pass)
(But is it really the sample output that needs decoding?)

备注:

Arcturus1350 wrote a blog a while ago