Pagini recente » Cod sursa (job #383073) | Cod sursa (job #1953202) | Cod sursa (job #645168) | Cod sursa (job #2161595) | Cod sursa (job #3134000)
#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define debug(x) cerr << #x << " = " << x << endl
#else
#define debug(x)
#endif
#define endl '\n'
#define sz(a) ((int)(a).size())
#define all(a) (a).begin(), (a).end()
#define erase_unique(a) sort(all(a)); (a).erase(unique(all(a)), (a).end())
#define f first
#define s second
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define lsb(x) (x & (-x))
#define FILE_NAME "aria"
typedef long long ll;
typedef pair<int, int> pii;
#define double long double
const int NMAX = 1e5+5;
struct Point {
double x, y;
};
int n;
Point a[NMAX];
void read() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i].x >> a[i].y;
}
double solve() {
double ans = 0;
a[n + 1] = a[1];
for (int i = 1; i <= n; i++)
ans += a[i].x * a[i + 1].y - a[i + 1].x * a[i].y;
return ans / 2.0;
}
signed main() {
#ifdef LOCAL
freopen("input.txt", "r", stdin);
#else
freopen(FILE_NAME ".in", "r", stdin);
freopen(FILE_NAME ".out", "w", stdout);
#endif
int t = 1;
// cin >> t;
while (t--) {
read();
cout << setprecision(6) << fixed << solve() << endl;
}
return 0;
}