Թաքցված խնդիր
|Այս խնդիրը թաքցված է խմբագրական խրհրդի անդամի կողմից քանի որ կամ այն ոչ ճիշտ լեզվով է գրված,|կամ թեստային տվյալներն են սխալ, կամ խնդրի ձևակերպումը պարզ չէ։|

## ACM_0185 - FLAT

You are one of the developers of software for a real estate agency. One of the functions you are to implement is calculating diﬀerent kinds of statistics for ﬂats the agency is selling. Each ﬂat consists of diﬀerent types of rooms: bedroom, bathroom, kitchen, balcony and others.

The cost of the ﬂat is equal to the product of reduced total area and the cost of one square metre. Reduced total area is the total area of all rooms except for balconies plus one half of balconies total area.

You will be given some information about the area of each room in the ﬂat and the cost of one square metre. You are to calculate the following values for the ﬂat:

• the total area of all rooms;
• the total area of all bedrooms;
• the cost of the ﬂat.

#### Input

The ﬁrst line of the input ﬁle contains two integer numbers n (1 n 10) and c (1 c 100 000) — number of rooms in the ﬂat and the cost of one square metre, respectively.

Each of the following n lines contains an integer number ai (1 ai 100) and a word ti — the area of i-th room and its type, respectively. Word ti is one of the following: “bedroom”, “bathroom”, “kitchen”, “balcony”,    “other”.

#### Output

The ﬁrst line of the output ﬁle should contain one integer number — the total area of all rooms of the ﬂat. The second line of the output ﬁle should contain one integer number — the total area of bedrooms of the ﬂat. The third line of the output ﬁle should contain one real number — the cost of the ﬂat with precision not worse than 106.

#### Examples

stdin

stdout

1

 6 75000 8 other 3 bathroom 2 bathroom 10 kitchen 16 bedroom 7 balcony
 46 16 3187500

2

 2 75123 10 kitchen 15 balcony
 25 0 1.31465e+06

 Ավելացրեց. Հրանտ Հովհաննիսյան Ամսաթիվ. 2014-04-09 Ժամանակի սահմանափակումը. 1s Ծրագրի տեքստի սահմանափակումը. 50000B Memory limit: 1536MB Cluster: Cube (Intel G860) Լեզուներ. Բոլորը բացի ASM32 ASM64 GAWK CLPS CLOJURE D ERL FSHARP FORTRAN GOSU HASK ICON ICK NEM NIM OBJC-CLANG PICO PIKE PYPY PY_NBC RUST SCM guile CHICKEN SED TCL WHITESPACE Աղբյուրը. Northern QF 2011.F