Pagini recente » Cod sursa (job #2971539) | Cod sursa (job #2397040) | Cod sursa (job #132826) | Cod sursa (job #2714153) | Cod sursa (job #2572557)
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
ifstream fin("aria.in");
ofstream fout("aria.out");
void debug_out() { cerr << '\n'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}
#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"
typedef pair<int,int> pii;
typedef long long int ll;
typedef long double ld;
const int DMAX = 1e5+10;
struct nume{
ld x,y;
};
nume V[DMAX];
int n;
ld ans;
ll det(nume x,nume y,nume z){
ld ans;
ans=1LL*x.x*y.y;
ans+=1LL*y.x*z.y;
ans+=1LL*z.x*x.y;
ans-=1LL*y.y*z.x;
ans-=1LL*z.y*x.x;
ans-=1LL*x.y*y.x;
return ans;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int t,i,j;
fin>>n;
for(i=1;i<=n;i++)
fin>>V[i].x>>V[i].y;
for(i=3;i<=n;i++)
ans+=det(V[1],V[i-1],V[i]);
fout<<fixed<<setprecision(7)<<ans/2<<'\n';
return 0;
}