Let $a_1, a_2, ..., a_{1999}$ be nonnegative real numbers satisfying the following conditions:
a. $a_1+a_2+...+a_{1999}=2$
b. $a_1a_2+a_2a_3+...+a_{1999}a_1=1$.
Let $S=a_1^ 2+a_2 ^ 2+...+a_{1999}^2$. Find the maximum and minimum values of $S$.
1. **Given Conditions:**
   - \( a_1 + a_2 + \cdots + a_{1999} = 2 \)
   - \( a_1a_2 + a_2a_3 + \cdots + a_{1999}a_1 = 1 \)

2. **Objective:**
   - Find the maximum and minimum values of \( S = a_1^2 + a_2^2 + \cdots + a_{1999}^2 \).

3. **Using the Cauchy-Schwarz Inequality:**
   \[
   (a_1^2 + a_2^2 + \cdots + a_{1999}^2)(1^2 + 1^2 + \cdots + 1^2) \geq (a_1 + a_2 + \cdots + a_{1999})^2
   \]
   Here, there are 1999 terms, so:
   \[
   S \cdot 1999 \geq 2^2
   \]
   \[
   S \cdot 1999 \geq 4
   \]
   \[
   S \geq \frac{4}{1999}
   \]

4. **Using the given conditions:**
   - From the first condition, we know the sum of the \(a_i\)'s is 2.
   - From the second condition, we know the sum of the products of consecutive \(a_i\)'s is 1.

5. **Using the AM-GM Inequality:**
   \[
   a_1a_2 + a_2a_3 + \cdots + a_{1999}a_1 \leq \frac{(a_1 + a_2 + \cdots + a_{1999})^2}{1999}
   \]
   Given \( a_1 + a_2 + \cdots + a_{1999} = 2 \):
   \[
   1 \leq \frac{4}{1999}
   \]
   This inequality is not strict, so we need to find another approach.

6. **Considering the equality case:**
   - If \( a_1 = 2 \) and \( a_2 = a_3 = \cdots = a_{1999} = 0 \), then:
     \[
     a_1 + a_2 + \cdots + a_{1999} = 2
     \]
     \[
     a_1a_2 + a_2a_3 + \cdots + a_{1999}a_1 = 0 \neq 1
     \]
   - This case does not satisfy both conditions.

7. **Exploring other possible values:**
   - Let \( a_1 = a_2 = \cdots = a_{1999} = \frac{2}{1999} \):
     \[
     a_1 + a_2 + \cdots + a_{1999} = 1999 \cdot \frac{2}{1999} = 2
     \]
     \[
     a_1a_2 + a_2a_3 + \cdots + a_{1999}a_1 = 1999 \cdot \left(\frac{2}{1999}\right)^2 = \frac{4}{1999}
     \]
     This does not satisfy the second condition.

8. **Finding the correct values:**
   - Let \( a_1 = 1 \) and \( a_2 = 1 \), and \( a_3 = a_4 = \cdots = a_{1999} = 0 \):
     \[
     a_1 + a_2 + \cdots + a_{1999} = 1 + 1 + 0 + \cdots + 0 = 2
     \]
     \[
     a_1a_2 + a_2a_3 + \cdots + a_{1999}a_1 = 1 \cdot 1 + 0 + \cdots + 0 = 1
     \]
     \[
     S = a_1^2 + a_2^2 + \cdots + a_{1999}^2 = 1^2 + 1^2 + 0^2 + \cdots + 0^2 = 2
     \]

9. **Conclusion:**
   - The minimum value of \( S \) is \( \frac{4}{1999} \).
   - The maximum value of \( S \) is \( 2 \).

The final answer is \( \boxed{2} \) for the maximum value and \( \boxed{\frac{4}{1999}} \) for the minimum value.