my $c = 0; my @partitions = map { [$c, $c += $_] } @widths;