Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

 
 
 
 
General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
126292783 Out of competition:
* coxie
1560B - 29 C++17 (GCC 9-64) Accepted 31 ms 4208 KB 2021-08-18 17:49:34 2021-08-19 08:51:06
→ Source
#include <bits/stdc++.h>
using namespace std;
#define sz(v) (int)((v).size())
#define all(x) (x).begin(), (x).end()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define int long long
signed main(void)
{
    cin.tie(0)->sync_with_stdio(false);
    int T; cin>>T;
    while(T--)
    {
        int a, b, c; cin>>a>>b>>c;
        --a, --b, --c;
        int n = abs(a - b) * 2;
        if (n <= c || n <= a || n <= b)
        {
            cout << "-1\n";
            continue;
        }
        int x = (n / 2 + c) % n;
        cout << x + 1 << '\n';
    }
    return 0;
}
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details