100 atcoder#ABC127F. [ABC127F] Absolute Minima
[ABC127F] Absolute Minima
Score : points
Problem Statement
There is a function , which is initially a constant function .
We will ask you to process queries in order. There are two kinds of queries, update queries and evaluation queries, as follows:
- An update query
1 a b
: Given two integers and , let and replace with . - An evaluation query
2
: Print that minimizes , and the minimum value of . If there are multiple such values of , choose the minimum such value.
We can show that the values to be output in an evaluation query are always integers, so we ask you to print those values as integers without decimal points.
Constraints
- All values in input are integers.
- The first query is an update query.
Input
Input is given from Standard Input in the following format:
See Sample Input 1 for an example.
Output
For each evaluation query, print a line containing the response, in the order in which the queries are given.
The response to each evaluation query should be the minimum value of that minimizes , and the minimum value of , in this order, with space in between.
4
1 4 2
2
1 1 -8
2
4 2
1 -3
In the first evaluation query, , which attains the minimum value of at .
In the second evaluation query, , which attains the minimum value of when . Among the multiple values of that minimize , we ask you to print the minimum, that is, .
4
1 -1000000000 1000000000
1 -1000000000 1000000000
1 -1000000000 1000000000
2
-1000000000 3000000000