Pagini recente » Cod sursa (job #1242866) | Profil Gliggy | Cod sursa (job #1048853) | Cod sursa (job #753321) | Cod sursa (job #3203460)
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
const char nl = '\n';
const char sp = ' ';
const int inf = 0x3f3f3f3f;
const int mod = 666013;
const char out[2][4]{ "NO", "YES" };
#define all(a) a.begin(), a.end()
using ll = long long;
ifstream fin("aria.in");
ofstream fout("aria.out");
const int nmax = 1e5;
int n;
pair<ll, ll> p[nmax + 5];
long double area(const pair<ll, ll>& a, const pair<ll, ll>& b, const pair<ll, ll>& c) {
return abs((ll)(b.first - a.first) * (c.second - a.second) - (ll)(c.first - a.first) * (b.second - a.second)) / 2.0;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
fin >> n;
for (int i = 1; i <= n; ++i) {
fin >> p[i].first >> p[i].second;
}
long double Area = 0;
for (int i = 2; i < n; ++i) {
Area += area(p[1], p[i], p[i + 1]);
}
fout << fixed << setprecision(8) << Area;
}