{"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 have an array with n elements. Call the i-th element a\u003csub\u003ei\u003c/sub\u003e. You are guaranteed that the array is arranged in ascending order, and all elements are distinct.\u003c/p\u003e\n\u003cp\u003e Let a\u003csub\u003ei\u003csub\u003e1\u003c/sub\u003e\u003c/sub\u003e, a\u003csub\u003ei\u003csub\u003e2\u003c/sub\u003e\u003c/sub\u003e, ..., a\u003csub\u003ei\u003csub\u003ek\u003c/sub\u003e\u003c/sub\u003e be a subset (not necessarily continuous) of the array. Call this subset \u003cb\u003e\u003ci\u003egood\u003c/i\u003e\u003c/b\u003e if, for each j from 1 to k-1, a\u003csub\u003ei\u003csub\u003ej+1\u003c/sub\u003e\u003c/sub\u003e ≤ 2a\u003csub\u003ei\u003csub\u003ej\u003c/sub\u003e\u003c/sub\u003e. In other words, each element of the subset must be at most twice the previous one, when arranged in ascending order. Note that, trivially, a subset containing exactly one element of the array is always \u003cb\u003e\u003ci\u003egood\u003c/i\u003e\u003c/b\u003e.\u003c/span\u003e\u003c/p\u003e\n\u003cp\u003e Your problem is thus: find the size of the largest \u003cb\u003e\u003ci\u003egood\u003c/i\u003e\u003c/b\u003e subset of the array.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of input contains one integer n (1 ≤ n ≤ 2 * 10\u003csup\u003e5\u003c/sup\u003e) — the number of elements in the array.\u003c/p\u003e\n\u003cp\u003eThe second line of input contains n integers a\u003csub\u003e1\u003c/sub\u003e, a\u003csub\u003e2\u003c/sub\u003e, ..., a\u003csub\u003en\u003c/sub\u003e (1 ≤ a\u003csub\u003ei\u003c/sub\u003e ≤ 10\u003csup\u003e9\u003c/sup\u003e) — elements of the array. \u003cspan class\u003d\"tex-font-style-bf\"\u003e It is guaranteed that these are distinct and are given in ascending order\u003c/span\u003e.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint a single integer — the maximum size of a \u003cb\u003e\u003ci\u003egood\u003c/i\u003e\u003c/b\u003e subset possible (note that you do not have to explicitly find this subset - only its size)\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":" Input\n\n \u003cpre\u003e10\u003cbr\u003e1 2 5 6 7 10 21 23 24 345\u003cbr\u003e\u003c/pre\u003e\n\n Output\n\n \u003cpre\u003e4\u003cbr\u003e\u003c/pre\u003e\n\n Input\n\n \u003cpre\u003e5\u003cbr\u003e2 5 11 101 2250\u003cbr\u003e\u003c/pre\u003e\n\n Output\n\n \u003cpre\u003e1\u003cbr\u003e\u003c/pre\u003e\n\n Input\n\n \u003cpre\u003e6\u003cbr\u003e5 8 15 100 199 353\u003cbr\u003e\u003c/pre\u003e\n\n Output\n\n \u003cpre\u003e3\u003cbr\u003e\u003c/pre\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first example, the subset of size 4, {5, 6, 7, 10}, is \u003cb\u003e\u003ci\u003egood\u003c/i\u003e\u003c/b\u003e. It can be verified that there is no larger \u003cb\u003e\u003ci\u003egood\u003c/i\u003e\u003c/b\u003e subset.\u003c/p\u003e\n\u003cp\u003eIn the second example there is no \u003cb\u003e\u003ci\u003egood\u003c/i\u003e\u003c/b\u003e subset of size greater than 1. \u003c/p\u003e\n\u003cp\u003eIn the third example are two \u003cb\u003e\u003ci\u003egood\u003c/i\u003e\u003c/b\u003e subsets of size 3, and none of any greater size.\u003c/p\u003e"}}]}