#P11221. [COTS 2019] 序列操作 K-ti
[COTS 2019] 序列操作 K-ti
Background
Translated from D1T1 of Izborne Pripreme 2019 (Croatian IOI/CEOI Team Selection). .
Problem Description
You are given a sequence of positive integers of length and a positive integer . Note that it is .
Perform operations to delete all elements of . For each operation:
- Let the current length of be .
- Let . Find .
- Let be .
- Delete . The elements after it shift left by one position.
Output the number deleted in each operation.
Input Format
The first line contains two positive integers .
The second line contains positive integers describing .
Output Format
Output lines, each containing one integer: the number deleted in each operation.
10 2
2 3 1 9 10 4 5 6 1 5
10
6
4
5
2
9
3
5
1
1
10 3
2 3 1 9 10 4 5 6 1 5
9
10
4
5
6
2
5
3
1
1
Hint
Constraints
For of the testdata, it is guaranteed that:
- .
- .
| Subtask ID | Score | ||
|---|---|---|---|
Translated by ChatGPT 5