-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbigsale.cpp
More file actions
41 lines (38 loc) · 735 Bytes
/
Copy pathbigsale.cpp
File metadata and controls
41 lines (38 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include<iostream>
#include<algorithm>
#include<climits>
#include<math.h>
#include<vector>
#include<iomanip>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
int a[n][3];
for(int i=0;i<n;i++)
{
for(int j=0;j<3;j++)
{
cin>>a[i][j];
}
}
long double cp=0,sp=0;
for(int i=0;i<n;i++)
{
long double x=a[i][0];
long double y=a[i][2]*a[i][2];
long double z=a[i][1];
cp+=x*z;
sp+=z*(x*(10000-y))/10000;
}
cout<<fixed;
cout<<setprecision(8);
cout<<cp-sp<<endl;
}
return 0;
}