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

Сборники > Chapter 3. Repetition structures > задача:


2. Molecules

Задачи сборника

• 07. Fibonacci Series
• 08. Binary to decimal
• 09. Decimal to binary
• 10. Maximum
• 11. Perfect numbers
• 12. Wonder primes
• 13. Round numbers
• 14. Tower of Happiness
• 2. Molecules
• Степень двойки

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

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