# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1008729 | Rolo678 | Labels (NOI20_labels) | C++14 | 0 ms | 0 KiB |
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>
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';
}