The only two possibilities for the rest two dimensions are 1) a = 4, b = 2, or 2) a = 2, b = 4. The volume is 4*2*3 = 24 in both cases.