#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> mark[i] >> coin[i]; } map mp[3]; ll L[3]; FOR(col, 0, 3){ ll N; cin >> N; L[col] = N; FOR(i, 0, N){ string s; cin >> s; mp[col][s]++; } } vector num(5); // 何度そろうか FOR(i, 0, 5){ string s = mark[i]; ll n = 1; FOR(j, 0, 3){ n *= mp[j][s]; } num[i] = n * 5; } double score_sum = 0; FOR(i, 0, 5){ score_sum += coin[i] * num[i]; } double expectation = score_sum; expectation /= L[0]; expectation /= L[1]; expectation /= L[2]; cout << setprecision(20); p(expectation); for(ll a : num){ p(a); } return 0; }