Chef recently opened a big e-commerce 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 quantityi, the unit price (of one recipe of this type, before the x% increase) is pricei and the discount offered on each recipe of this type (the value of x) is discounti.
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 i-th of these lines contains three space-separated integers pricei, quantityi and discounti describing the i-th 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 ≤ 105
- 1 ≤ pricei, quantityi ≤ 100 for each valid i
- 0 ≤ discounti ≤ 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.

Difficulty: interview

Starter code:

Solutions:
for i in range(int(input())):
 n=int(input())
 s=0
 for i in range(n):
  a,b,c=map(int,input().split())
  d=(c/100)*a
  e=a+d
  f=e-((c/100)*e)
  g=a-f
  h=b*g
  s=s+h
 print(s)

for i in range(int(input())):
 n=int(input())
 s=0
 for i in range(n):
  a,b,c=list(map(int,input().split()))
  d=(c/100)*a
  e=a+d
  f=e-((c/100)*e)
  g=a-f
  h=b*g
  s=s+h
 print(s)


# cook your dish here
for _ in range(int(input())):
 n=int(input())
 s=0
 for i in range(n):
  p,q,d=map(int,input().split())
  x=(d/100)*p
  pr=p+x 
  y=pr-((d/100)*pr)
  l=p-y
  tl=q*l 
  s=s+tl
 print(s)

for _ in range(int(input())):
 n = int(input())
 s =0
 for _ in range(n):
  p,q,d=map(int,input().split())
  pi= p + (d/100 *p)
  p_new = pi -(d/100 * pi)
  loss = (p - p_new)*q
  s=s+(loss)
 print(s)

# cook your dish here
t=int(input())
for i in range(t):
 n=int(input())
 s=0
 for j in range(n):
  p,q,d=map(int,input().split())
  tmp=p
  p=p+((d/100)*p)
  p=p-((d/100)*p)
  s=s+((tmp-p)*q)
 print(s)

# cook your dish here
for i in range(int(input())):
 m=int(input())
 a=0
 for j in range(0,m):
  p,q,d=list(map(int,input().split()))
  a+=(p-((p+(d*p)/100)-(p+(d*p)/100)*(d/100)))*q
 print("{0:.9f}".format(a))


#Lists
tempRecipeLossList = []
answerList = []

#Functions
def split_loss_calculator(userInput):
 (price, quantity, discount) = list(map(int, userInput.split()))
 loss = price - (price * ((100+discount)/100) * ((100-discount)/100))
 tempRecipeLossList.append(loss * quantity)
 

#Program
test_cases = int(input())
for i in range(test_cases):
 numRecipeTypes = int(input())
 for j in range(numRecipeTypes):
  split_loss_calculator(input())
 answerList.append(sum(tempRecipeLossList))
 tempRecipeLossList.clear()
 
for item in range(len(answerList)):
 print("{}".format(answerList[item]))


#Lists
tempRecipeLossList = []
answerList = []
priceList = []
quantityList = []
discountList = []
total_lossList = []

#Functions
def split_loss_calculator(userInput):
 (price, quantity, discount) = list(map(int, userInput.split()))
 loss = price - (price * ((100+discount)/100) * ((100-discount)/100))
 tempRecipeLossList.append(loss * quantity)
 

#Program
test_cases = int(input())
for i in range(test_cases):
 numRecipeTypes = int(input())
 for j in range(numRecipeTypes):
  split_loss_calculator(input())
 answerList.append(sum(tempRecipeLossList))
 tempRecipeLossList.clear()
 
for item in range(len(answerList)):
 print("{}".format(answerList[item]))


t = int(input())
for i in range(t):
 n = int(input())
 loss=0
 for j in range(n):
  p, q, d = map(int, input().split())
  loss = loss + (q*(p-((p-p*(d/100))*((100+d)/100))))
 print(loss)

# cook your dish here
T=int(input())
for i in range(T):
 N=int(input())
 C=0
 for j in range(N):
  F=0
  P,Q,D=map(int,input().split())
  F=P+(P*(D/100))
  F=F-(F*(D/100))
  C+=((P-F)*Q)
 print(C)

for i in range(int(input())):
 n=int(input())
 ans=0
 for j in range(0,n):
  p,q,d=list(map(int,input().split()))
  ans+=(p-((p+(d*p)/100)-(p+(d*p)/100)*(d/100)))*q
 print("{0:.9f}".format(ans))


