{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv id\u003d\"problem-body\"\u003e\n\t\u003cp\u003eYou can test you CHT implementation in this problem. Problem is simple. You have to solve some queries in the form - \u003c/p\u003e\r\n\u003cul\u003e\r\n\u003cli\u003e\u003cstrong\u003e1 m b\u003c/strong\u003e: Add a function \u003cstrong\u003ef(x) \u003d mx + b\u003c/strong\u003e in a set.\u003c/li\u003e\r\n\u003cli\u003e\u003cstrong\u003e2 x:\u003c/strong\u003e For all existing functions in the set, find the maximum/minimum value of \u003cstrong\u003e{ f\u003csub\u003ei\u003c/sub\u003e(x)) }\u003c/strong\u003e.\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003cp\u003eYou also have some special constriants on the inputs. In a dataset, you have either of the four cases for all queries - \u003c/p\u003e\r\n\u003col\u003e\r\n\u003cli\u003e\u003cstrong\u003em\u003csub\u003ei\u003c/sub\u003e \u0026gt; m\u003csub\u003ei+1\u003c/sub\u003e\u003c/strong\u003e, and all queries are for minimum.\u003c/li\u003e\r\n\u003cli\u003e\u003cstrong\u003em\u003csub\u003ei\u003c/sub\u003e \u0026gt; m\u003csub\u003ei+1\u003c/sub\u003e\u003c/strong\u003e, and all queries are for maximum.\u003c/li\u003e\r\n\u003cli\u003e\u003cstrong\u003em\u003csub\u003ei\u003c/sub\u003e \u0026lt; m\u003csub\u003ei+1\u003c/sub\u003e\u003c/strong\u003e, and all queries are for minimum.\u003c/li\u003e\r\n\u003cli\u003e\u003cstrong\u003em\u003csub\u003ei\u003c/sub\u003e \u0026lt; m\u003csub\u003ei+1\u003c/sub\u003e\u003c/strong\u003e, and all queries are for maximum.\u003c/li\u003e\r\n\u003c/ol\u003e\r\n\u003cp\u003eFurthermore, all queries of second kind will obey this - \u003cstrong\u003ex\u003csub\u003ei\u003c/sub\u003e \u0026lt; x\u003csub\u003ei+1\u003c/sub\u003e\u003c/strong\u003e.\u003c/p\u003e\r\n\u003ch3\u003eInput\u003c/h3\u003e\r\n\u003cp\u003eIn the first line, you will have a number\u003cstrong\u003e Q \u0026lt;\u003d 10^5,\u003c/strong\u003e the number of queries. Then a integer \u003cstrong\u003ea\u003c/strong\u003e, where \u003cstrong\u003ea\u003c/strong\u003e denotes the case number (from problem statement), which you\u0027ll need to handle in this dataset.\u003c/p\u003e\r\n\u003cp\u003eNext \u003cstrong\u003eQ\u003c/strong\u003e lines will contain a number \u003cstrong\u003et\u003c/strong\u003e first, if it is \u003cstrong\u003e1\u003c/strong\u003e then another two integers will be given \u003cstrong\u003em b\u003c/strong\u003e, where \u003cstrong\u003e|m|, |b|\u0026lt;\u003d 10^9\u003c/strong\u003e. Then you need to add the function \u003cstrong\u003ef(x) \u003d mx + b\u003c/strong\u003e into set.\u003c/p\u003e\r\n\u003cp\u003eif \u003cstrong\u003et\u003c/strong\u003e is \u003cstrong\u003e2\u003c/strong\u003e, then you will be given a number \u003cstrong\u003e|x|\u003c/strong\u003e \u003cstrong\u003e\u0026lt;\u003d 10^9\u003c/strong\u003e, you need to answer the query as described.\u003c/p\u003e\r\n\u003ch3\u003eOutput\u003c/h3\u003e\r\n\u003cp\u003eFor each query of second type, print the desired answer in a seperate line.\u003c/p\u003e\r\n\u003ch3\u003eExample\u003c/h3\u003e\r\n\u003cdiv\u003e\u003ctable class\u003d\"vjudge_sample\"\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5 1 \n1 5 1 \n1 4 -1\n1 3 -2\n2 -1\n2 3\r\n\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e-5\n7 \n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\r\n\n\u003c/div\u003e"}}]}