  The orbits of the reversible differential system $\dot{x}=-y$, $\dot{y}=x$,
$\dot{z}=0$, with $x,y \in R$ and $z\in R^d$, are periodic with the exception
of the equilibrium points $(0,0, z)$. We compute the maximum number of limit
cycles which bifurcate from the periodic orbits of the system $\dot{x}=-y$,
$\dot{y}=x$, $\dot{z}=0$, using the averaging theory of first order, when this
system is perturbed, first inside the class of all polynomial differential
systems of degree $n$, and second inside the class of all discontinuous
piecewise polynomial differential systems of degree $n$ with two pieces, one in
$y> 0$ and the other in $y<0$. In the first case this maximum number is
$n^d(n-1)/2$, and in the second is $n^{d+1}$.
