{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section 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\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"描述","value":{"format":"MD","content":"theshy总是进入野区刷野怪来发育,因为theshy是一个爱发育,不喜欢打斗的男人.....\n野区里有 n 个野怪, 编号为 1 到 n.\n商店里出售 m 把武器,每一把武器只能打死特定的一些野怪。第 i 把武器花费 ai 金币,能打死 bi 个野怪,这 bi 个野怪的编号分别为 ci1 ci2 ... ci(bi), 已购买的武器可以使用任意次。theshy需要花费最少的钱购买一些武器,将这些野怪全部打死,如果能全部打死,输出这个最小花费;如果不能,输出-1"}},{"title":"限制","value":{"format":"MD","content":"所有的数都是整数\n1\u003c\u003dn\u003c\u003d12 \n1\u003c\u003dm\u003c\u003d1000 \n1\u003c\u003dai\u003c\u003d100000 \n1\u003c\u003dbi\u003c\u003dn\n1\u003c\u003dci1\u003cci2\u003c ... \u003c ci(bi)\u003c\u003dn"}},{"title":"Input","value":{"format":"MD","content":"第一行输入野怪的个数 n 和武器的个数 m\n接下来共有m组,第i组描述第i把武器的信息:\n\n对于每一组:\n第一行输入一个a和b, 分别代表这种武器的价钱和这把武器能打死几个野怪\n第二行输入b个编号,代表这个技能能打死野怪的编号\n"}},{"title":"Output","value":{"format":"MD","content":"输出最小的花费打死所有的野怪. 如果不能全部打死,输出-1"}},{"title":"Sample Input 1","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e2 3\n10 1\n1\n15 1\n2\n30 2\n1 2\n\u003c/pre\u003e"}},{"title":"Sample Output 1","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e25\n\u003c/pre\u003e \n购买第一把武器和第二把武器可以打死所有的野怪,共花费最小消耗25"}},{"title":"Sample Input 2","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e12 1\n100000 1\n2\n\u003c/pre\u003e"}},{"title":"Sample Output 2","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e-1\n\u003c/pre\u003e \n不能打死所有的野怪."}},{"title":"Sample Input 3","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e4 6\n67786 3\n1 3 4\n3497 1\n2\n44908 3\n2 3 4\n2156 3\n2 3 4\n26230 1\n2\n86918 1\n3\n\u003c/pre\u003e"}},{"title":"Sample Output 3","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e69942\n\u003c/pre\u003e"}}]}