A set of balls contains $ n$ balls which are labeled with numbers $ 1,2,3,\ldots,n.$ We are given $ k > 1$ such sets. We want to colour the balls with two colours, black and white in such a way, that

(a) the balls labeled with the same number are of the same colour,

(b) any subset of $ k\plus{}1$ balls with (not necessarily different) labels $ a_{1},a_{2},\ldots,a_{k\plus{}1}$ satisfying the condition $ a_{1}\plus{}a_{2}\plus{}\ldots\plus{}a_{k}\equal{} a_{k\plus{}1}$, contains at least one ball of each colour.

Find, depending on $ k$ the greatest possible number $ n$ which admits such a colouring.
To solve this problem, we need to find the greatest possible number \( n \) such that we can color the balls with two colors (black and white) while satisfying the given conditions. Let's break down the solution into detailed steps.

1. **Lower Bound: \( n = k^2 + k - 2 \) is possible.**

   We need to show that it is possible to color the balls such that the conditions are satisfied for \( n = k^2 + k - 2 \).

   - Use color white for the numbers \( 1, 2, \ldots, k-1 \) and for \( k^2, k^2 + 1, \ldots, k^2 + k - 2 \).
   - Use color black for the numbers \( k, k+1, \ldots, k^2 - 1 \).

   Now, let's verify that this coloring satisfies the conditions:

   - If there was a monochromatic black solution to the equation \( a_1 + a_2 + \ldots + a_k = a_{k+1} \), then \( a_1, \ldots, a_k \) are all \( \ge k \). Hence, \( a_{k+1} \ge k^2 \), which is a contradiction because \( a_{k+1} \) should be black but \( k^2 \) and higher are white.
   - If there was a monochromatic white solution to the equation, then \( a_{k+1} \ge k^2 \). Hence, one of \( a_1, \ldots, a_k \) must be strictly greater than \( k-1 \). Therefore, one of \( a_1, \ldots, a_k \) must be at least \( k^2 \), and the others are all at least 1. Hence, their sum is at least \( k^2 + k - 1 \), which is a contradiction because \( a_{k+1} \) should be white but \( k^2 + k - 1 \) is black.

2. **Upper Bound: \( n = k^2 + k - 1 \) is not possible.**

   Assume for the sake of contradiction that there is a solution with \( n = k^2 + k - 1 \).

   - Assume without loss of generality that 1 is colored white.
   - Then \( k \) must be black.
   - Then \( k^2 = k + k + \cdots + k \) (k times) must be white.
   - Then \( x = k^2 + k - 1 = k^2 + (1 + 1 + \cdots + 1) \) (k times) must be black.
   - And \( y = k^2 - k + 1 \) must be black, since \( y + (1 + 1 + \cdots + 1) = k^2 \).

   Furthermore:
   - 2 must be white, since \( y + (2 + 2 + \cdots + 2) = x \).
   - Since 1 and 2 are white, \( k, k+1, \ldots, 2k \) must be black.
   - Since \( k, k+1, \ldots, 2k \) are black, \( k^2, k^2 + 1, \ldots, k^2 + k - 1 \) must be white.
   - Hence, \( x = k^2 + k - 1 \) must be white, which is a contradiction because we previously determined \( x \) must be black.

Therefore, the greatest possible number \( n \) that admits such a coloring is \( k^2 + k - 2 \).

The final answer is \( \boxed{k^2 + k - 2} \).