how to calculate all of possible variants of expression?



excuse me for my english :)

for example I have something like that
a:[1,2];
b:[3,4];

how to do so that c=a*b;

must be ?=[3,4,6,8] (?=[1*3=3, 1*4=4, 2*3=6, 2*4=8])