Skip to content

Commit e3195cd

Browse files
authored
Merge pull request #136 from SATII2004/solve-issue-002-math-q001
Solve CF 1560B - Who's Opposite?
2 parents 205780f + 396a07d commit e3195cd

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ti=int(input())
2+
3+
for _ in range(ti):
4+
k,l,p=map(int,input().split())
5+
6+
d=abs(k-l)
7+
f=2*d
8+
9+
if k>f or l>f or p>f:
10+
print(-1)
11+
else:
12+
if p+d<=f:
13+
print(p+d)
14+
else:
15+
print(p-d)

0 commit comments

Comments
 (0)