CATWOMANS EARLY DAYS

All submissions for this problem are available.
Catwoman in her early days started off with stealing from supermarkets before she became a master thief. Being the intelligent thief she is, she stakes the supermarket out and plans her robbery beforehand. She makes a list of worthwile things to steal  their weight, cost and whether the item can be divided into smaller parts of any weight(such as rice, oil) or can not be divided into parts(such as spoons,tumblers). She can only transport a maximum weight of W. Given this list and the maximum weight can u figure out what is the maximum total cost of stolen goods she can steal?
Input Description:
The first line of input contains the number of test cases T(1<=T<=100). T test cases follow.
The first line of every test case consists of two integers  N(1<=N<=50) and W(1<=W<=10000).
The next N lines are formatted as followed:
The ith line contains 2 integers and a character separated by a single space between them  weight[i], cost[i] and ch[i]
weight[i]  weight of the ith item. (1<=weight[i]<=10000)
cost[i]  cost of the ith item. (1<=cost[i]<=10000)
ch[i]  'Y' if the item can be divided or 'N' if the item cannot be divided.
Note: For divisible items, assume that cost of the item is directly proportional to its weight.
Output Description:
For each test case, output a single line consisting of a single number  the maximum total cost of stolen goods possible. The value must have a relative or absolute error less the 1e6.
Sample Input:
5
1 1
1 1 N
1 1
1 1 Y
1 1
10 1 Y
3 100
100 1 Y
150 10 Y
200 1 N
3 100
50 100 N
100 45 Y
200 1000 N
Sample Output:
1.0000000000
1.0000000000
0.1000000000
6.6666666667
122.50000000
Author:  csaapogee 
Tags  csaapogee 
Date Added:  7022013 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP 4.3.2, CPP 6.3, CPP14, GO 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 