You have two identical drives and must record CDs. The recording time for each CD is given in the array A_1, A_2, \ldots, A_K. Your task is to determine the minimum time required to record all the CDs, with each CD being recorded fully on one of the drives.
The first line contains the integer , representing the number of CDs. The second line contains the elements of the array A_1, A_2, \ldots, A_K, where each element is a natural number not exceeding , representing the recording time for each CD.
Output the minimum time required to complete the recording of all CDs.
Example 1