acmsguru |
---|
Закончено |
d" followed by a single integer gi (1 ≤ gi ≤ 104) — the number of coins the dragon keeps. The letter and the integer are separated by a single space.
p" followed by a single integer bi (1 ≤ bi ≤ 2·105) — the beauty of the princess. The letter and the integer are separated by a single space. It is guaranteed that the last cell contains a princess.
-1in the first line of the output.
sample input | sample output |
6 d 10 d 12 p 2 d 1 p 2 | 13 2 3 5 |
sample input | sample output |
6 d 10 d 12 p 2 d 1 p 3 | -1 |
Название |
---|