Contrary to common belief, Koalas are very socially active. Ken Koala has been on many matchmaking sites, and is now interested in making his own matchmaking algorithm. Ken's algorithm takes in a koala's favourite number,
Given the inputted value of
Constraints
Input Specification
The input will contain an integer
Output Specification
Output the value of the integer
Sample Input
Copy
15
Sample Output
Copy
14
Explanation for Sample
The optimal
Comments
I got an error trying to submit, it says it's incorrect, but it works, so is this just a DM::OJ thing or is my code wrong?
Please make sure to read the problem statement and input format carefully. The problem takes in only one integer as input, and so you should only read in one integer instead of two. The second integer is chosen to maximize the average of the two numbers, such that the average is an integer less than the first integer. Your program should output that average.
I don't understand, what is X?
The 3 variables are X, N, and A. N is the input, A is the output. Whats X?
X is the value that you add to N. You have to find the maximum value for A. And A = (X + N) / 2. Where X < N.
Hopefully this helps!