for _ in range(int(input())):
 n=int(input())
 ans=0
 for j in range(0,n):
  p,q,d=map(int,input().split())
  ans+=(p-((p+(d*p)/100)-(p+(d*p)/100)*(d/100)))*q
 print("{0:.9f}".format(ans))

n=int(input())
for i in range(n):
  n1=int(input())
  loss=0
  for j in range(n1):
    l=list(map(int,input().split()))
    loss+=(l[1]*l[0]*(l[2]*l[2]))/10000
    
  print(loss)

t=int(input())
for i in range(t):
 n=int(input())
 res=[]
 initialprice=0
 middleprice=0
 finalprice=0
 totalloss=1
 loss=0
 for i in range(n):
  p,q,d=list(map(float,input().split()))
  initialprice=p
  middleprice=initialprice+((initialprice*d)/100)
  finalprice=middleprice-((middleprice*d)/100)
  loss=initialprice-finalprice
  totalloss=float(q*loss)
  res.append(totalloss)
 print(float(sum(res)))
 


T=int(input())
for i in range(T):
 N=int(input())
 C=0
 for j in range(N):
  F=0
  P,Q,D=map(int,input().split())
  F=P+(P*(D/100))
  F=F-(F*(D/100))
  C+=((P-F)*Q)
 print(C)

T=int(input())
for i in range(T):
 N=int(input())
 C=0
 for j in range(N):
  F=0
  P,Q,D=list(map(int,input().split()))
  F=P+(P*(D/100))
  F=F-(F*(D/100))
  C+=((P-F)*Q)
 print(C)


t = int(input())

for _ in range(t):
 a = int(input())
 l = 0
 for _ in range(a):
  x, y, z = map(int, input().split())
  add_per = x + (x*(z/100))
  act_prz = add_per * (z/100)
  loss = add_per - act_prz
  act_lss = (x-loss) * y
  l += act_lss
 print("%0.7f"%l)

# cook your dish here
for _ in range(int(input())):
 n=int(input())
 loss=0
 for i in range(n):
  p,q,d=list(map(int,input().split()))
  inc=p+(d/100)*p 
  dec=inc-(d/100)*inc
  diff=p-dec
  loss+=diff*q 
 print("{0}".format(loss))


for t in range(int(input())):
 totallossforthiscase = 0
 for i in range(int(input())):
  price , quantity , discount = map(int,input().split())
  originalprice = price
  price = price*(1 + (discount/100))
  price = price*(1 - (discount /100))
  diff = originalprice - price
  loss = diff * quantity
  totallossforthiscase +=loss
 print(totallossforthiscase)

for _ in range(int(input())):
 n=int(input())
 lst=[]
 for i in range(n):
  original_price, quantity, discount=[*map(int,input().strip().split())]
  increased_price=original_price+((discount/100)*original_price)
  reduced_price=increased_price-((discount/100)*increased_price)
  lst.append((abs(original_price-reduced_price))*quantity)
 print("{:.9f}".format(sum(lst)))

t=input()
t=int(t)
while t!=0 :
 n=input()
 n=int(n)
 f=0
 while n!=0 :
  inp=input().split(" ")
  inp=[int(x) for x in inp]
  np=(inp[0]*inp[2]*0.01)+inp[0]
  f+=(inp[0]-(np-(np*inp[2]*0.01)))*inp[1]
  n-=1
 print(f)
 t-=1

# cook your dish here
for _ in range(int(input())):
 n=int(input())
 loss=0
 for t in range(n):
  p,q,d=map(int,input().split())
  ip=p+(p*(d/100))
  fp=ip-(ip*(d/100))
  loss+=(p-fp)*q
 print(loss)

# cook your dish here
for e in range(int(input())):
 c = 0 
 num=int(input())
 for i in range(num):
  p,q,r = map(int,input().split()) 
  x = p + (r/100)*p 
  x-=(r/100)*x 
  c+=(p-x)*q 
 print("{0:.6f}".format(c)) 

# cook your dish here
try:
 tap=int(input())
 for i in range(tap):
  num=int(input())
  loss=0
  for j in range(num):
   l=list(map(int,input().split()))
   p=l[0]
   r=l[1]
   d=l[2]
   
   t=p+(d/100)*p
   a=t-t*(d/100)
   loss +=(p-a)*r
   
  print(loss)
except:
 pass