Fix an odd integer $n > 1$. For a permutation $p$ of the set $\{1,2,...,n\}$, let S be the number of pairs of indices $(i, j)$, $1 \le i \le  j \le  n$, for which $p_i +p_{i+1} +...+p_j$ is divisible by $n$. Determine the maximum possible value of $S$.

Croatia
1. **Define the Problem and Variables:**
   We are given an odd integer \( n > 1 \) and a permutation \( p \) of the set \(\{1, 2, \ldots, n\}\). We need to determine the maximum number of pairs \((i, j)\) such that \(1 \leq i \leq j \leq n\) and the sum \( p_i + p_{i+1} + \cdots + p_j \) is divisible by \( n \).

2. **Construct a Permutation:**
   Consider the permutation \( p = (n, n-1, 1, n-2, 2, n-3, 3, \ldots) \). This permutation is constructed by alternating the largest and smallest remaining numbers.

3. **Define Special and Nice Pairs:**
   - A pair \((i, j)\) is called **special** if \( p_i + p_{i+1} + \cdots + p_j \) is divisible by \( n \).
   - A pair \((i, j)\) is called **nice** if \( p_i + p_j \) is divisible by \( n \).

4. **Analyze the Permutation:**
   Let \( m \) be the index such that \( p_m = n \). There are at most \(\frac{n+1}{2}\) special pairs involving \( m \) because if \((m, j)\) is special, then \((m, j+1)\) is not special, and if \((i, m)\) is special, then \((i-1, m)\) is not special.

5. **Ignore the Largest Element:**
   Since \( p_m = n \) does not change the divisibility by \( n \), we can ignore it. We now need to prove that for any permutation \( p \) of \(\{1, 2, \ldots, n-1\}\), there are at most \(\frac{(n+3)(n+1)}{8} - \frac{n+1}{2} = \frac{(n+1)(n-1)}{8}\) special pairs.

6. **Count Nice Pairs:**
   In the new permutation \( p \) of \(\{1, 2, \ldots, n-1\}\), there are \(\frac{n-1}{2}\) nice pairs. Note that \((i, i)\) is never nice nor special.

7. **Focus on Specific Pairs:**
   Consider pairs starting in \(\{2i-1, 2i\}\) and ending in \(\{2j-1, 2j\}\) for \(1 \leq i \leq j \leq \frac{n-1}{2}\):
   - If \( i < j \):
     - If \((2i-1, 2j-1)\) is special, then the other 3 pairs are not.
     - If \((2i, 2j)\) is special, then the other 3 pairs are not.
     - If \((2i-1, 2j)\) is special:
       - If \((2i-1, 2j)\) is nice, then the only other special pair is \((2i, 2j-1)\).
       - Otherwise, the other 3 pairs are not special.
     - If \((2i, 2j-1)\) is special:
       - If \((2i-1, 2j)\) is nice, then the only other special pair is \((2i-1, 2j)\).
       - Otherwise, the other 3 pairs are not special.
   - If \( i = j \), then \((2i-1, 2i)\) is special if and only if \((2i-1, 2i)\) is nice.

8. **Count Special Pairs:**
   Excluding the cases where we encounter a nice pair (and thus an extra special pair), there are at most \(\frac{(n-1)(n-3)}{8}\) special pairs. Including the cases with nice pairs, we conclude:
   \[
   \#(\text{special pairs}) \leq \frac{(n-1)(n-3)}{8} + \frac{n-1}{2} = \frac{(n+1)(n-1)}{8}.
   \]

9. **Conclusion:**
   The maximum possible value of \( S \) is \(\frac{(n+1)(n+3)}{8}\).

The final answer is \(\boxed{\frac{(n+1)(n+3)}{8}}\).