#include
using namespace std;
main()
{
int t;
cin>>t;
while(t–)
{
int n;
cin>>n;
double loss=0;
for(int i=0;i<n;i++)
{
int price;
int q,discount;
cin>>price>>q>>discount;
double a1,a2,a3;
a1=price*q;
a2=a1+((a1*discount)/100);
a3=a2-((a2*discount)/100);
//cout<<price1;
loss=loss+(a1-a3);
}
cout<<loss;
}
}