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

Турниры > Epoka Science Olympiad 2013-2015 > задача:


2014-11Gr-20. 50420 - Teachers Sightseeing

Epoka Science Olympiad 2013-2015

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

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

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

• 2013-11Gr-20. 50315 - Pig Latin
• 2013-11Gr-30. 50316 - Population B...
• 2013-11Gr-40. 50317 - Student Line Up
• 2014-10Gr-10. 50424 - Area
• 2014-10Gr-20. 50417 - Fun Fair
• 2014-10Gr-30. 50418 - Student ave...
• 2014-10Gr-40. 50429 - Secret Message
• 2014-11Gr-10. 50430 - ATM
• 2014-11Gr-20. 50420 - Teache...
• 2014-11Gr-30. 50431 - Sultan's Game
• 2015-09Gr-10. 50344 - Profit or Loss
• 2015-09Gr-20. 50725 - Fibonacci Se...
• 2015-09Gr-30. 50302 - Paper Sciss...
• 2015-09Gr-40. 50303 - Pattern
• 2015-10Gr-10. 50308 - IT Knowledg...
• 2015-10Gr-40. 50322 - Snake Pattern
• 2015-11Gr-10. 50304 - Number Pattern

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

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

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

Teachers Sightseeing Tour in Konya

Question: A group of teachers go to Konya for sightseeing. After visiting for a while, they go to a restaurant for lunch. There are different types of foods there. Everyone has ordered different food with different prices. After the meal, everyone paid the money and then they left the restaurant. Group leader wants to know the total amount paid to the restaurant, and the list of all teachers from the most payers to the least payers. Write a program to make the teacher's job easier.

Input specification
On the first line types of food N(N ≤ 100), on the next line prices of the each food type (price ≤1000) with a single space, on the next line the number of teachers, on the next lines the name of the teacher and the following line the number of portion(s) of each food. If the food has not, there is written 0 (zero).

Output specification
on the first line show the total money spent, and on the following lines show the list of teachers from the most payers to the least payers. If the amount of the money paid by teachers is equal, show them in order of input.

 Sample Input I     Sample Input II   
 3
 50 100 150
 2
 Alban
 1 0 1
 Ylber
 0 2 1
 5
 10 20 30 40 50
 4
 Ali
 1 0 0 0 0
 Rovsen
 0 2 0 0 1
 Yusuf
 0 0 1 1 0
 Kilicbek
 1 1 1 1 1
 Sample Output I     Sample Output II   
 550
 Ylber
 Alban

 320
 Kilicbek
 Rovsen
 Yusuf
 Ali


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

www.contester.ru