HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Arithmetic > problem:


50192 - Nr of Missing Guests

Section problems

• 50139 - Multiplication Table - 2
• 50145 - Close City
• 50149 - Albanian Airlines
• 50150 - Divisible by m
• 50159 - Triangular Numbers
• 50162 - Mersenne prime
• 50164 - The roots of a quadratic eq...
• 50172 - Permutations and Combinat...
• 50192 - Nr of Missing Guests
• 50198 - Euro to Leke
• 50201 - Total Discount for the clients
• 50202 - Buying Books from Internet
• 50215 - ZScore normalization
• 50232 - Sum of Even Numbers
• 50239 - Basic Math Calculator
• 50246 - Ascending Numbers
• 50247 - Descending Numbers

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 Ibrahim Mesecan.

Nr of Missing Guests

You are organizing a meeting and there are 4 tables of people. Different number of people are going to sit around every table, a, b, c, and d. There are a few minutes to the meeting and you count current number of people sitting, k, l, m, and n.

Question: Calculate and show the number of missing people.

Input specification
Firstly, you will be given four integers: a, b, c, and d the number of people who can sit around each table. Then, you will be given four other numbers where all numbers are between 0 and 20.

Output specification
Show just one number: total number of missing people.

Sample Input 1
3 5 4 5
1 4 2 5
Sample Input 2
4 3 5 4
4 3 4 3
Sample Output 1
5
Sample Output 2
2

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

www.contester.ru