#K35282. Maximum Product of Contiguous Integers
Maximum Product of Contiguous Integers
Maximum Product of Contiguous Integers
Given a positive integer \(n\), consider the consecutive integers from 1 to \(n\) inclusive. Your task is to determine the maximum product obtainable by multiplying any two consecutive integers. More formally, compute
$$\max_{1 \leq i < n} (i \times (i+1))$$
If \(n < 2\), there are fewer than two numbers available, so output 0.
inputFormat
The input consists of a single integer \(n\) provided via standard input.
outputFormat
Output a single integer representing the maximum product of two consecutive integers from 1 to \(n\). If \(n < 2\), output 0.
## sample1
0
</p>