{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cimg src\u003d\"CDN_BASE_URL/623e192a7b5eca6dd8c4dfa91dd97386?v\u003d1716169956\" align\u003d\"right\"\u003eWe say that x is a perfect square if, for some integer b, x \u003d b\u003csup\u003e2\u003c/sup\u003e. Similarly, x is a perfect cube if, for some integer b, x \u003d b\u003csup\u003e3\u003c/sup\u003e. More generally, x is a perfect pth power if, for some integer b, x \u003d b\u003csup\u003ep\u003c/sup\u003e. Given an integer x you are to determine the largest p such that x is a perfect p\u003ci\u003eth\u003c/i\u003e power. "}},{"title":"Input","value":{"format":"HTML","content":"Each test case is given by a line of input containing x. The value of x will have magnitude at least 2 and be within the range of a (32-bit) int in C, C++, and Java. A line containing 0 follows the last test case. "}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output a line giving the largest integer p such that x is a perfect p\u003ci\u003eth\u003c/i\u003e power."}},{"title":"Sample","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\u003e17\r\n1073741824\r\n25\r\n0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n30\r\n2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}