M. Multiple Downloads
time limit per test
0.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

CDownloader is a download manager written in the C language. In other words, it is a program capable of automatically downloading a list of $$$N$$$ files from the internet, all at once.

Each file to be downloaded can be either prioritized or not. Unlike other much more complex managers with fairer and better rules, CDownloader uses a very simple rule: at any given moment, from the total download speed of T megabytes per second (MB/s) that the user's connection has, it will use 75% of that speed to download the prioritized files, and 25% to download the non-prioritized files. Within each group, the assigned download speed is distributed equally.

For example, if CDownloader needs to download the following files:

  • A, prioritized, with size 10 MB
  • B, non-prioritized, with size 100 MB
  • C, prioritized, with size 20 MB
  • D, prioritized, with size 200 MB
  • E, non-prioritized, with size 300 MB

And the user's connection speed is 40 MB/s, then initially CDownloader:

  • Downloads A, with speed 10 MB/s
  • Downloads B, with speed 5 MB/s
  • Downloads C, with speed 10 MB/s
  • Downloads D, with speed 10 MB/s
  • Downloads E, with speed 5 MB/s

Since 75% of 40 MB/s is 30 MB/s and that is used for the 3 prioritized files, each one is downloaded at 10 MB/s. Also, 25% of 40 MB/s is 10 MB/s, and that is used in total for the 2 non-prioritized files, resulting in 5 MB/s for each one.

After 1 second of downloading, the download of file A is completed, and the new situation of the remaining files is:

  • Downloads B (already 5 MB downloaded), with speed 5 MB/s
  • Downloads C (already 10 MB downloaded), with speed 15 MB/s
  • Downloads D (already 10 MB downloaded), with speed 15 MB/s
  • Downloads E (already 5 MB downloaded), with speed 5 MB/s

And so on until all downloads are completed. If at any time there are only prioritized files, or only non-prioritized files, then the download speed is distributed equally among all remaining files.

Your task is to write a program that calculates the total time CDownloader will take to download all the files from the internet.

Input

The first line contains two integers $$$N$$$ and $$$T$$$ ($$$1 \leq N \leq 50$$$, $$$1 \leq T \leq 1024$$$), the number of files to download and the download speed of the user's connection in MB/s.

Then $$$N$$$ lines, each describing one of the $$$N$$$ files. The $$$i$$$-th line contains an uppercase letter $$$C_i$$$ ($$$C_i \in \{\texttt{P}, \texttt{N}\}$$$) and an integer $$$X_i$$$ ($$$1 \leq X_i \leq 512$$$), indicating whether the $$$i$$$-th file is prioritized (letter P) or non-prioritized (letter N), and the size in MB.

Output

A single line with a single number indicating the total time in seconds until CDownloader completes the download of the $$$N$$$ files.

This answer will be accepted if it has a relative or absolute error less than or equal to $$$10^{-4}$$$.

Formally, let $$$a$$$ be your answer and $$$b$$$ be the jury's answer. Then, your answer will be accepted if and only if $$$\frac{|a - b|}{\max{(1, |b|)}} \le 10^{-4}$$$.

Examples
Input
5 40
P 10
N 100
P 20
P 200
N 300
Output
15.75
Input
1 1
N 64
Output
64
Input
1 113
P 355
Output
3.1415929204