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

Разделы > Неотсортированные > задача:


Molecules

Задачи раздела

• Maximum
• Tickets
• Flowers
• Istanbul
• T-shirts
• Dijkstra
• Workshop
• Big Dance
• Molecules
• Leap Year
• Factorial
• Rectangle
• City Tour
• Buying hay
• Sum until 0
• Flowchart 1
• Flowchart 2

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

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

Лимит времени 1000/1000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.

Calculate the mass of a molecule. A molecule is a chemical structure that is made up of more then one atom. H2O is the molecule of water. It contains two hydrogen and one oxygen atoms. The weight of hydrogen is 1, and the weight of oxygen is 16. Thus the weight of water molecule is 2*1 + 16*1 = 18.

The first line of the input contains an integer (N) that denotes the number of the atoms in the molecule. Each of the following N lines denotes an atom of the molecule with two integers. The first integer is the mass of the atom, and the second integer is the quantity of the atom.

cin cout
2
1 2
16 1
18
4
1 2
5 3
2 4
10 3
55
Для отправки решений необходимо выполнить вход.

www.contester.ru