Let \( x \) be the number of windowed office buildings cleaned, and each office building has 21 windows. Let \( y \) be the number of schools cleaned, and the school has 42 windows.
According to the problem, the total number of windows cleaned is given by:
\[ 21x + 42y = 126 \]
To simplify this equation, we can divide everything by 21:
\[ x + 2y = 6 \]
Now, we need to find non-negative integer solutions for \( x \) and \( y \).
We can rewrite the equation to express \( x \):
\[ x = 6 - 2y \]
Now we will determine the possible values for \( y \) that keep \( x \) non-negative:
-
If \( y = 0 \): \[ x = 6 - 2(0) = 6 \] Therefore, \( (x, y) = (6, 0) \).
-
If \( y = 1 \): \[ x = 6 - 2(1) = 4 \] Therefore, \( (x, y) = (4, 1) \).
-
If \( y = 2 \): \[ x = 6 - 2(2) = 2 \] Therefore, \( (x, y) = (2, 2) \).
-
If \( y = 3 \): \[ x = 6 - 2(3) = 0 \] Therefore, \( (x, y) = (0, 3) \).
If \( y \) were to take a value of 4 or more, then \( x \) would become negative, which is not allowed.
Thus, the possible non-negative integer solutions for \( (x, y) \) are:
- \( (6, 0) \): Clean 6 office buildings, 0 schools.
- \( (4, 1) \): Clean 4 office buildings, 1 school.
- \( (2, 2) \): Clean 2 office buildings and 2 schools.
- \( (0, 3) \): Clean 0 office buildings and 3 schools.
Therefore, the maximum number of office buildings that can be washed is:
\[ \boxed{6} \]