>function test ...
$ loop 1 to 10000000
$ v=intrandom(1,intrandom(6)+6,20)-10;
$ if sum(maxsubs(v))!=sum(maxsubsbrute(v)) then
$ v, error("Found a wrong test example");
$ endif;
$ endfunction
>test