II. (50 points) Given a positive real number $a$ and a positive integer $n$. Find:
$S_{n}(a)=\sum_{j=0}^{n-1}\left[\sqrt{a+\frac{j}{n}}\right]$ (expressed in terms of $a$ and $n$).
Let $k^{2} \leqslant [a]+1j_{0}$, then $k^{2} \leqslant a+\frac{j}{n}<k^{2}+\frac{j}{n}<k^{2}+1$.
Therefore, when $j=0,1, \cdots, j_{0}$, $\left[\sqrt{a+\frac{j}{n}}\right]=k-1$:
When $j=j_{0}+1, j_{0}+2, \cdots, n-1$, $\left[\sqrt{a+\frac{j}{n}}\right]=k$.
Then $S_{n}(a)=\sum_{j=0}^{n-1}\left[\sqrt{a+\frac{j}{n}}\right]$
$$
\begin{array}{l}
=\sum_{j=0}^{j_{0}}\left[\sqrt{a+\frac{j}{n}}\right]+\sum_{j=j_{0}+1}^{n-1}\left[\sqrt{a+\frac{j}{n}}\right] \\
=\sum_{j=0}^{j_{0}}(k-1)+\sum_{j=j_{0}+1}^{n-1} k \\
=\left(j_{0}+1\right)(k-1)+\left(n-j_{0}-1\right) k \\
=n k-j_{0}-1 .
\end{array}
$$

By the minimality of $j_{0}$, we have
$$
a+\frac{j_{0}}{n}<k^{2} \leqslant a+\frac{j_{0}+1}{n},
$$

Thus, $n k^{2}-n a-1 \leqslant j_{0}<n k^{2}-n a$,
which means $n([a]+1)-n a-1 \leqslant j_{0}<n([a]+1)-n a$.
Therefore, $n-n\{a\}-1 \leqslant j_{0}<n-n\{a\}$, so
$n\{a\}<n-j_{0} \leqslant n\{a\}+1$.
Then $n-j_{0}=[n|a|]+1$, which means
$j_{0}=n-[n\{a\}]-1$.
Hence $S_{n}(a)=n k-j_{0}-1=n k-n+[n\{a\}]$
$$
=n \sqrt{[a]+1}+[n|a|]-n .
$$

In summary,
$$
S_{n}(a)=\left\{\begin{array}{ll}
n[\sqrt{a}], & \text{if } [a]+1 \text{ is not a perfect square; } \\
n[\sqrt{[a]+1}]+[n|a|]-n, & \text{if } [a]+1 \text{ is a perfect square. }
\end{array}\right.
$$