P9420 [Lanqiao Cup 2023 Final National B] Sub 2023 / Twin Numbers.

Description

## A Sub 2023 Xiao Lan wrote all integers from $1$ to $2023$ on the blackboard one after another, obtaining a digit sequence: $$S = 12345678910111213\cdots 20222023$$ Xiao Lan wants to know how many subsequences in $S$ are exactly equal to $2023$. As a hint, the following are $3$ subsequences that satisfy the requirement (the digits marked in square brackets are the digits included in the subsequence): $$1[\textbf2]34567891[\textbf0]111[\textbf2]1[\textbf3]14151617181920212223 \cdots$$ $$1[\textbf2]34567891[\textbf0]111[\textbf2]131415161718192021222[\textbf3] \cdots$$ $$1[\textbf2]34567891[\textbf0]111213141516171819[\textbf2]021222[\textbf3] \cdots$$ Note that the following does not satisfy the requirement. Although it contains the four digits $2$, $0$, $2$, and $3$, the order is incorrect: $$1[\textbf2]345678910111[\textbf2]131415161718192[\textbf0]21222[\textbf3] \cdots$$ ## B Twin Numbers If a positive integer $x$ can be written as $p^2 \times q^2$, where $p$ and $q$ are prime numbers and $p \neq q$, then $x$ is a “twin number”. Please compute how many “twin numbers” are in the interval $[2333, 23333333333333]$.

Input Format

Input one uppercase letter, indicating which problem it is.

Output Format

According to the input problem label, output the answer of the corresponding problem.

Explanation/Hint

Answer template (for reference). ```cpp #include using namespace std; int main() { string ans [] = { "The answer of task A", // Replace the content in double quotes with the answer for Problem A. "The answer of task B", // Replace the content in double quotes with the answer for Problem B. }; char T; cin >> T; cout