Double Chunks
시간 제한1초메모리 제한2048 MB
초콜릿 바를 여러 조각으로 나눌 때, 같은 합을 갖는 두 덩어리 조각을 최대 몇 개 만들 수 있는지 구한다.
문제
You have a chocolate bar consisting of chunks (numbered from to ). Chunk contains peanut bits. You can divide the chocolate bar into several pieces, with each piece consisting of one or more consecutive chunks. Each chunk can only be part of one piece. The total number of peanut bits in a piece is simply the sum of the peanut bits from each of its chunks.
A piece is considered a double chunk if and only if it consists of exactly two chunks. You are required to divide the chocolate bar into as many double chunks as possible, all having the same total number of peanut bits. Determine the maximum number of double chunks you can get while satisfying this requirement.
입력
The first line consists of an integer ().
The second line consists of integers ().
출력
Output a single integer representing the maximum number of double chunks you can get while satisfying the requirement.