Pagini recente » Istoria paginii runda/test321/clasament | Rating gradinariu stefana (shtefana) | Cod sursa (job #2230470) | Cod sursa (job #2263478) | Cod sursa (job #3120765)
#include <fstream>
#include <cmath>
#include <iomanip>
using namespace std;
ifstream cin("aria.in");
ofstream cout("aria.out");
long long n,i,x[100010],y[100010],xstart,ystart;
long double aria;
int main()
{
cin>>n;
for(i=1;i<=n;i++)
cin>>x[i]>>y[i];
xstart=x[1];
ystart=y[1];
x[n+1]=xstart;
y[n+1]=ystart;
for(i=2;i<=n+1;i++)
{
aria+=xstart*y[i]-ystart*x[i];
xstart=x[i];
ystart=y[i];
}
//cout<<fixed;
cout <<fabs(aria/2.0);
return 0;
}