#P5436. The Fate Between Master and Disciple
The Fate Between Master and Disciple
The Fate Between Master and Disciple
One Zen (一禅) wonders about the strength of his fate with his master (师父). To decide this, they agree on a positive integer \( n \). Then each secretly chooses a positive integer not exceeding \( n \). Zen believes that the larger the least common multiple (LCM) of the two chosen numbers, the stronger the bond between him and his master.
The master is curious to know: what is the maximum possible LCM when both choose their numbers optimally?
Note: When \( n = 1 \), the only possible number is 1, so the answer is 1. For \( n \ge 2 \), the maximum LCM is attained by choosing \( n \) and \( n-1 \) since consecutive integers are coprime. Hence, the answer is \( n \times (n-1) \).
inputFormat
The input consists of a single integer \( n \) (\( 1 \le n \le 10^9 \)).
outputFormat
Output a single integer representing the maximum possible least common multiple (LCM) between any two positive integers not exceeding \( n \).
sample
1
1