Oops, you're right, I forgot to calculate the conditional distribution of X. Its conditional mean is B/2, as you say, and that shifts the quadratic to maximize at B=0.
---------- Post added at 05:19 PM ---------- Previous post was at 04:37 PM ----------
B=0 is the best bet if the intention...