реши задачу на с++ Problem Statement As KEYENCE headquarters have more and more workers,…
- User
реши задачу на с++ Problem Statement As KEYENCE headquarters have more and more workers, they decided to divide the departments in the headquarters into two groups and stagger their lunch breaks.
KEYENCE headquarters have departments, and the number of people in the -th department is . N i (1≤i≤N) K i
When assigning each department to Group or Group , having each group take lunch breaks at the same time, and ensuring that the lunch break times of Group and Group do not overlap, find the minimum possible value of the maximum number of people taking a lunch break at the same time. In other words, find the minimum possible value of the larger of the following: the total number of people in departments assigned to Group , and the total number of people in departments assigned to Group . A B A B A B
Constraints 2≤N≤20 1≤K i ≤10 8
All input values are integers. вот пример входных данных 5 2 3 5 10 12 ответ 17
- Assistant