{"trustable":false,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"MD","content":"# C❤C❤在❤线❤招❤婚❤,❤男❤女❤不❤限"}},{"title":"","value":{"format":"MD","content":"CC家马桶上有块巨大的广告牌,高h宽w。\n之后,轮流贴1*wi的cc招婚广告,优先往上贴,其次优先左贴。\n有些cc招婚广告可能贴不上去,让CC伤心。\n她想知道,每张广告贴第几行?"}},{"title":"Input","value":{"format":"MD","content":"有多组样例,但是不会超过40个。对于每组样例,第一行包含3个整数h,w,n(1 \u003c\u003d h,w \u003c\u003d 10^9; 1 \u003c\u003d n \u003c\u003d 200,000) -马桶广告牌的高度和宽度,以及招婚广告的张数。\n下面n行每行一个整数 wi (1 \u003c\u003d wi \u003c\u003d 10^9) - 代表第i张招婚广告的宽度."}},{"title":"Output","value":{"format":"MD","content":" 对于每张招婚广告,输出它被贴在第几行,顶部是第一行。如果某广告贴不下了,则输出-1。\n"}},{"title":"Sample Input","value":{"format":"MD","content":"\u003cdiv\u003e \n \u003cpre\u003e\n3 5 5\n2\n4\n3\n3\n3\u003c/pre\u003e \n\u003c/div\u003e"}},{"title":"Sample Output","value":{"format":"MD","content":"\u003cdiv\u003e \n\u003cpre\u003e\n1\n2\n1\n3\n-1\u003c/pre\u003e\n\u003c/div\u003e\n "}},{"title":"Hint","value":{"format":"MD","content":"做不出可以找CC表演DY"}}]}