Dima and the Table#2942

Dima and the Table

ثانيتان
256 ميغابايت
صعب

Dima received a special m \times n table from his mom. In this table, Dima can select three numbers — , , and (1 \leq i \leq m, 1 \leq j \leq n, -1000 \leq d \leq 1000) — and set the element at position to . As Dima plays with the table, his mom occasionally asks him to find the maximum element within a specific subregion of the table, defined by the indices from\_row \leq row \leq to\_row and from\_column \leq column \leq to\_column. While Dima can easily answer these questions, can you do the same?

المدخلات

The first line contains three integers , , and (1 \leq n, m \leq 1000, 1 \leq q \leq 10^5), representing the number of rows, columns, and the total number of operations and queries, respectively.

The next lines each contain integers, each with an absolute value not exceeding , representing the initial state of the table.

Following these, there are lines describing operations and queries. Each line begins with either = or ?.

A line starting with = indicates an assignment operation, followed by , , and , adhering to the constraints mentioned.

A line starting with ? indicates a query, followed by from\_row, to\_row, from\_column, and to\_column (1 \leq from\_row \leq to\_row \leq n, 1 \leq from\_column \leq to\_column \leq m).

المخرجات

Provide the answers to the queries, each on a separate line.

أمثلة

مثال 1

Loading
Loading