Pagini recente » Monitorul de evaluare | Cod sursa (job #2551154) | Cod sursa (job #1795164) | Cod sursa (job #1790022) | Cod sursa (job #2570322)
#include <fstream>
#include <iomanip>
using namespace std;
ifstream fin ("aria.in");
ofstream fout ("aria.out");
const int nmax=100005;
int main()
{
int n;
fin >> n;
long double rez=0;
pair <long double,long double> pct[nmax];
for (int i=1;i<=n;i++)
{
fin >> pct[i].first >> pct[i].second;
}
pct[n+1]=pct[1];
for (int i=1;i<=n;i++)
{
rez=rez+pct[i].first*pct[i+1].second-pct[i+1].first*pct[i].second;
}
fout << fixed << setprecision(6) << rez/2;
}