Parameters
n - number of inputs
m - number of simultaneous outputs

Bfunc constants
Term max
Prime max

Cube max
; k = n div 3

Count1 max

Count2 max
MAX;
Product max

Term comparisons

Brute force

Both 0/1*

Both 0/1/X
* - Bfunc method