Skip to content

Latest commit

 

History

History

05-MinMaxSum

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Min Max Sum

Introduction

Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers. Then print the respective minimum and maximum values as a single line of two space-separated long integers.

Example

arr=[1, 3, 5, 7, 9]

The minimun sum is: 1 + 3 + 5 + 7 = 16

The maximun sum is: 3 + 5 + 7 + 9 = 24

So the function prints:

16 24

Print

Print two space-separated integers on one line: the minimum sum and the maximum sum 4 of of 5 elements.

Sample Input

[1, 2, 3, 4, 5]

Sample Output

10 14