Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mini-Max Sum #336

Open
Keshara1997 opened this issue Oct 21, 2024 · 2 comments
Open

Mini-Max Sum #336

Keshara1997 opened this issue Oct 21, 2024 · 2 comments
Assignees

Comments

@Keshara1997
Copy link
Contributor

Problem Statement:

You are given five positive integers. Your task is to calculate:
The smallest sum that can be obtained by adding four out of five integers.
The maximum sum that can be obtained by adding four out of five integers.

Input:

A single line containing five space-separated integers.

Output:

Print two space-separated integers: the sum of the minimum and maximum.

Example:

Sample Input 1:

1 2 3 4 5

Sample Output 1:

10 14

Explanation for sample input 1:

The integers are 1, 2, 3, 4, and 5. You can form the following additions except one integer at a time:
Sum except 1: 2 + 3 + 4 + 5 = 14
2: Sum except 1 + 3 + 4 + 5 = 13
3: Sum except 1 + 2 + 4 + 5 = 12
4: Sum except 1 + 2 + 3 + 5 = 11
5: Sum except 1 + 2 + 3 + 4 = 10
Thus, the minimum sum is 10 and the maximum sum is 14

I request you to assign me this issue please.

@Ghanshyam-07
Copy link
Contributor

please assign it to me

@Keshara1997
Copy link
Contributor Author

@DhanushNehru Please assign me this task under hacktoberfest2k24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants