#C9188. Weather Data Analyzer
Weather Data Analyzer
Weather Data Analyzer
You are given temperature data for n consecutive days and q queries to process. There are two types of queries:
- Update Query (type 1): Modify the temperature for a specific day.
- Range Query (type 2): Find the minimum and maximum temperature in a specific range of days.
For an update query, the input is given as:
\(1\; day\; temp\)
For a range query, the input is given as:
\(2\; start\_day\; end\_day\)
When a range query is executed, output the result as two integers: the minimum and maximum temperatures in that range.
Note: The input is read from standard input (stdin) and the output should be printed to standard output (stdout).
inputFormat
The first line contains two integers n and q, where n is the number of days and q is the number of queries.
The second line contains n space-separated integers representing the temperatures for each day.
Each of the next q lines contains a query in one of the following formats:
- For an update query:
1 day temp
- For a range query:
2 start_day end_day
outputFormat
For each range query (type 2), output a line with two space-separated integers representing the minimum and maximum temperatures in the given range.
## sample5 5
23 26 19 22 28
2 1 3
1 3 25
2 2 5
1 5 18
2 1 5
19 26
22 28
18 26
</p>