An operation on position i is called "balancing" iff A_i>A_{i+1}.
Lemma 1
If A turns into B after some operations, there must be \min(B)\le\lfloor L(A)\rfloor and \max(B)\ge\lceil R(A)\rceil.
Proof of Lemma 1
Assume that \min(B)>\lfloor L(A)\rfloor. Let i be some index satisfying L(A,i)=L(A). Notice that L(B,i)\ge\min(B), so we have: \lfloor L(B,i)\rfloor\ge\lfloor\min(B)\rfloor=\min(B)>\lfloor L(A)\rfloor=\lfloor L(A,i)\rfloor
So L(B,i)>L(A,i), i.e. \sum_{k=1}^iB_k>\sum_{k=1}^iA_k.
However, \forall j\ne i, operations on position j does not affect \sum_{k=1}^iB_k, and operations on position i makes \sum_{k=1}^iB_k smaller, so there must be \sum_{k=1}^iB_k\le\sum_{k=1}^iA_k. Contradiction!
Similarly, we can prove that \max(B)\ge\lceil R(A)\rceil.
Lemma 2
If A turns into B after a balancing operation, there must be \lfloor L(A)\rfloor=\lfloor L(B)\rfloor and \lceil R(A)\rceil=\lceil R(B)\rceil.
Proof of Lemma 2
Suppose that the balancing operation is performed on position i. Notice that \forall j\ne i,L(A,j)=L(B,j) and L(B,i)=L(A,i)-\frac{1}{i}<L(A,i), so L(B)\le L(A), so \lfloor L(B)\rfloor\le\lfloor L(A)\rfloor.
If i=1, we have \lfloor L(B,1)\rfloor<\lfloor L(B,2)\rfloor, i.e. A_1-1<\left\lfloor\frac{A_1+A_2}{2}\right\rfloor. Discuss the value of A_2: if A_2\le A_1-2, then \left\lfloor\frac{A_1+A_2}{2}\right\rfloor\le A_1-1, leading to contradiction; if A_2=A_1-1, then \left\lfloor\frac{A_1+A_2}{2}\right\rfloor= A_1-1, also leading to contradiction.
If i>1, on one hand we have \lfloor L(B,i)\rfloor<\lfloor L(B,i-1)\rfloor, so L(B,i)<L(B,i-1), after simplification we have \sum_{k=1}^{i-1}A_k>(i-1)(A_i-1)
On the other hand, we can calculate the difference between L(B,i) and L(B,i+1) using A_{i+1}\le A_i-1 and the previous inequality, after simplification we have L(B,i)-L(B,i+1)>-\frac{1}{i+1}
Decompose the difference into integral part and fractional part, we have \lbrace L(B,i)\rbrace>\lfloor L(B,i+1)\rfloor-\lfloor L(B,i)\rfloor-\frac{1}{i+1}+\lbrace L(B,i+1)\rbrace
Because \lfloor L(B,i+1)\rfloor-\lfloor L(B,i)\rfloor\ge 1 and \lbrace L(B,i+1)\rbrace\ge 0, we have \lbrace L(B,i)\rbrace>\frac{i}{i+1}. However, since L(B,i) can be expressed as a rational number with denominator i, so \lbrace L(B,i)\rbrace\le\frac{i-1}{i}, leading to contradiction.
In summary, there must be \lfloor L(A)\rfloor=\lfloor L(B)\rfloor. Similarly, we can prove that \lceil R(A)\rceil=\lceil R(B)\rceil.
Construction and proof of the answer
For an array A of length n, perform balancing operations to it continuously until you get a monotonically non-decreasing array B. Since B is monotonically non-decreasing, there must be \min(B)=B_1=L(B)=\lfloor L(B)\rfloor and \max(B)=B_n=R(B)=\lceil R(B)\rceil. By Lemma 2 we have \lfloor L(B)\rfloor=\lfloor L(A)\rfloor and \lceil R(B)\rceil=\lceil R(A)\rceil, so \max(B)-\min(B)=\lceil R(A)\rceil-\lfloor L(A)\rfloor.
According to Lemma 1, no matter what operations are performed on A, the final array C must satisfy \max(C)-\min(C)\ge\lceil R(A)\rceil-\lfloor L(A)\rfloor, so \lceil R(A)\rceil-\lfloor L(A)\rfloor is the answer.