SP6767 SEQFUN - Sequence Function
Description
We define a sequence {x}: {x}={x\_0, x\_1, … , x\_n-1 } where x\_i is a interger.
We have a function f: {x}->{x’} where {x} is a finite sequence.
After we have a finite sequence {x}, we can get f({x}) follow these rules :
(1). Remove all 0 in x : a 0 b 0 c d 0 e f 0 g => a b c d e f g
(2). Turn 1 into 100 and -1 into -100 : a 1 b 1 -1 c d e f g => a 100 b 100 -100 c d e f g
(3). Add all 2^k (k>1) at the end of the sequence : a 2 b 8 c d e 1024 f g => a 2 b 8 c d e 1024 f g 2 8 1024
(4). Add any positive odd prime x at the end of the sequence x-1 times: a 3 b c 7 d e f 5 g => a 3 b c 7 d e f 5 g 3 3 7 7 7 7 7 7 5 5 5 5
(5). For any positive composite number (not 2^k, k>1 ), we just keep it once: a 6 b 6 c d 6 e 4 4 f g => a 6 b c d e 4 4 f g
(6). Keep any t (t
Input Format
One line consists one interger N, the length of {x}. (N
Output Format
The maximal h({y}) where {y} is a consecutive sequence of {x}. ( |h({y})|