This page is still under construction.

Parts of this page are still being built. What you see may change.

Bee

Time limit1sMemory limit128 MB

Summary
The program counts logged jobs under each of seven bee work codes and prints each count with its share of the total.
Level

Easy2 of 10

Topics
Implementation, Array, Math
Solved
No attempts yet

Problem

The work a bee does can be classified into these seven kinds.

resting (Re), patrolling (Pt), cleaning a cell (Cc), eating pollen (Ea), tending brood (Tb), building and maintaining the comb (Cm), outside activity (Ex)

Given the record of what one bee did during one hour, write a program that reports how many times it did each kind of work and what share of the whole each kind takes.

Input

The work the bee did is given separated by spaces and newlines. The number of jobs is between 1 and 24. The record may also contain codes that are not among the seven kinds above.

Output

Print the seven kinds in the order Re, Pt, Cc, Ea, Tb, Cm, Ex, one per line. Each line holds the name of the work, how many times the bee did it, and its ratio to the total number of jobs, separated by spaces. Print a kind even when its count is 0. A code that is not among the seven kinds is not printed, but it still counts toward the total number of jobs.

Round the ratio at the third decimal place and print two decimal places. A value exactly halfway rounds up, so 0.375 prints as 0.38.

On the last line print Total <total> 1.00, where <total> is the total number of jobs the bee did.

Examples1

  1. Example 1

    Input
    Cc Pt Pt Re Tb Re Cm Cm Re Pt Pt Re Ea Ea Pt Pt
    Pt Re Re Cb Cb Pt Pt Cb
    
    Expected output
    Re 6 0.25
    Pt 9 0.38
    Cc 1 0.04
    Ea 2 0.08
    Tb 1 0.04
    Cm 2 0.08
    Ex 0 0.00
    Total 24 1.00