A Big Sale

All submissions for this problem are available.
Read problems statements in Mandarin chinese, Russian and Vietnamese as well.
Chef recently opened a big ecommerce website where her recipes can be bought online. It's Chef's birthday month and so she has decided to organize a big sale in which grand discounts will be provided.
In this sale, suppose a recipe should have a discount of x percent and its original price (before the sale) is p. Statistics says that when people see a discount offered over a product, they are more likely to buy it. Therefore, Chef decides to first increase the price of this recipe by x% (from p) and then offer a discount of x% to people.
Chef has a total of N types of recipes. For each i (1 ≤ i ≤ N), the number of recipes of this type available for sale is quantity_{i}, the unit price (of one recipe of this type, before the x% increase) is price_{i} and the discount offered on each recipe of this type (the value of x) is discount_{i}.
Please help Chef find the total loss incurred due to this sale, if all the recipes are sold out.
Input
 The first line of the input contains a single integer T denoting the number of test cases. The description of T test cases follows.
 The first line of each test case contains a single integer N denoting the number of recipe types.
 N lines follow. The ith of these lines contains three spaceseparated integers price_{i}, quantity_{i} and discount_{i} describing the ith recipe type.
Output
For each test case, print a single line containing one real number — the total amount of money lost. Your answer will be considered correct if it has an absolute error less than 10^{2}.
Constraints
 1 ≤ T ≤ 10
 1 ≤ N ≤ 10^{5}
 1 ≤ price_{i}, quantity_{i} ≤ 100 for each valid i
 0 ≤ discount_{i} ≤ 100 for each valid i
Subtasks
Subtask #1 (30 points): 1 ≤ N ≤ 100
Subtask #2 (70 points): original constraints
Example
Input: 2 2 100 5 10 100 1 50 3 10 10 0 79 79 79 100 1 100 Output: 30.000000000 3995.0081000
Explanation
Example case 1: There are two recipes.
There are 5 recipes of the first type, each of them has a price of 100 and there is a 10% discount provided on it. Therefore, Chef first increases the price of each recipe by 10%, from 100 to 110. After that, she decreases the price by 10%, which makes the final price 99. The amount of money lost for each unit is 1, thus losing 5 for recipes of the first type.
There is only one recipe of the second type, with price 100 and a 50% discount. Therefore, Chef increases the price of the recipe by 50% from 100 to 150 and after that, she decreases its price by 50% to make its final price 75. She loses 25 for this recipe.
Overall, the amount of money Chef loses is 30.
Author:  admin2 
Editorial  https://discuss.codechef.com/problems/BIGSALE 
Tags  admin2, easy, march18, maths 
Date Added:  2022018 
Time Limit:  2 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.5, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, CLOJ, COB, FS 
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. 