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

Сборники > Фёдор Меньшиков. Тренировки > задача:


020. 50408 - Molecules

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

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

• 016. 50463 - Drawing a Triangle
• 017. 50423 - Numbers square
• 017. 50537 - esreveR Triangle
• 018. 50344 - Profit or Loss
• 018. 50491 - Brokers
• 018. 50787 - Expected Value
• 019. 50438 - Pattern with stars
• 020. 50485 - Center of gravity of a ...
• 020. 50408 - Molecules
• 022. 50366 - Student Averages (2 G...
• 023. 50437 - Age Labeling
• 024. 50372 - Number Quadruplets
• 025- 2013-Nov-01. 50328 - How far ...
• 026. 50399 - Mobile Base Station
• 026. 50487 - Radius of Inscribed Circle
• 027. Albanian Airlines
• 028. 50483 - Group Total

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

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