This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt")
#define fio ios_base::sync_with_stdio(0);cin.tie(0);
#define en cin.close();return 0;
#define ll long long
#define pb push_back
#define fi first
#define se second
using namespace std;
int main()
{
fio
// ifstream cin("in.in");
int n;
cin >> n;
if(n<=2)
return cout << -1, 0;
pair<int,int> p[n];
for(auto &x:p)
cin >> x.fi >> x.se;
int d1 = 0, d2 = 0;
for(auto x:p)
d1=__gcd(d1,abs(p[0].fi-x.fi)),
d2=__gcd(d2,abs(p[0].se-x.se));
cout << 1ll*d1*d2;
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... |