Programming contests

ECN selejtező programozó csapatverseny, 2018. április 21.

April 21, 2018 10:15 AM – April 21, 2018 3:15 PM

Currency

When you travel to Hong Kong, the first thing is currency exchange because foreign currencies are not accepted in Hong Kong. Given the exchange rate of different currencies and the amount of Hong Kong Dollars you need, please calculate the corresponding amount of foreign currencies.

Input Specification

The input contains N + 2 lines. The first line contains a number N (N ≤ 15), which means the number of foreign currencies. In the following N lines, each line contains a string of three uppercase alphabetic characters and a positive real number, which indicate the name of the foreign currency and the exchange rate (100 units of the foreign currency against HKD). The last line contains a positive real number, which shows the amount of HKD you want to spend in Hong Kong.

Output Specification

The output should contain N lines. Each line contains the name of a foreign currency and the amount you need to have in that currency (in order to exchange the HKD you want to spend). Real numbers in the output should be rounded to 0.01. The output order of currencies should be the same as the input one.

Sample Input

  1. 8
  2. CNY 112.42
  3. USD 776.22
  4. GBP 973.50
  5. AUD 589.95
  6. CAD 587.70
  7. EUR 826.20
  8. CHF 774.05
  9. DKK 111.10
  10. 1500.00
download as text file

Output for Sample Input

  1. CNY 1334.28
  2. USD 193.24
  3. GBP 154.08
  4. AUD 254.26
  5. CAD 255.23
  6. EUR 181.55
  7. CHF 193.79
  8. DKK 1350.14
download as text file
University of Debrecen; Faculty of Informatics; v. 03/01/2019