Problem Statement | |||||||||||||
The scientific program ITES runs on a computer with two CPUs.
The input data for ITES consists of chunks of different sizes, and each chunk has to be
processed in whole by either of the CPUs. The chunks may also be processed in any order.
Both CPUs run at the same speed and require 1 second of time to process any 1 kilobyte of data.
You are given a int[] chunkSizes containing the sizes of the different input chunks in kilobytes. Due to the method by which the input data is gathered, all sizes are multiples of 1024. Return the fastest time in seconds in which all the input can be processed. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
- | Reminder: Your method may use at most 64 megabytes of memory. | ||||||||||||
Constraints | |||||||||||||
- | chunkSizes contains between 0 and 50 elements, inclusive. | ||||||||||||
- | Each element of chunkSizes is between 1024 and 4194304, inclusive. | ||||||||||||
- | Each element of chunkSizes is a multiple of 1024. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|