HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Beginners > problem:


005. 50797 - Nr of Missing Guests

Guest
• Review clarifications (1)

Volume problems

• 51034 - Area of 3 Shapes
• 51032 - Triangle Property
• 51033 - Sum of the series
• 51027 - Download Percentage
• 51028 - Isosceles Triangles
• 50799 - OSHEE Electric Bill
• 51031 - Convert from Hex to Dec
• 51030 - Number of Right Triangles
• 005. 50797 - Nr of Missing Guests
• 007. 50280 - Division
• 028. 50521 - Pound to Grams
• 034. 50502 - Welcome Andi - 1
• 042. 50798 - Passing the course
• 045. 50391 - Cinema Tickets
• 048. 50403 - Number of Chairs
• 052. 50503 - Welcome Andi - 2
• 053. 50501 - The Highest Average

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