Some squares of a $1999\times 1999$ board are occupied with pawns. Find the smallest number of pawns for which it is possible that for each empty square, the total number of pawns in the row or column of that square is at least $1999$.
1. Let \( n = 1999 \). We need to find the smallest number of pawns such that for each empty square, the total number of pawns in the row or column of that square is at least \( 1999 \).

2. Define \( U \) as the number of unmarked (empty) squares. Let \( r_i \) and \( c_i \) be the number of unmarked squares in row \( i \) and column \( i \) respectively. Then:
   \[
   \sum_{i=1}^{n} r_i = \sum_{i=1}^{n} c_i = U
   \]

3. Consider the number of pairs of (unmarked, marked) squares that are in the same row or column. This number is at least \( Un \) by hypothesis. On the other hand, this number is exactly:
   \[
   \sum_{i=1}^{n} r_i (n - r_i) + \sum_{i=1}^{n} c_i (n - c_i)
   \]

4. Simplify the above expression:
   \[
   \sum_{i=1}^{n} r_i (n - r_i) + \sum_{i=1}^{n} c_i (n - c_i) = n \sum_{i=1}^{n} r_i - \sum_{i=1}^{n} r_i^2 + n \sum_{i=1}^{n} c_i - \sum_{i=1}^{n} c_i^2
   \]
   \[
   = 2nU - \sum_{i=1}^{n} r_i^2 - \sum_{i=1}^{n} c_i^2
   \]

5. By the Cauchy-Schwarz inequality:
   \[
   \sum_{i=1}^{n} r_i^2 \geq \frac{(\sum_{i=1}^{n} r_i)^2}{n} = \frac{U^2}{n}
   \]
   Similarly,
   \[
   \sum_{i=1}^{n} c_i^2 \geq \frac{(\sum_{i=1}^{n} c_i)^2}{n} = \frac{U^2}{n}
   \]

6. Therefore:
   \[
   \sum_{i=1}^{n} r_i^2 + \sum_{i=1}^{n} c_i^2 \geq 2 \frac{U^2}{n}
   \]

7. Substituting this back into our earlier expression:
   \[
   2nU - \sum_{i=1}^{n} r_i^2 - \sum_{i=1}^{n} c_i^2 \leq 2nU - 2 \frac{U^2}{n}
   \]

8. Since the number of pairs of (unmarked, marked) squares is at least \( Un \):
   \[
   Un \leq 2nU - 2 \frac{U^2}{n}
   \]

9. Simplifying this inequality:
   \[
   Un \leq 2nU - 2 \frac{U^2}{n} \implies 0 \leq nU - 2 \frac{U^2}{n} \implies 0 \leq n^2 U - 2U^2 \implies 2U^2 \leq n^2 U \implies 2U \leq n^2 \implies U \leq \frac{n^2}{2}
   \]

10. For \( n = 1999 \):
    \[
    U \leq \frac{1999^2}{2} = \frac{3996001}{2} = 1998000.5
    \]
    Since \( U \) must be an integer, \( U \leq 1998000 \).

11. To show that this is sufficient, we can mark the top left \( 1000 \times 1000 \) squares and the bottom right \( 999 \times 999 \) squares. The smallest number of marked squares is:
    \[
    1000^2 + 999^2 = 1000000 + 998001 = 1998001
    \]

The final answer is \( \boxed{ 1998001 } \).