{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cp\u003e给定两个容器,容积分别是 \u003cb\u003eA\u003c/b\u003e 和 \u003cb\u003eB\u003c/b\u003e 升。允许执行以下操作:\u003c/p\u003e\n \u003col\u003e\n \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\n \u003cli\u003eDROP(i)\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 将容器 \u003cb\u003ei\u003c/b\u003e 中的水倒掉;\u003c/li\u003e\n \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\n \u003c/ol\u003e\n \u003cp\u003e编写程序,找出最短的操作序列,使得两个容器中的其中一个恰好装了 \u003cb\u003eC\u003c/b\u003e 升水。\u003c/p\u003e\n "}},{"title":"输入","value":{"format":"HTML","content":"\n \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\n "}},{"title":"输出","value":{"format":"HTML","content":"\n \u003cp\u003e输出的第一行必须包含操作序列的长度 \u003cb\u003eK\u003c/b\u003e 。接下来的 \u003cb\u003eK\u003c/b\u003e 行必须每行描述一个操作。如果最短长度对应了多个序列,则输出它们中的任意一种。如果无法达到想要的结果,则只需输出单词 ‘\u003cb\u003eimpossible\u003c/b\u003e’ 。\u003c/p\u003e\n "}},{"title":"示例输入","value":{"format":"HTML","content":"\n \u003cpre\u003e3 5 4\u003c/pre\u003e\n "}},{"title":"示例输出","value":{"format":"HTML","content":"\n \u003cpre\u003e6\nFILL(2)\nPOUR(2,1)\nDROP(1)\nPOUR(2,1)\nFILL(2)\nPOUR(2,1)\u003c/pre\u003e\n "}}]}