ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > IMPC - 2013-2014 > задача:


2013-Nov-02. 50347 - Selling Oranges

IMPC - 2013-2014

Старт: 16.мар.2013 в 12:00:00
Финиш: 16.мар.2013 в 17:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (1)

Задачи турнира

• 2013-05-10. 50552 - Kepuce te perd...
• 2013-05-30. 50580 - Sa dite kane ka...
• 2013-05-40. 50553 - I pjestueshem...
• 2013-05-50. 50593 - Transportimi
• 2013-12-10. 50352 - Selling Cows
• 2013-12-40. 50342 - 100 Factorial
• 2013-12-50. 50674 - Collecting Eggs
• 2013-Nov-01. 50328 - How far away
• 2013-Nov-02. 50347 - Selling O...
• 2013-Nov-05. 50354 - Intersecting ...

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

Selling Oranges

Mr. Ilir Dardani produces oranges and export them. When exporting he puts the oranges into bins (buckets) according to their sizes. Thus according to their sizes the prices change.

The size of oranges vary, usually upto 15cms. They are put into m bins with the sizes b1, b2, b3..., bm. And it's known that the bin sizes are in increasing order. An orange fits into bini if its size is greater than or equal to bini but is less than bini+1. Mr. Dardani wants to put all oranges to the biggest bin that they fit.

Question:
Write a program that is going to read bin and orange information and calculate the total sell price.

Input specification
There are two numbers at the beginning: the number of bins (m) and the number of oranges (n) where 1 ≤ m ≤ 10 and 1 ≤ n ≤ 50000. The following m lines give the size of bins followed by price of each orange in that bin, whe size of bins are between 1 and 15 and price of each orange is $0.10 and $2.50. The following line gives n positive floating point numbers between 1 and 15.

Output specification
Show the total sell price.

Sample Input I
  3 6
  1 0.3
  6 0.8
  12 1.5
  12.4 6.8 14 5 4.7 9
Sample Input II
  5 10
  1 0.3
  3 0.5
  6 0.8
  9 1
  12 1.5
  5 3 8.2 9.1 6 9 1 10 15 4.6
Sample Output I
  5.2
Sample Output II
  7.9


Для отправки решений необходимо выполнить вход.

www.contester.ru