#P2368. EXCEEDED WARNING B

EXCEEDED WARNING B

Description

Find how many nn-digit integers have squares ending with 987654321987654321.

Input Format

A single integer nn.

Output Format

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

8
0

Hint

1n1061 \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