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

Разделы > Арифметика > задача:


50408 - Molecules

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

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

• Albanian Airlines
• 50243 - Sum of digits
• 50241 - Greatest common divisor
• 50240 - The numbers that are divisi...
• 50242 - Numbers whose sum of the...
• 50248 - Power of two
• 50341 - Separate Into Digits
• 50335 - Five Math Operators
• 50408 - Molecules
• 50304 - Number Pattern
• 50305 - John's Tasks
• 50649 - Puzzle
• 50321 - Missing Number
• 50308 - IT Knowledge Seminars
• 50293 - Sum of odd numbers from ...
• 50401 - Sum of Odd Numbers
• 50365 - Sum of the numbers from a...

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

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

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

Molecules

A molecule is a chemical structure that is made up of more than 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.

Question:
Write a program that calculates the mass of a molecule.

Input specification
The first line of the input contains an integer (n) that denotes the number of the atoms in the molecule where n i between 1 and 100. 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.

Output specification
Show just one integer number: total weight of the molecule.

Sample Input I   
  2
  1 2
  16 1
Sample Output I   
  18


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

www.contester.ru