J. Customer support
Ограничения: время – 2s/4s, память – 64MiB Ввод: input.txt или стандартный ввод Вывод: output.txt или стандартный вывод 
Послать решение Blockly Посылки Темы Где Обсудить (0)

8:05
Позвонил юзер, сказал, что забыл пароль. Посоветовал ему воспользоваться утилитой восстановления паролей, которая называется FDISK. Находясь в блаженном неведении, он меня поблагодарил и отключился. Господи, мы ведь еще позволяем таким людям водить машину и голосовать на выборах!
8:14
Позвонил юзер с 8:05, сказал, что получил сообщение "Error accessing Drive 0." Сказал ему, что это ошибка операционной системы. Направил его в службу поддержки Майкрософт.
15:00
Еще один юзер (похоже, новичок). Говорит, не работает макрос периодического запуска. Предложил добавить в конец кода макроса @DeleteDocument . Пообещал прислать приложение к инструкции, где описан такой способ.
IT department in an "System Administrators, Ltd" company
has call center for answering users' questions.
Support prices are as follows:
1. | Answer to a question | 10 USD |
2. | Correct answer to a question | 20 USD |
3. | Correct answer to a question with explanation | 40 USD |
4. | Correct answer to a question which was already correctly answered before | +10 USD for each previous correct answer |
So, for example, if user asks the same question three times,
first receives incorrect answer, then correct one, and the third time correct answer with explanation,
it will cost him 10 + 20 + (40 + 1 ⋅ 10) = 80 USD.
Users are billed monthly according to call log.
Company specialists review the log and for each question determine:
- unique number, so the equivalent questions have same numbers,
- whether the answer was correct,
- whether the answer was short or included detailed enough explanation.
Given that data, your program must calculate the payment amount.
Input
Input file contains number of calls N followed by N triples qi ai xi, where
qi is integer question number, ai = 1 if the answer was correct, 0 otherwise,
xi = 1 if explanation was given, 0 otherwise.
Output
Output file must contain a single number – payment amount.
Constraints
1 ≤ N ≤ 10000, 1 ≤ qi ≤ 106.
Sample Input 1
1
9834 0 1
Sample Input 2
3
33 1 0
33 0 0
33 1 1
Source: A. Klenin, ICPC NEERC Far-Eastern subregional, 2006