Say No To Drugs solution codechef- There are NN people participating in a race. The NthNth participant is your friend, so you want him to win. You are not a man of ethics, so you decided to inject some units of a Performance Enhancement Drug (don’t ask where that came from) in your friend’s body.
September 2, 2021
The Old Saint And Three Questions codechef solution- Once upon a time, there was a hero and an old saint. And like in any story with a hero and an old saint, the old saint asked the hero — three questions!
September 2, 2021
August 26, 2021
Who’s Opposite? solution codeforces
Some number of people (this number is even) have stood in a circle. The people stand in the circle evenly. They are numbered clockwise starting from a person with the number. Each person is looking through the circle’s center at the opposite person.
The first line contains one integer( ) — the number of test cases. Then test cases follow.
Each test case consists of one line containing three distinct integers , , ( ).
For each test case output in a separate line a single integer— the number of the person being looked at by the person with the number in a circle such that the person with the number is looking at the person with the number . If there are multiple solutions, print any of them. Output if there’s no circle meeting the given conditions.
7 6 2 4 2 3 1 2 4 10 5 3 4 1 3 2 2 5 4 4 3 2
8 -1 -1 -1 4 1 -1
In the first test case, there’s a desired circle ofpeople. The person with the number will look at the person with the number and the person with the number will look at the person with the number .
In the second test case, there’s no circle meeting the conditions. If the person with the numberis looking at the person with the number , the circle consists of people because these persons are neighbors. But, in this case, they must have the numbers and , but it doesn’t meet the problem’s conditions.
In the third test case, the only circle with the persons with the numbersand looking at each other consists of people. Therefore, the person with the number doesn’t occur in the circle.