Consider a $m\times n$ rectangular grid with $m$ rows and $n$ columns. There are water fountains on some of the squares. A water fountain can spray water onto any of it's adjacent squares, or a square in the same column such that there is exactly one square between them. Find the minimum number of fountains such that each square can be sprayed in the case that
a) $m=4$;
b) $m=3$.
To solve the problem of finding the minimum number of fountains required to cover all squares in a $m \times n$ grid, we need to consider the coverage pattern of each fountain and how to optimally place them.

### Part (a): $m = 4$

1. **Understanding Fountain Coverage**:
   - Each fountain can spray water onto its adjacent squares and a square in the same column such that there is exactly one square between them.
   - For $m = 4$, a fountain placed at $(i, j)$ can cover the squares $(i-1, j)$, $(i+1, j)$, $(i, j-1)$, $(i, j+1)$, and $(i+2, j)$ if $i+2 \leq 4$.

2. **Optimal Placement Strategy**:
   - To cover all rows, we can place fountains in a staggered pattern to ensure maximum coverage.
   - For $m = 4$, placing fountains in every second row and every third column can be a good strategy.

3. **Calculating the Number of Fountains**:
   - Place fountains in rows 1 and 3 (i.e., $i = 1, 3$).
   - For columns, place fountains in every third column (i.e., $j = 1, 4, 7, \ldots$).

4. **General Formula**:
   - The number of fountains required for $m = 4$ and $n$ columns is approximately $2 \times \lceil n/3 \rceil$.

### Part (b): $m = 3$

1. **Understanding Fountain Coverage**:
   - For $m = 3$, a fountain placed at $(i, j)$ can cover the squares $(i-1, j)$, $(i+1, j)$, $(i, j-1)$, $(i, j+1)$, and $(i+2, j)$ if $i+2 \leq 3$.

2. **Optimal Placement Strategy**:
   - For $m = 3$, placing fountains in every row and every third column can be a good strategy.

3. **Calculating the Number of Fountains**:
   - Place fountains in rows 1, 2, and 3 (i.e., $i = 1, 2, 3$).
   - For columns, place fountains in every third column (i.e., $j = 1, 4, 7, \ldots$).

4. **General Formula**:
   - The number of fountains required for $m = 3$ and $n$ columns is approximately $3 \times \lceil n/3 \rceil$.

### Conclusion

For $m = 4$:
\[
\boxed{2 \times \lceil n/3 \rceil}
\]

For $m = 3$:
\[
\boxed{3 \times \lceil n/3 \rceil}
\]