#P10729. [NOISG 2023 Qualification] Dolls
[NOISG 2023 Qualification] Dolls
Problem Description
Marc is teaching kindergarten children, and he chooses nesting dolls to help them understand the sizes of objects.
Each nesting doll has its own size, denoted by . If the sizes and of two dolls and satisfy , then doll can be put inside doll .
Clearly, dolls can be nested in multiple layers. So Marc wants you to answer some questions:
These questions last for days. On day , Marc buys a nesting doll of size . After buying the -th doll, he wants you to find the maximum number of layers that can be nested using the first dolls.
Input Format
The first line contains a positive integer .
The second line contains integers, representing .
Output Format
Output one line with positive integers. The -th integer represents the maximum number of layers that can be nested using the first dolls.
5
1 2 3 4 5
1 1 2 2 3
5
2 4 6 8 10
1 2 3 4 5
5
3 3 1 3 2
1 1 2 2 2
Hint
Constraints
| Score | Special Property | |
|---|---|---|
| Sample | ||
| is odd | ||
| is not a multiple of | ||
| None | ||
For of the testdata, .
Translated by ChatGPT 5