{"trustable":false,"sections":[{"title":"","value":{"format":"MD","content":"炸酱面给了烤烤一只储钱罐!平时做家务获得的零花钱就可以放到储钱罐里。现在烤烤想要买一个心爱的玩具车,可是时间长了,烤烤记不清储钱罐里面一共有多少钱。\n\u003cp\u003e聪明的烤烤想到了一个办法:称一下储蓄罐的重量,猜猜里面有多少硬币。假设我们能够准确地确定储钱罐的重量,并且知道放入的各种硬币的重量。烤烤希望在有把握买心爱的玩具车时再砸罐取钱,不要出现过早砸碎储钱罐的情况!\u003c/p\u003e\n请你根据给定的重量确定储钱罐内的最低数额!"}},{"title":"Input","value":{"format":"MD","content":"输入的第一行为测试数据的组数 \u003ci\u003eT\u003c/i\u003e。\n每组输入第一行包含两个整数 \u003ci\u003eE\u003c/i\u003e 和 \u003ci\u003eF\u003c/i\u003e,代表空储钱罐和现在的储钱罐重量。\n( 1\u003c\u003d \u003ci\u003eE\u003c/i\u003e \u003c\u003d \u003ci\u003eF\u003c/i\u003e \u003c\u003d10000。)\n第二行为整数 \u003ci\u003eN\u003c/i\u003e ( 1\u003c\u003d \u003ci\u003eN\u003c/i\u003e \u003c\u003d500 ),代表硬币的种类数。\n下面是 \u003ci\u003eN\u003c/i\u003e 行,每行包含两个整数 \u003ci\u003eP\u003c/i\u003e 和 \u003ci\u003eW\u003c/i\u003e,代表该硬币的价值和重量。\n ( 1\u003c\u003d \u003ci\u003eP\u003c/i\u003e \u003c\u003d50000,1\u003c\u003d \u003ci\u003eW\u003c/i\u003e \u003c\u003d10000 )。"}},{"title":"Output","value":{"format":"MD","content":"每组测试数据输出一行。\n输出“The minimum amount of money in the piggy-bank is X.”其中X是给定重量下的最低数额。\n如果无法准确达到给定重量,请输出“This is impossible.”"}},{"title":"Sample Input","value":{"format":"MD","content":"\u003cpre class\u003d\"sio\"\u003e3\n10 110\n2\n1 1\n30 50\n10 110\n2\n1 1\n50 30\n1 6\n2\n10 3\n20 4\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"MD","content":"\u003cpre class\u003d\"sio\"\u003eThe minimum amount of money in the piggy-bank is 60.\nThe minimum amount of money in the piggy-bank is 100.\nThis is impossible.\u003c/pre\u003e"}}]}