We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents dff2e28 + 1f18e6b commit 0e96076Copy full SHA for 0e96076
1 file changed
Problems/Mathematics/Day-01/sol/Adarsh Yadav/solution.cpp
@@ -0,0 +1,27 @@
1
+//https://codeforces.com/contest/1560/problem/C
2
+//https://codeforces.com/contest/1560/submission/355210608
3
+// TC : O(1) SC: O(1)
4
+#include <bits/stdc++.h>
5
+using namespace std;
6
+
7
+int main() {
8
+ int t;
9
+ cin>>t;
10
+ while(t--){
11
+ int a,b,c;
12
+ cin>>a>>b>>c;
13
+ int k=abs(a-b);
14
+ if(a>2*k || b>2*k || c>2*k){
15
+ cout<<-1<<endl;
16
+ }
17
+ else{
18
+ if((c-k)>0){
19
+ cout<<c-k<<endl;
20
21
22
+ cout<<c+k<<endl;
23
24
25
26
27
+}
0 commit comments