#include<cstdio>
#include<queue>
#include<algorithm>
#include<string>
#include<iostream>
using namespace std;
priority_queue<int, vector<int>, greater <int> > Q;
int main() {
string s;
while (getline(cin, s), s != "END") {
int t = 1;
sort(s.begin(),s.end());
for (int i = 1; i < s.length(); i++) {
if (s[i - 1] != s[i]) {
Q.push(t);
t = 1;
}
else t++;
}
Q.push(t);
int len1 = s.length() * 8;
int len2 = 0;
if (Q.size() != 1) {
while (Q.size() > 1) {
int num1 = Q.top();
Q.pop();
int num2 = Q.top();
Q.pop();
Q.push(num1 + num2);
len2 += num1 + num2;
}
//len2 = Q.top();
Q.pop();
}
else {
len2 = s.length();
Q.pop();
}
double res = 1.0 * len1 / len2;
printf("%d %d %.1f\n", len1, len2, res);
}
}
07-21
712
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)