{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cstyle type\u003d\u0027text/css\u0027\u003e .input, .output {border: 1px solid #888888;} .output {margin-bottom:1em;position:relative;top:-1px;} .output pre,.input pre {background-color:#EFEFEF;line-height:1.25em;margin:0;padding:0.25em;} .title {background-color:#FFFFFF;border-bottom: 1px solid #888888;font-family:arial;font-weight:bold;padding:0.25em;} \u003c/style\u003e \u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027]], displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027]]}\n });\n \u003c/script\u003e\n \u003cscript type\u003d\"text/javascript\" async\n src\u003d\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\"\u003e\n \u003c/script\u003e\n\u003cp\u003eYou are given a multiset \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eS\u003c/i\u003e\u003c/span\u003e consisting of positive integers (initially empty). There are two kind of queries: \u003c/p\u003e\n\u003col\u003e \n \u003cli\u003e Add a positive integer to \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eS\u003c/i\u003e\u003c/span\u003e, the newly added integer is not less than any number in it. \u003c/li\u003e\n \u003cli\u003e Find a subset \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003c/span\u003e of the set \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eS\u003c/i\u003e\u003c/span\u003e such that the value \u003cimg align\u003d\"middle\" class\u003d\"tex-formula\" src\u003d\"CDN_BASE_URL/94a3801481f9710bdb863c80e023b1d1?v\u003d1525774937\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\" SRC\u003d\"CDN_BASE_URL/94a3801481f9710bdb863c80e023b1d1?v\u003d1525774937\"\u003e is maximum possible. Here \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003emax\u003c/i\u003e(\u003ci\u003es\u003c/i\u003e)\u003c/span\u003e means maximum value of elements in \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003c/span\u003e, \u003cimg align\u003d\"middle\" class\u003d\"tex-formula\" src\u003d\"CDN_BASE_URL/a4b19d9b606e964cc74b69662eef6364?v\u003d1525774937\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\" SRC\u003d\"CDN_BASE_URL/a4b19d9b606e964cc74b69662eef6364?v\u003d1525774937\"\u003e\u0026nbsp;— the average value of numbers in \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003c/span\u003e. Output this maximum possible value of \u003cimg align\u003d\"middle\" class\u003d\"tex-formula\" src\u003d\"CDN_BASE_URL/94a3801481f9710bdb863c80e023b1d1?v\u003d1525774937\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\" SRC\u003d\"CDN_BASE_URL/94a3801481f9710bdb863c80e023b1d1?v\u003d1525774937\"\u003e. \u003c/li\u003e\n\u003c/ol\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains a single integer \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eQ\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003eQ\u003c/i\u003e ≤ 5·10\u003csup class\u003d\"upper-index\"\u003e5\u003c/sup\u003e\u003c/span\u003e)\u0026nbsp;— the number of queries.\u003c/p\u003e\n\u003cp\u003eEach of the next \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eQ\u003c/i\u003e\u003c/span\u003e lines contains a description of query. For queries of type \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e two integers \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e are given, where \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003ex\u003c/i\u003e ≤ 10\u003csup class\u003d\"upper-index\"\u003e9\u003c/sup\u003e\u003c/span\u003e) is a number that you should add to \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eS\u003c/i\u003e\u003c/span\u003e. It\u0027s guaranteed that \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e is not less than any number in \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eS\u003c/i\u003e\u003c/span\u003e. For queries of type \u003cspan class\u003d\"tex-span\"\u003e2\u003c/span\u003e, a single integer \u003cspan class\u003d\"tex-span\"\u003e2\u003c/span\u003e is given.\u003c/p\u003e\n\u003cp\u003eIt\u0027s guaranteed that the first query has type \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e, i.\u0026nbsp;e. \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eS\u003c/i\u003e\u003c/span\u003e is not empty when a query of type \u003cspan class\u003d\"tex-span\"\u003e2\u003c/span\u003e comes.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eOutput the answer for each query of the second type in the order these queries are given in input. Each number should be printed in separate line.\u003c/p\u003e\n\u003cp\u003eYour answer is considered correct, if each of your answers has absolute or relative error not greater than \u003cspan class\u003d\"tex-span\"\u003e10\u003csup class\u003d\"upper-index\"\u003e - 6\u003c/sup\u003e\u003c/span\u003e.\u003c/p\u003e\n\u003cp\u003eFormally, let your answer be \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003c/span\u003e, and the jury\u0027s answer be \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eb\u003c/i\u003e\u003c/span\u003e. Your answer is considered correct if \u003cimg align\u003d\"middle\" class\u003d\"tex-formula\" src\u003d\"CDN_BASE_URL/7499c6bd8528f00cc991ea9bebefb938?v\u003d1525774937\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\" SRC\u003d\"CDN_BASE_URL/7499c6bd8528f00cc991ea9bebefb938?v\u003d1525774937\"\u003e.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e6\u003cbr\u003e1 3\u003cbr\u003e2\u003cbr\u003e1 4\u003cbr\u003e2\u003cbr\u003e1 8\u003cbr\u003e2\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e0.0000000000\u003cbr\u003e0.5000000000\u003cbr\u003e3.0000000000\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e4\u003cbr\u003e1 1\u003cbr\u003e1 4\u003cbr\u003e1 5\u003cbr\u003e2\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e2.0000000000\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"note","value":{"format":"HTML","content":"第一行是一个Q,表示Q次操作。\n两种操作 操作一:在集合S中添加元素x,保证x不小于S中任何一个元素(保证S递增);操作二:查询,s为S子集,求函数max(s)-mean(s)的最大值,max(s)表示s中元素的最大值,mean(s)表示s中所有元素的平均数。对于每次操作二,输出对应函数最大值,误差小于10e-6。\nn为S元素个数,由于S递增,要使max(s)-mean(s)最大,只需要取S中的最后一个元素和S中前m(m\u003c\u003dn-1)个元素即可,而且由1到m函数max(s)-mean(s)的值先增加后减小,可以使用三分来求最值"}}]}