Pagini recente » Cod sursa (job #2681684) | Cod sursa (job #1004845) | Cod sursa (job #3286725) | Cod sursa (job #831443) | Cod sursa (job #1796189)
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int nmax = 100005; const LL inf = 1e18;
struct el{
double x,y;
}a[nmax];
int N;
double sol;
inline long double Arie(int i,int j,int q){
return ((a[j].x-a[i].x)*(a[q].y-a[i].y) - (a[j].y-a[i].y)*(a[q].x-a[i].x));
}
int main(){
// #ifndef GLOBAL_JUDGE
// freopen("txt.in","r",stdin);
// freopen("txt.out","w",stdout);
// #endif // GLOBAL_JUDGE
ifstream f("Aria.in");
ofstream g("Aria.out");
int i;
f >> N;
for(i = 1; i <= N; ++i)
f>> a[i].x >> a[i].y;
for(i = 3; i <= N; ++i)
sol+=Arie(1,i-1,i);
sol/=2;
g << fixed << setprecision(6)<< sol << '\n';
f.close();
g.close();
return 0;
}