Pagini recente » Monitorul de evaluare | Cod sursa (job #3365894) | Monitorul de evaluare | Cod sursa (job #3366348) | Cod sursa (job #3365883)
#include <fstream>
#include <cmath>
#include <iomanip>
#include <vector>
using namespace std;
ifstream cin("aria.in");
ofstream cout("aria.out");
struct Point {
int x, y;
};
int n;
vector<Point> points;
int main() {
cin >> n;
for (int i = 0 ; i < n ; ++i) {
int x, y;
cin >> x >> y;
points.push_back({x, y});
}
long long sum = 0;
points.push_back(points[0]);
for (int i = 0 ; i < n ; ++i) {
sum += (points[i].x * points[i + 1].y - points[i + 1].x * points[i].y);
}
cout << 1.0 * floor(fabs(sum) * 0.5 * 1e5) / 1e5;
return 0;
}