Consider $m$ polynomials $f_i$ for $i=\{1,\dots,m\}$ in $\Bbb R[x_1,\dots,x_n]$ of degree $d_i$ such that $$Z(f_i)\bigcap Z((p))\neq \emptyset$$ for the sphere $p$ passing through $\{0,1\}^n$. What is the minimum degree of polynomials $g_i$ such that $$Z(f_1g_1+\dots+f_mg_m)\bigcap Z((p))=\emptyset$$ for the cases:

$$\mbox{ (A) } \bigcap_{i=1}^{m}Z(f_i)\bigcap Z((p)) = \emptyset$$

$$\mbox{ (B) }\bigcap_{i=1}^{m}Z(f_i)\bigcap Z((p)) \neq \emptyset$$

Can we say anything about the minimum degrees of $g_i$ (both lower and upper bounds)?

The case $(A)$ looks like a generalization of Nullstellansatz since if we replace $(p)$ by $(0)$ which also passes through $\{0,1\}^n$ we get the condition that $f_i$ have no common roots and we get Nullstellensatz framework with the added property that $sum(f_ig_i)=1$ (we here have $\Bbb R$).

A more general case is when $(p)$ is replaced by any ideal $I$ with $Z(I)\supseteq \{0,1\}^n$.