你能解释一下这个codechef程序的测试用例吗?

时间:2014-09-07 14:23:30

标签: algorithm

我正试图解决当前正在进行的九月挑战问题:http://www.codechef.com/SEPT14/problems/FACTORIZ 我不想要解决这个问题只是想了解这个问题。基本上它是这样说的:

You are given an integer N, you need to find M positive integers A1, A2, A3, ..., AM, so that A1*A2*A3*...*AM would be equal to N. You should maximize the number M.
Input

The first line of the input contains the integer T, denoting the number of the test cases.

Then T lines follow, each one is describing a single test case and contains a single positive integer N.
Output

For each test case, output the integer M on the first line of the testcases' output. Then, output M lines, where the i-th should contain the number Ai. Ai should be a positive integer, greater than 1.
Input:
4
100
111
1000
48598496894

Output: 
2
10
10
2
37
3
2
10
100
1
48598496894 

有人可以解释一下测试用例吗?我的意思是如果我们想要最大化M,那么第一个测试用例的答案不应该是4(2 * 2 * 5 * 5)吗?类似于第二个和第三种情况?什么 该问题究竟是什么意思?我试图发表关于codechef问题的评论,但无法得到任何答案?请原谅我,如果问题不符合SO的标准。

1 个答案:

答案 0 :(得分:0)

由于这是挑战问题,"你应该最大化数量M"真的意味着"让M尽可能大;这就是你如何提高你的分数"。接受任何有效的部分分解。

相关问题