помогнете ми спешно с решаването на задачата ?


-17

Input

The input data should be read from the console. On the first line you will receive the money Lina has before the shopping starts. She will always receive only one command ”mall.Enter” and only one command “mall.Exit”. When you receive the command “mall.Enter” on every line you will start receiving strings containing information about the purchases/actions Lina plans to make, until you receive the command “mall.Exit”.

Output

The output data should be printed on the console.

When the shopping ends you should print on the console the outputs depending on the number of purchases. If she didn’t make any purchases print:

“No purchases. Money left: {money} lv.”

If she has made at least one purchase, print:

{number of purchases} purchases. Money left: {money} lv.

Money should be formatted to the second digit after the decimal point.

Constraints

  • Money is a floating-point number in the range [0 - 7.9 x 1028].
  • The number of strings between the enter and exit command will be in the range [1 - 20];
  • The number of characters in the string representing the actions are in the range [1 - 20];
  • Allowed working time: 0.1 seconds. Allowed memory: 16 MB.

 

 

Examples

Input Output Comments
110
mall.Enter
d
mall.Exit
 
1 purchases. Money left: 80.00 lv.
 
 ‘d’ has ASCII code 100. It is lowercase, so Lina gets 70% discount of the price, 100 – 70% = 30.
110 – 30 = 80 lv.
Input Output
110
mall.Enter
%
mall.Exit
1 purchases. Money left: 55.00 lv.
 
Input Output
100
mall.Enter
Ab
**
mall.Exit
2 purchases. Money left: 58.10 lv.

 




Отговори



3

Ква е паролата за изпита.

Нещо се изгуби. Да не те хванаха ?




1
То така вярно, че е по-лесно. Направо user и pass. Тъкмо да не пуска за всяка задача по тема хахаха

от kalin.dimchev (645 точки)

1
Питах за паролата на самия изпит. Тяхната система е като bgcoder и изпитите си имат парола.