CF678F.Lena and Queries

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Lena is a programmer. She got a task to solve at work.

There is an empty set of pairs of integers and nn queries to process. Each query is one of three types:

  1. Add a pair (a,b)(a,b) to the set.
  2. Remove a pair added in the query number ii . All queries are numbered with integers from 11 to nn .
  3. For a given integer qq find the maximal value xq+yx·q+y over all pairs (x,y)(x,y) from the set.

Help Lena to process the queries.

输入格式

The first line of input contains integer nn ( 1<=n<=31051<=n<=3·10^{5} ) — the number of queries.

Each of the next nn lines starts with integer tt ( 1<=t<=31<=t<=3 ) — the type of the query.

A pair of integers aa and bb ( 109<=a,b<=109-10^{9}<=a,b<=10^{9} ) follows in the query of the first type.

An integer ii ( 1<=i<=n1<=i<=n ) follows in the query of the second type. It is guaranteed that ii is less than the number of the query, the query number ii has the first type and the pair from the ii -th query is not already removed.

An integer qq ( 109<=q<=109-10^{9}<=q<=10^{9} ) follows in the query of the third type.

输出格式

For the queries of the third type print on a separate line the desired maximal value of xq+yx·q+y .

If there are no pairs in the set print "EMPTY SET".

输入输出样例

  • 输入#1

    7
    3 1
    1 2 3
    3 1
    1 -1 100
    3 1
    2 4
    3 1
    

    输出#1

    EMPTY SET
    5
    99
    5
    
首页