Block partitions of sequences

Given a sequence A=(a_1, . . . ,a_n) of real numbers, a block B of A is either a set B={a_i,a_{i+1},. . . ,a_j} where i\le j or the empty set. The size b of a block B is the sum of its elements. We show that when each a_i \in [0,1] and k is a positive integer, there is a partition of A into k blocks B_1, . . . ,B_k with |b_i-b_j|\le 1 for every i,j. We extend this result in several directions and generalize the problem to higher dimensions.