Chain
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Dana chain consisting of k = 4n units. Moreover 2n gold and 2n links - silver. Two robbers want to rightly divide the silver and gold of the chain. Make a program that finds the minimum number of sections of the chain, such that both silver and gold could be divided between two thieves.
Input
The program reads the first number of links k, and then - k the numbers 0 or 1 (0 - a silver link, 1 - gold). All numbers are entered on one line through the gaps.
Output
The program displays a single number - the minimum number of cuts and the number of links between them made cuts. The first section must be as close as possible to the beginning of the chain. N < 10000.
Examples
Input #1
Answer #1
Submissions 254
Acceptance rate 37%