Pagini recente » Profil Flor1nC23 | Diferente pentru warm-up-2019/solutii/shoturi intre reviziile 99 si 36 | Cod sursa (job #346084) | Monitorul de evaluare | Cod sursa (job #1537550)
#include <fstream>
#include <algorithm>
#include <iomanip>
using namespace std;
ifstream in ("aria.in");
ofstream out ("aria.out");
int n; long long s;
pair <int, int> a[1000001];
int main()
{
in >> n;
for (int i = 1; i <= n; i++)
in >> a[i].first >> a[i].second;
a[n+1].first = a[1].first; a[n+1].second = a[1].second;
for (int i = 1; i <= n; i++)
s = s + a[i].first * a[i+1].second - a[i+1].first * a[i].second;
out << fixed << setprecision(6) << fabs(s/2) << '\n';
out.close(); return 0;
}