HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > Epoka Science Olympiad 2013-2015 > problem:


2015-09Gr-10. 50344 - Profit or Loss

Epoka Science Olympiad 2013-2015

Start: May.18.2013 at 10:00:00 AM
Finish: May.18.2013 at 03:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 2013-11Gr-40. 50317 - Student Line Up
• 2014-10Gr-10. 50424 - Area
• 2014-10Gr-20. 50417 - Fun Fair
• 2014-10Gr-30. 50418 - Student ave...
• 2014-10Gr-40. 50429 - Secret Message
• 2014-11Gr-10. 50430 - ATM
• 2014-11Gr-20. 50420 - Teachers Si...
• 2014-11Gr-30. 50431 - Sultan's Game
• 2015-09Gr-10. 50344 - Profit or...
• 2015-09Gr-20. 50725 - Fibonacci Se...
• 2015-09Gr-30. 50302 - Paper Sciss...
• 2015-09Gr-40. 50303 - Pattern
• 2015-10Gr-10. 50308 - IT Knowledg...
• 2015-10Gr-40. 50322 - Snake Pattern
• 2015-11Gr-10. 50304 - Number Pattern
• 2015-11Gr-20. 50305 - John's Tasks
• 2015-11Gr-30. 50306 - Beautiful N...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
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