Let $f : [ 0,3 ] \rightarrow \mathrm { A }$ be defined by $f ( x ) = 2 x ^ { 3 } - 15 x ^ { 2 } + 36 x + 7$ and $g : [ 0 , \infty ) \rightarrow B$ be defined by $\mathrm { g } ( x ) = \frac { x ^ { 2025 } } { x ^ { 2025 } + 1 }$. If both the functions are onto and $\mathrm { S } = \{ x \in \mathbf { Z } : x \in \mathrm {~A}$ or $x \in \mathrm {~B} \}$, then $\mathrm { n } ( \mathrm { S } )$ is equal to :\\
(1) 29\\
(2) 30\\
(3) 31\\
(4) 36