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

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


Molecules

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

• Flowers
• Flowchart 1
• Flowchart 2
• Flowchart 3
• Connected components
• Going to the Movies
• How many digits?
• How many divisors?
• Molecules
• Round numbers
• Tower of Happiness
• Workshop
• Wonder primes
• Arithmetic Operators
• Profits
• Istanbul
• Buying hay

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

Если у вас есть предложения или пожелания по работе 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