Problem D. Round Subset

时间限制 2000 ms   内存限制 256 MB

Let's call the roundness of the number the number of zeros to which it ends.

You have an array of n numbers. You need to choose a subset of exactly k numbers so that the roundness of the product of the selected numbers will be maximum possible.

输入数据

The first line contains two integer numbers n and k (1 ≤ n ≤ 200, 1 ≤ k ≤ n).

The second line contains n space-separated integer numbers a1, a2, ..., an (1 ≤ ai ≤ 1018).

输出数据

Print maximal roundness of product of the chosen subset of length k.

样例

提交

请先 登录

© 2025 FAQs Contact About