#### Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

## Problem Description

White Rabbit is making milk! Black Rabbit is excited to try the new White Rabbit Milk launched at 7-11 stalls today.

There are *N* stalls. Black Rabbit wants to choose a contiguous section (of at least size 1) of stores to buy Rabbit Milk, and the satisfaction he gains is the product of quality across all the stores. However, White Rabbit's Milk has inconsistent quality, and may even be zero or negative. Store i has quality A_{i}. What is the maximum satisfaction he can gain?

It is guaranteed that for any contiguous section of stalls, the absolute value of the product of their quality doesn't exceed 10^{17}.

## Input

The first line of input will contain two integers, *N*.

The next line contains N integers, describing the quality of Rabbit Milk, A_{i}, of each store.

## Output

The output should contain one integer, the maximum number of satisfaction Black Rabbit can gain.

## Limits

For all subtasks: 1 ≤ N ≤ 1 000 000. -3 ≤ A_{i} ≤ 3

Subtask 1 (12%): N ≤ 400.

Subtask 2 (36%): N ≤ 4000.

Subtask 3 (8%): A_{i} ≥ 0.

Subtask 4 (24%): A_{i} ≠ 0.

Subtask 5 (20%): No additional constraints.

Subtask 6 (0%): Sample.

## Sample Input

7 -1 2 -3 1 -2 0 3

## Sample Output

12

## Explanation

If he takes the 2nd to 5th stalls, he gets a total of 12 satisfaction.

### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 12 | 10 | 1s | 256MB | Minimum |

2 | 36 | 15 | 1s | 256MB | Minimum |

3 | 8 | 7 | 1s | 256MB | Minimum |

4 | 24 | 6 | 1s | 256MB | Minimum |

5 | 20 | 30 | 1s | 256MB | Minimum |

6 | 0 | 1 | 1s | 256MB | Minimum |

### Judge Compile Command

g++-8 ans.cpp -o rabbitmilk -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512