Maximum Sized Array
Grow the cube one layer at a time, using the bitwise OR of each pair, until the next layer would exceed the sum limit.
Grow the cube one layer at a time, using the bitwise OR of each pair, until the next layer would exceed the sum limit.