#K12431. Minimum Seating Distance
Minimum Seating Distance
Minimum Seating Distance
You are given an integer n
representing the number of people to be seated. Each bench can accommodate at most two people. When all benches are occupied, if there is only one bench (or the situation allows two people to share the same bench), the distance between the two people is considered 0. However, if there are three or more people, at least one individual must sit on a separate bench resulting in a minimum distance of 1 between some two persons.
Your task is to compute the minimum distance between any two people under these seating conditions.
Hint: If n
is less than or equal to 2, the answer is 0; otherwise, the answer is 1.
inputFormat
The input consists of a single integer n
on standard input, which indicates the number of people to be seated.
outputFormat
Output a single integer representing the minimum distance between any two people. The output should be written to standard output.
## sample1
0