곱집합
We return Cartesian product of the "n" resulting intervals.