Collection of numbers

Write a program to keep a collection of integer numbers, perhaps with
repetitions, while performing the following operations:

- ‘S’ x : Stores a copy of the given number x.

- ‘A’ : Asks for the greatest number.

- ‘R’ : Removes the greatest number (one of them, if it is repeated).

- ‘I’ x : Increases the greatest number (one of them, if it is repeated)
  in x units.

- ‘D’ x : Decreases the greatest number (one of them, if it is repeated)
  in x units.

Input

Input consists of several operations.

Output

For every query, the current greatest number. Print also an error line
for each operation (except storing) when the collection is empty.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T11:03:47.515Z

© Jutge.org, 2006–2026.
https://jutge.org
