Reconstruct a 3d arrangement of cubes from two of its projections Setup

Take the following 4x4x4 cube along with a 2D view of 3 of its faces, with a common 1x1x1 cube highlighted:



The arrows represent the points of view that generated the V1, V2 and V3 faces drawn underneath the big cube.

Given an arrangement of some 1x1x1 cubes inside the main cube we can try and identify it with only three projections. For example, the arrangement below:



could be represented as follows:

V1
X...
....
....
XXXX

V2
X...
X...
X...
X..X

V3
X...
X...
X...
XXXX


However, if we consider only projections on V1 and V2, most of the time we can't identify uniquely the arrangement being considered.(there are arrangements that can't be uniquely identified, even with the 6 projections)

Task

Given projections on V1 and V2, output the minimum and maximum number of 1x1x1 cubes that an arrangement could have and still produce the projections V1 and V2.

I'll walk you through 2 examples:

Explained example 1

V1
XXXX
....
....
....

V2
X...
X...
X...
X...


These two projections signal some directions along which there must be cubes:



and the output would be 4, 16; This is the case because both V3 below represent valid projections on V3:

V3a
X...
.X..
..X.
...X


This is a "diagonal" pattern of cubes in the back plane, when viewed from V3; ...

V3b
XXXX
XXXX
XXXX
XXXX


and this is a full face in the back plane.

Explained example 2

V1
XXXX
XXXX
XXXX
XXXX

V2
XXXX
....
....
....


These projections represent the top face of the main cube, so in this case we managed to identify the arrangement uniquely. The output in this case would be 16, 16 (or 16, see output rules below).

Input

Your code takes the projections on V1 and V2 as input. There are a variety of reasonable ways for you to take this input. I suggest the following to represent each projection:


An array of length 4 with strings of length 4, two different characters to encode "empty" or "filled", like ["X...", ".X..", "..X.", "...X"] for the V3a above.
An array/string of length 16, representing the 16 squares of the projection, like "X....X....X....X" for V3a above.
An integer where its base 2 expansion encodes the string above; 1 must represent the X above, so V3a above would be 33825 = b1000010000100001.


For any of the alternatives above, or for any other valid alternative we later decide that is helpful for you guys, you can take any face in any orientation you see fit, as long as it is consistent across test cases.

Output

The two non-negative integers representing the minimum and maximum possible number of 1x1x1 cubes in an arrangement that projects onto V1 and V2 like the input specifies. If the minimum and maximum are the same, you can print only one of them, if that helps you in any way.

Test cases

(I didn't really know how to format these... if needed, I can reformat them! Please let me know.)

XXXX
....
....
....,
X...
X...
X...
X... -&gt; 4, 16

XXXX
XXXX
XXXX
XXXX,
XXXX
....
....
.... -&gt; 16, 16

XXXX
XXXX
XXXX
XXXX,
XXXX
....
..X.
.... -&gt; 16, 20

X..X
.XX.
.XX.
X..X,
X.XX
.X..
..X.
XX.X -&gt; 8, 16

XXXX
XXXX
XXXX
XXXX,
XXXX
XXXX
XXXX
XXXX -&gt; 16, 64

X...
....
....
XXXX,
X...
X...
X...
X..X -&gt; 8, 8

X..X
....
....
XXXX,
X...
X...
X...
X..X -&gt; 8, 12




This is code-golf so shortest submission in bytes, wins! If you liked this challenge, consider upvoting it! If you dislike this challenge, please give me your feedback. Happy golfing!
APL (Dyalog Unicode), 11 bytes



+.(⌈,×)/+⌿¨


Try it online!

Takes V1 and V2 as two binary matrices inside a nested vector, and V1 is rotated so that it vertically lines up with V2. Returns doubly nested vector of (min, max).

How it works

The first column of V1 and the first column of V2 decide the first vertical layer of 4x4 cells. If n cells are shaded in V1's column and m cells in V2's, the minimum number of shaded cells in the corresponding 4x4 layer is max(m,n), and the maximum is m * n.

min          |  max
  | 1 0 1 0  |    | 1 0 1 0
-----------  |  -----------
1 | 1 0 0 0  |  1 | 1 0 1 0
1 | 1 0 0 0  |  1 | 1 0 1 0
0 | 0 0 0 0  |  0 | 0 0 0 0
1 | 0 0 1 0  |  1 | 1 0 1 0


Therefore, it suffices to count ones in each column, and evaluate sums of the pairwise max (for minimum) and pairwise product (for maximum) of the column sums.

+.(⌈,×)/+⌿¨
        +⌿¨  ⍝ In each matrix, evaluate column sums
       /     ⍝ Over the two vectors,
+. ⌈         ⍝ Evaluate the sum of pairwise max
    ,        ⍝ and
+.   ×       ⍝ the sum of pairwise product