A and B form two halves of a partition of X, so then the product of all the elements of X is the same as the product PA*PB. Then this value is 8!=40320.
There is a classic problem "Given the product of two positive numbers is Z, what is the smallest possible sum of the two numbers?" The answer is that each number equals sqrt(Z), with a sum 2*sqrt(Z).
So then to adapt this to our problem, we want to factor 8! into two parts, by partitioning the integers 1-8, so that the two terms are as close as possible.
sqrt(8!) ~= 200.8. PA=1*5*6*7=210 and PB=2*3*4*8=192 is the closest we can get by shuffling around the integers 1-8. Then the minimum possible value of PA+PB is 210+192=402.