QOJ.ac

QOJ

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

#23811. 午餐

Statistics

在 JOI 義大利麵店,包含午餐推薦義大利麵和鮮榨果汁的套餐非常受歡迎。點這份套餐時,顧客需要從當天的 $3$ 種義大利麵和 $2$ 種果汁中各選一種。套餐的價格為所選義大利麵和果汁的價格總和減去 $50$ 日圓。

給定某天義大利麵和果汁的價格,請撰寫程式求出當天套餐價格的最小值。

輸入格式

輸入共 $5$ 行,每行包含一個正整數。

  • 第 $1$ 行的整數是第 $1$ 種義大利麵的價格。
  • 第 $2$ 行的整數是第 $2$ 種義大利麵的價格。
  • 第 $3$ 行的整數是第 $3$ 種義大利麵的價格。
  • 第 $4$ 行的整數是第 $1$ 種果汁的價格。
  • 第 $5$ 行的整數是第 $2$ 種果汁的價格。

在給定的輸入資料中,保證所有義大利麵和果汁的價格均在 $100$ 日圓以上、$2000$ 日圓以下。

輸出格式

以單行輸出當天套餐價格的最小值。

範例

範例輸入 1

800
700
900
198
330

範例輸出 1

848

在範例 $1$ 中,將第 $2$ 種義大利麵與第 $1$ 種果汁組合,價格為 $700 + 198 - 50 = 848$,這是當天套餐價格的最小值。

範例輸入 2

1999
1999
100
189
100

範例輸出 2

150

在範例 $2$ 中,將第 $3$ 種義大利麵與第 $2$ 種果汁組合,價格為 $100 + 100 - 50 = 150$,這是當天套餐價格的最小值。

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.