You and your friend are playing a game with hoops. There are N hoops (where N is odd) in a row. You jump into hoop 1, and your friend jumps into hoop N. Then you jump into hoop 2, and after that, your friend jumps into hoop N−1, and so on.
The process ends when someone cannot make the next jump because the hoop is occupied by the other person. Find the last hoop that will be jumped into.
Aim
The process ends when someone cannot make the next jump because the hoop is occupied by the other person. Find the last hoop that will be jumped into.
Details
Sample Input: 2 1 3 Sample Output: 1 2
Problem Link :https://www.codechef.com/LTIME96C/problems/HOOPS I will be using C++. Please assign me the problem under LGM_SOC'21
Programming language