QOJ.ac

QOJ

حد الوقت: 2 s حد الذاكرة: 64 MB مجموع النقاط: 100

#23756. Score

الإحصائيات

Two ($2$) students at JOI High School, student A and student B, took examinations in $4$ subjects: Informatics, Mathematics, Science, and English. Given the scores of student A and student B in these $4$ subjects, write a program that outputs the larger of student A's total score $S$ and student B's total score $T$. However, if their total scores are equal, output $S$ ($= T$).

Input

The input consists of $2$ lines.

Line $1$ contains $4$ integers separated by $1$ space, representing student A's score in Informatics, score in Mathematics, score in Science, and score in English, in this order.

Line $2$ contains $4$ integers separated by $1$ space, representing student B's score in Informatics, score in Mathematics, score in Science, and score in English, in this order.

The score for each subject is out of $100$ points, and no negative score is given.

Output

The output consists of $1$ integer representing the required value.

Examples

Input 1

100 80 70 60
80 70 80 90

Output 1

320

Input 2

100 80 70 60
80 70 60 100

Output 2

310

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.