Given an integer $n>1$ and a $n\times n$ grid $ABCD$ containing $n^2$ unit squares, each unit square is colored by one of three colors: Black, white and gray. A coloring is called [i]symmetry[/i] if each unit square has center on diagonal $AC$ is colored by gray and every couple of unit squares which are symmetry by $AC$ should be both colred by black or white. In each gray square, they label a number $0$, in a white square, they will label a positive integer and in a black square, a negative integer. A label will be called $k$-[i]balance[/i] (with $k\in\mathbb{Z}^+$) if it satisfies the following requirements:

i) Each pair of unit squares which are symmetry by $AC$ are labelled with the same integer from the closed interval $[-k,k]$

ii) If a row and a column intersectes at a square that is colored by black, then the set of positive integers on that row and the set of positive integers on that column are distinct.If a row and a column intersectes at a square that is colored by white, then the set of negative integers on that row and the set of negative integers on that column are distinct.

a) For $n=5$, find the minimum value of $k$ such that there is a $k$-balance label for the following grid

[asy]
size(4cm);
pair o = (0,0); pair y = (0,5); pair z = (5,5); pair t = (5,0); dot("$A$", y, dir(180)); dot("$B$", z); dot("$C$", t); dot("$D$", o, dir(180));
fill((0,5)--(1,5)--(1,4)--(0,4)--cycle,gray); 
fill((1,4)--(2,4)--(2,3)--(1,3)--cycle,gray); 
fill((2,3)--(3,3)--(3,2)--(2,2)--cycle,gray); 
fill((3,2)--(4,2)--(4,1)--(3,1)--cycle,gray); 
fill((4,1)--(5,1)--(5,0)--(4,0)--cycle,gray); 
fill((0,3)--(1,3)--(1,1)--(0,1)--cycle,black);
fill((2,5)--(4,5)--(4,4)--(2,4)--cycle,black);
fill((2,1)--(3,1)--(3,0)--(2,0)--cycle,black);
fill((2,1)--(3,1)--(3,0)--(2,0)--cycle,black);
fill((4,3)--(5,3)--(5,2)--(4,2)--cycle,black);    
for (int i=0; i<=5; ++i) { draw((0,i)--(5,i)^^(i,0)--(i,5)); }
[/asy] 

b) Let $n=2017$. Find the least value of $k$ such that there is always a $k$-balance label for a symmetry coloring.
Let's break down the problem into detailed steps to find the minimum value of \( k \) for \( n = 5 \).

### Step 1: Understanding the Grid and Symmetry
The grid is a \( 5 \times 5 \) matrix with the diagonal \( AC \) (from top-left to bottom-right) containing gray squares. The symmetry condition requires that each pair of unit squares symmetric about \( AC \) must be colored either both black or both white.

### Step 2: Labeling Conditions
- Gray squares are labeled with \( 0 \).
- White squares are labeled with positive integers.
- Black squares are labeled with negative integers.
- For a \( k \)-balance label:
  - Each pair of symmetric squares must have the same integer from the interval \([-k, k]\).
  - If a row and a column intersect at a black square, the positive integers in that row and column must be distinct.
  - If a row and a column intersect at a white square, the negative integers in that row and column must be distinct.

### Step 3: Analyzing the Given Grid
The given grid is:
\[
\begin{array}{|c|c|c|c|c|}
\hline
\text{gray} & \text{white} & \text{black} & \text{black} & \text{white} \\
\hline
\text{white} & \text{gray} & \text{white} & \text{white} & \text{white} \\
\hline
\text{black} & \text{white} & \text{gray} & \text{white} & \text{black} \\
\hline
\text{black} & \text{white} & \text{white} & \text{gray} & \text{white} \\
\hline
\text{white} & \text{white} & \text{black} & \text{white} & \text{gray} \\
\hline
\end{array}
\]

### Step 4: Determining the Minimum \( k \)
Consider the constraints:
- Column 0 and row 1 intersect at the black square \((0,1)\). The positive integers in row 1 and column 0 must be distinct.
- The squares \((0,0), (0,3), (1,1), (2,1), (4,1)\) must be labeled with distinct positive integers.

Thus, we need at least 5 distinct positive integers, implying \( k \geq 5 \).

### Step 5: Constructing a Valid \( k \)-Balance Label
We need to construct a labeling that satisfies all conditions with \( k = 5 \). Here is a possible labeling:

\[
\begin{array}{|c|c|c|c|c|}
\hline
0 & 1 & -1 & -2 & 2 \\
\hline
1 & 0 & 3 & 3 & 1 \\
\hline
-1 & 3 & 0 & 4 & -3 \\
\hline
-2 & 3 & 4 & 0 & 5 \\
\hline
2 & 1 & -3 & 5 & 0 \\
\hline
\end{array}
\]

### Verification:
- Each pair of symmetric squares about \( AC \) has the same integer.
- Positive integers in rows and columns intersecting at black squares are distinct.
- Negative integers in rows and columns intersecting at white squares are distinct.

Thus, the minimum value of \( k \) is \( 5 \).

The final answer is \( \boxed{ k = 5 } \).