P2368 EXCEEDED WARNING B

Background

SGU 107.

Description

Find how many $n$-digit integers have squares ending with $987654321$.

Input Format

A single integer $n$.

Output Format

The answer, i.e., the number of **“$\bm{n}$-digit integers whose squares end with $\bm{987654321}$”**.

Explanation/Hint

$1 \le n \le 10^6$. Don't ask how many test points brute force can pass; I can only say hehe. Translated by ChatGPT 5