# multiplying/dividing two unequal lists

I have two list which are not equal dimension:

listA = {{{1, 2}, {2, 2}, {3, 4}}, {{1, 1}, {2, 2}, {3, 3}}};
listB = {{4, 4}, {5, 5}};

And I want to divide them or multiply the such as the results has the same dimensions, for the first dimension, it should look like:

(#*listB[[1]]) & /@ listA[[1]]

but I would like to do it all at once so that the result has the same dimension as listA. I bet it has probably been answered here but I cannot seem to find it. Therefore link to an existing answer is also great.

• How about Table[(#*listB[[i]]) & /@ listA[[i]], {i, Length[listB]}] – bill s Sep 23 '16 at 21:18
• MapThread[(Function[{x}, x #2] /@ #1) &, {listA, listB}]? – march Sep 23 '16 at 21:48
• Related: (23395) – Mr.Wizard Sep 24 '16 at 6:30

Some overhead but the most clean solution I could muster:

Diagonal@Outer[Times, listB, listA, 1, 2]

{{{4, 8}, {8, 8}, {12, 16}}, {{5, 5}, {10, 10}, {15, 15}}}

Using Simon Woods's smartThread one may write: