#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<pair<ll, ll>>
#define vpp vector<pair<ll, pair<ll, ll>>>
#define pp pair<ll, ll>
#define qi queue<ll>
#define qp queue<pp>
#define pqi priority_queue<ll>
#define pqp priority_queue<pp>
#define mi map<ll, ll>
#define mpi map<pp, ll>
#define mip map<ll, pp>
#define mp map<pp, pp>
#define mb map<ll, bool>
#define si set<ll>
#define sp set<pp>
#define sc set<char>
#define mod 1000000007
#define inf INT_MAX
#define all(x) (x).begin(), (x).end()
ll cross(pp start1, pp end1, pp start2, pp end2) {
ll x1 = end1.first - start1.first;
ll y1 = end1.second - start1.second;
ll x2 = end2.first - start2.first;
ll y2 = end2.second - start2.second;
ll ans = abs(x1 * y2 - x2 * y1);
return ans;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
ll n;
cin >> n;
vp a(n);
for(int i = 0; i < n; i++) {
cin >> a[i].first >> a[i].second;
}
if(n <= 2) {
cout << "-1\n";
return 0;
}
ll ans = -1;
for(int i = 0; i < n - 1; i++) {
ll cur = cross(a[0], a[i], a[0], a[i + 1]);
if(cur > 0) ans = cur;
}
cout << ans << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |