  The space $QSym_n(B)$ of $B$-quasisymmetric polynomials in 2 sets of $n$
variables was recently studied by Baumann and Hohlweg. The aim of this work is
a study of the ideal $<QSym_n(B)^+>$ generated by $B$-quasisymmetric
polynomials without constant term. In the case of the space $QSym_n$ of
quasisymmetric polynomials in 1 set of $n$ variables, Aval, Bergeron and
Bergeron proved that the dimension of the quotient of the space of polynomials
by the ideal $<QSym_n^+>$ is given by Catalan numbers $C_n=\frac 1 {n+1} {2n
\choose n}$. In the case of $B$-quasisymmetric polynomials, our main result is
that the dimension of the analogous quotient is equal to
$\frac{1}{2n+1}{3n\choose n}$, the numbers of ternary trees with $n$ nodes. The
construction of a Gr\"obner basis for the ideal, as well as of a linear basis
for the quotient are interpreted by a bijection with lattice paths. These
results are finally extended to $p$ sets of variables, and the dimension is in
this case $\frac{1}{pn+1}{(p+1)n\choose n}$, the numbers of $p$-ary trees with
$n$ nodes.
