In every cell of a board $9 \times 9$ is written an integer. For any $k$ numbers in the same row (column), their sum is also in the same row (column). Find the smallest possible number of zeroes in the board for
$a)$ $k=5;$
$b)$ $k=8.$ 
### Part (a): \( k = 5 \)

1. **Assume there are at least two non-zero numbers with the same sign in a row:**
   - Without loss of generality (WLOG), assume these numbers are positive.
   - Let these numbers be \( a_1, a_2, \ldots, a_5 \) in a row, where \( a_1 \leq a_2 \leq \ldots \leq a_5 \).

2. **Consider the sum of the five largest numbers:**
   - If the middle number \( a_3 \) is non-negative, then the sum of the five largest numbers \( a_1 + a_2 + a_3 + a_4 + a_5 \) is greater than \( a_5 \), which contradicts the condition that the sum of any \( k \) numbers in the same row is also in the same row.

3. **Consider the sum of the five smallest numbers:**
   - If \( a_3 \) is negative, then the sum of the five smallest numbers \( a_1 + a_2 + a_3 + a_4 + a_5 \) is smaller than \( a_1 \), which also contradicts the condition.

4. **Conclusion from the contradictions:**
   - Every row must contain at most one positive and at most one negative number.
   - Therefore, each row has at least \( 9 - 2 = 7 \) zeroes.

5. **Calculate the minimum number of zeroes in the entire board:**
   - There are 9 rows, so the total number of zeroes is at least \( 9 \times 7 = 63 \).

6. **Construct an example to achieve this minimum:**
   - Place \( 10000000 \) and \( -1 \) in the first row and shift this cyclically 8 times, putting the results in the other rows.

Thus, the smallest possible number of zeroes in the board for \( k = 5 \) is \( 63 \).

### Part (b): \( k = 8 \)

1. **Construct an example with as few distinct numbers as possible:**
   - Place five \( 3 \)'s and four \( -4 \)'s in each row.
   - Shift this arrangement cyclically 8 times, putting the results in the other rows.

2. **Verify the construction:**
   - Each row and column will have the same sum, satisfying the condition that the sum of any \( k = 8 \) numbers in the same row or column is also in the same row or column.

Thus, the smallest possible number of zeroes in the board for \( k = 8 \) is \( 0 \).

The final answer is \( \boxed{63} \) for \( k = 5 \) and \( \boxed{0} \) for \( k = 8 \).