# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1008729 | 2024-06-26T17:04:28 Z | Rolo678 | Labels (NOI20_labels) | C++14 | 0 ms | 0 KB |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >>n; vector<int>d(n); for(int i = 1;i<n;i++) { cin >>d[i]; } if(abs(d[1]) != 2*n-2) cout<<-1<<'\n'; else if (d[i] == -2*n + 2) cout<< n-1 << ' '<< -n+1 <<'\n'; else if (d[i] == 2*n-2) cout<< -n+1 << ' '<< n-1 <<'\n'; }