Guess Number Higher Or Lower

easy
1. You are playing a game with your friend. Your friend picks a number from 1 to N.
 2. You have to guess the number picked by your friend. Every time you guess wrong, your friend will tell you whether the number is higher or lower.
 3. You call a pre-defined API guess(int num) which returns 3 possible results (-1, 1, or 0):
 -1 : Your friend's number is lower
  1 : Your friend's number is higher
  0 : Congrats! You got it!
 4. For example,
 Input: N = 10
 
 Output: 7
 
 
 Note:
 1. main takes input from the users.
 2. This is a functional problem.
 3. You have to complete the function guessNumber. It takes as input N. It should return the number you have guessed.

Input Format

First line takes input N and the testcase number. Input is handled for you.

Output Format

The number you have guessed. Output is handled for you.

Constraints

N/A

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
10 0
Output
7
Previous
Find Transition Point
Next
Heaters

Related Questions