PROGRAMMING:Constructing Huffman tree
Input some words and their frequency, construct a Huffman tree, and output the average code length of Huffman code.
###Input format:
Input n, it means there are n words, the following N lines, each line represents a word and its frequency.
###Output format:
The average code length is represented by floating-point type, with 5 decimal places reserved.
###Input example:
Here is a set of inputs. For example:
```in
eleven
The 1192
of 677
a 541
to 518
and 462
that 242
he 195
is 190
for 157
His 138
are 124
```
###Output example:
The corresponding output is given here. For example:
```out
three point one zero four three seven
```
answer:If there is no answer, please comment
###Input format:
Input n, it means there are n words, the following N lines, each line represents a word and its frequency.
###Output format:
The average code length is represented by floating-point type, with 5 decimal places reserved.
###Input example:
Here is a set of inputs. For example:
```in
eleven
The 1192
of 677
a 541
to 518
and 462
that 242
he 195
is 190
for 157
His 138
are 124
```
###Output example:
The corresponding output is given here. For example:
```out
three point one zero four three seven
```
answer:If there is no answer, please comment