------
## 最终结论
```python
def max_diagonal_moves(q, queries):
    results = []
    for n, m, k in queries:
        min_moves = abs(n) + abs(m)
        if min_moves > k or (k - min_moves) % 2 != 0:
            results.append(-1)
        else:
            max_diagonals = min(abs(n), abs(m))
            remaining_moves = k - (abs(n) + abs(m))
            max_diagonals += remaining_moves // 2
            results.append(max_diagonals)
    return results

# Example usage:
q = 3
queries = [(2, 2, 3), (4, 3, 7), (10, 1, 9)]
print(max_diagonal_moves(q, queries))
```