Submission #1049430

#TimeUsernameProblemLanguageResultExecution timeMemory
1049430aymanrsPortal (BOI24_portal)C++17
0 / 100
1 ms348 KiB
#include<bits/stdc++.h> using namespace std; void solve(){ int n;cin >> n; if(n<=2) cout << "-1\n"; int x[n],y[n]; for(int i = 0;i < n;i++) cin >> x[i] >> y[i]; int gx = 0, gy = 0; for(int i = 1;i < n;i++){ x[i] -= x[0]; y[i] -= y[0]; if(x[i]) gx = __gcd(gx, abs(x[i])); if(y[i]) gy = __gcd(gy, abs(y[i])); } cout << (long long)gy*gx << '\n'; } int main(){ ios_base::sync_with_stdio(false); cin.tie(0); solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...