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

Разделы > Linear Data Structures: Arrays > задача:


50344 - Profit or Loss

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

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

• 50594 - Transformimet
• 51182 - Count and Sum 2
• 51193 - The max element of k-th co...
• 51194 - The difference between max...
• 51196 - The sum of two arrays
• 51197 - Even and odd Numbers
• s
• 50423 - Numbers square
• 50344 - Profit or Loss
• 50445 - Cryptography
• 50410 - Zero Padding
• 50380 - Sum of the Numbers in the ...
• 50300 - Matrix
• 50611 - Максимум из минимумов
• 50616 - Змейка
• 50647 - Спираль
• Dhomat e hotelit

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

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

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

Profit or Loss

The sales manager at Premium Paper wants a program that allows her to enter the company’s income (i) (i < 1000000) and expense (e) (e < 1000000) amounts, which always will be integers. The number of income and expense amounts may vary each time the program is run. For example, the sales manager may need to enter five income amounts and three expense amounts. Or, she may need to enter 20 income amounts and 30 expense amounts. The program should calculate and display the company’s total profit or loss (the difference).

Input specification
In the first line you will enter "Total Number of Incomes" and in the following line the amounts of the incomes will be entered. Then, in the third line "Total Number of Expenses" will be entered. After that in the last line you will enter amounts of expenses.

Output specification
Only a single number (difference) will be displayed.

Sample Input I
3
5000 7500 3350
2
1250 950
Sample Input II
4
2000 4000 6000 8000
1
5000
Sample Input III
1
6000
1
10000
Sample Output I
13650
Sample Output II
15000
Sample Output III
-4000


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

www.contester.ru