{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e给你两个容量分别为\u003cb\u003eA\u003c/b\u003e升和\u003cb\u003eB\u003c/b\u003e升的水壶。可以进行以下操作:\u003c/p\u003e\u003col\u003e\u003cli\u003eFILL(i)\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 从水龙头中给\u003cb\u003ei\u003c/b\u003e号水壶加满水(1 ≤ \u003cb\u003ei \u003c/b\u003e≤ 2);\u003c/li\u003e\u003cli\u003eDROP(i)\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 把\u003cb\u003ei\u003c/b\u003e号水壶中的水倒掉;\u003c/li\u003e\u003cli\u003ePOUR(i,j)\u0026nbsp;\u0026nbsp;\u0026nbsp; 把\u003cb\u003ei\u003c/b\u003e号水壶中的水倒到\u003cb\u003ej\u003c/b\u003e号水壶中;此操作后,要么\u003cb\u003ej\u003c/b\u003e号水壶满了(而\u003cb\u003ei\u003c/b\u003e号水壶中可能还有水),要么\u003cb\u003ei\u003c/b\u003e号水壶空了(所有水都倒到\u003cb\u003ej\u003c/b\u003e号水壶中)。\u003c/li\u003e\u003c/ol\u003e\u003cp\u003e编写程序找出操作序列中最短的一组,使得其中一个水壶中恰好有\u003cb\u003eC\u003c/b\u003e升水。\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e第一行为三个整数\u003cb\u003eA\u003c/b\u003e、\u003cb\u003eB\u003c/b\u003e和\u003cb\u003eC\u003c/b\u003e,均在1到100的范围内,且\u003cb\u003eC\u003c/b\u003e≤max(\u003cb\u003eA\u003c/b\u003e,\u003cb\u003eB\u003c/b\u003e)。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e输出的第一行包含操作序列的长度\u003cb\u003eK\u003c/b\u003e。接下来的\u003cb\u003eK\u003c/b\u003e行描述每个操作。如果有多个最短长度的序列,输出任意一个。如果无法达到所需结果,则输出文件的第一行为单词‘\u003cb\u003eimpossible\u003c/b\u003e’。\u003c/p\u003e"}},{"title":"示例","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3 5 4\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e6\r\nFILL(2)\r\nPOUR(2,1)\r\nDROP(1)\r\nPOUR(2,1)\r\nFILL(2)\r\nPOUR(2,1)\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}