#include <iostream>
#include <utility>
#include <vector>
#include <math.h>
using namespace std;
int n;
vector <pair<double, double>> polygon;
double area() {
double ret = 0;
for (int i = 0; i < n; ++i) {
int j = (i + 1) % n;
ret += polygon[i].first * polygon[j].second - polygon[j].first * polygon[i].second;
}
return fabs(ret) / 2;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> n;
for (int i = 0; i < n; ++i) {
double x, y;
cin >> x >> y;
polygon.push_back(make_pair(x, y));
}
cout << fixed;
cout.precision(1);
cout << area();
return 0;
}
cout << fixed; 소수점을 고정시켜 표현을 하겠다는 뜻이다
cout.precision(n); 소수점 아래 n자리까지 표현을 하겠다는 뜻이다