File tree Expand file tree Collapse file tree
Problems/Mathematics/Day-01/sol/Lavay Garg Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /* # PROBLEM STATEMENT :
2+
3+ There are **n people** standing in a circle. They are numbered from **1 to n** in a clockwise order. The circle is **even** (i.e. *n* is even).
4+
5+ Each person is looking at the person standing exactly opposite him in the circle.
6+
7+ You are given three **distinct** integers **a**, **b**, and **c**. It is known that person **a** is looking at person **b**.
8+
9+ Determine the number of the person that person **c** is looking at.
10+ If there are **multiple answers**, print **any** of them.
11+ If there is **no answer**, print **-1**.*/
12+ /* ## Example
13+
14+ ### Input
15+ ```
16+ 7
17+ 6 2 4
18+ 2 3 1
19+ 2 4 10
20+ 5 3 4
21+ 1 3 2
22+ 2 5 4
23+ 4 3 2
24+ ```
25+
26+
27+ ### Output
28+ ```
29+ 8
30+ -1
31+ -1
32+ -1
33+ 4
34+ 1
35+ -1
36+ ```*/
137#include < bits/stdc++.h>
238using namespace std ;
339
@@ -22,3 +58,5 @@ int main() {
2258 }
2359 }
2460}
61+ // Time complexity =O(t)
62+ // Space complexity=O(1)
You can’t perform that action at this time.
0 commit comments