当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。
Given a positive integer X, an X-factor chain of length m is a sequence of integers,
1 = X0, X1, X2, …, Xm = X
satisfying
Xi < Xi+1 and Xi | Xi+1 where a | b means a perfectly divides into b.
Now we are interested in the maximum length of X-factor chains and the number of chains of such length.
The input consists of several test cases. Each contains a positive integer X (X ≤ 220).
For each test case, output the maximum length and the number of such X-factors chains.
2 3 4 10 100
1 1 1 1 2 1 2 2 4 6
时间上限 | 内存上限 |
1000 | 65536 |