QOJ.ac

QOJ

Time Limit: 10 s Memory Limit: 256 MB Total points: 100

#23811. Lunch

Statistics

At the JOI Pasta Shop, a lunch set menu featuring a recommended pasta dish and freshly squeezed juice is very popular. When ordering this set menu, a customer chooses one pasta dish from the $3$ kinds of pasta of the day and one juice from the $2$ kinds of juice of the day. The price of the set menu is the sum of the prices of the chosen pasta and juice minus $50$ yen.

Given the prices of the pasta dishes and juices on a certain day, write a program to find the minimum possible price of the set menu on that day.

Input

The input consists of $5$ lines, each containing a single positive integer.

  • The integer on the $1$-st line is the price of the $1$-st pasta dish.
  • The integer on the $2$-nd line is the price of the $2$-nd pasta dish.
  • The integer on the $3$-rd line is the price of the $3$-rd pasta dish.
  • The integer on the $4$-th line is the price of the $1$-st juice.
  • The integer on the $5$-th line is the price of the $2$-nd juice.

In the given input data, it is guaranteed that the prices of all pasta dishes and juices are between $100$ yen and $2000$ yen, inclusive.

Output

Output the minimum possible price of the set menu on that day in a single line.

Sample Input and Output

Sample Input 1

800
700
900
198
330

Sample Output 1

848

In Sample $1$, combining the $2$-nd pasta dish and the $1$-st juice gives $700 + 198 - 50 = 848$, which is the minimum price of the set menu on that day.

Sample Input 2

1999
1999
100
189
100

Sample Output 2

150

In Sample $2$, combining the $3$-rd pasta dish and the $2$-nd juice gives $100 + 100 - 50 = 150$, which is the minimum price of the set menu on that day.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.