Cod sursa(job #2912049)
Utilizator | Data | 6 iulie 2022 18:12:11 | |
---|---|---|---|
Problema | Aria | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.27 kb |
#include<cstdio>
long double a,b,x,y,w,z,s,n;
int main()
{
freopen("aria.in","r",stdin),freopen("aria.out","w",stdout),scanf("%Lf%Lf%Lf",&n,&a,&b);
for(x=a,y=b;n;scanf("%Lf%Lf",&w,&z),s+=x*z-w*y,--n,x=w,y=z);
return s+=x*b-a*y,printf("%.5Lf",s/2),0;
}