You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: