7021.Multiplication Table

Time Limit: 1s Memory Limit: 512MB

Find the middle element when the numbers in an $n \times n$ multiplication table are sorted in increasing order. It is assumed that $n$ is odd.

For example, the $3 \times 3$ multiplication table is as follows: $$

\begin{matrix}
1 & 2 & 3 \
2 & 4 & 6 \
3 & 6 & 9 \
\end{matrix}

$$ The numbers in increasing order are $[1,2,2,3,3,4,6,6,9]$ , so the answer is $3$ .

Input Format(From the terminal/stdin)

The only input line has an integer $n$ .

  • $1 \le n < 10^6$

Output Format(To the terminal/stdout)

Print one integer: the answer to the task.

Sample Input

Copy
3
 \n

Sample Output

Copy
3
 \n
Source: CSES, Additional Problems I, 2422

Submit

请先 登录

© 2025 FAQs