Nizovi
Marko's math notebook has two sequences of integers written in it, both of length N. The fuzziness of these sequences is calculated by first reversing the order of the elements in the second sequence and then adding the products of elements in the same positions of the two sequences. 
For example, the fuzziness of the above two sequence of length 6 is 3\cdot2 + (-4)\cdot3 + (-3)\cdot(-1) + (-2)\cdot5 + 2\cdot0 + 0\cdot(-3) = -13. Mirko likes his pairs of sequences to be as fuzzy as possible. He decided to remove B numbers (possibly zero) from the beginning of both sequences and also E numbers (possibly zero) from the end of both sequences, so that the fuzziness is as large as possible. Write a program that finds the values of B and E for which the fuzziness is largest.
6
3 -4 -3 -2 2 0
-3 0 5 -1 3 2
Output
0 3
245
1 1 1 1 1
2 2 2 2 2
Output
0 0
105
5 -5 -5 -5 5
-5 -5 5 -5 -5
Output
2 0
75Submit solution
Sign in to submit a solution.