{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"在这个问题中,给定一个整数 **s**。你可以通过给 **A** 加上 **x** 来将任何整数 **A** 转换为另一个整数 **B**。这里的 **x** 是 **A** 的一个质因数(请注意,1 和 **A** 不被视为 **A** 的因数)。现在,你的任务是找到将 **s** 转换为另一个整数 **t** 所需的最小转换次数。"}},{"title":"输入","value":{"format":"MD","content":"输入以一个整数 **T (\u0026#8804; 500)** 开始,表示测试用例的数量。\n\n每个测试包含两个整数:**s (1 \u0026#8804; s \u0026#8804; 100)** 和 **t (1 \u0026#8804; t \u0026#8804; 1000)**。"}},{"title":"输出","value":{"format":"MD","content":"对于每个测试用例,打印出案例编号和所需的最小转换次数。如果不可能,那么打印 `-1`。"}},{"title":"示例","value":{"format":"MD","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\u003e2\n6 12\n6 13\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 2\nCase 2: -1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}