There do not exist such partitions $D_1$ and $D_2$. Recall your assumptions: $$\bigcup\limits_{i=1}^{p} A_i=X,\;\bigcup\limits_{i=1}^{q} B_i=X$$ It follows, that for each $x\in X$ there exists a set $A_k$ $(k\in\{1,...,p\})$ and a set $B_j$ $(j\in\{1,...,p\})$ for each $x\in X$, such that $x\in A_k$ and $x\in B_j$. Therefore $x\in (B_j\cap A_k)$ which contradicts that $B_j\cap A_k=\emptyset $.