Parlay Wagering

Time Limit: 1000 ms Memory Limit: 65536 KiB

Problem Description

Input

Output

Sample Input

3
10 5
-170 Win
-160 Win
125 Win
-135 Win
-140 Win
15 8
100 Win
-100 Tie
-250 Win
135 Tie
265 Tie
1500 Win
120 Win
130 Win
10 2
100 Loss
300 Tie

Sample Output

$173.11
$3,400.32
$0.00

Hint

 

Source

2009 Mid-Atlantic Regional Programming Contest