New times

Remember the old days when Informatics was a boring discipline, when
bloody algorithms and maths were considered important, and when the
fundamentals of computer science were thought in faculties? (What an
heresy …) Fortunately, those days are over, my friend!

What is very important today is to be prepared for entering into the
fascinating world of consulting: Keeping the balance of thousands of
accounts updated, producing beautifully formatted outputs, wearing
neckties the whole day, … Yes, that’s the way!

Are you prepared for the new times? Let’s check it! In this problem you
will have to keep the balance of several accounts, and produce nicely
written output reports. (It is up to you to wear a necktie or not.)

Input

Input begins with the number of cases. Every case has five kinds of
operations:

- To create a new account with 0 money: NEW <account name>
  Prints an error message if the account already exists.

- To transfer money: TRANSFER <account name 1> <account name
  2> <quantity>
  Prints an error message for each non-existing account.

- To print the current money of an account: QUERY <account name>
  Prints an error message if the account does not exist.

- To remove an account: DELETE <account name>
  Prints an error message if the account does not exist.

- To end a case: END

The names of the accounts are made up only of lower-case letters and
digits. The given quantities and the current money of every account will
always fit into a C++ integer variable.

Output

Begin the output for each case with a line with its number starting
at 1. Afterwards, print a line for every correct query and every error
message, in the same order in which they happen. To make the problem
even more interesting (if possible), every line of the same case must
have the same length, which should be chosen as short as possible. If
needed, add asterisks to the left of error messages, and spaces to the
left of the current money of the accounts. Finish every case with a line
with the appropriate number of dashes. Every given case will have at
least one line of output.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T11:39:18.051Z

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