I'm five." With the fail of unit tests, XiaoYang tiredly lies on the sofa. As we all know, XiaoYang is not good at implementing algorithms. The unit test is for a subset searching algorithm. Here is the task. You are given a set A with n **distinct** integers a1,a2,,ana_1, a_2, cdots, a_na1,a2,,an. You should find a "five" subset S, so that the sum of numbers in S is maximized and the sum is divisible by 5. A set B={b1,b2,,bm}B = lbrace b_1, b_2, cdots, b_m rbraceB={b1,b2,,bm} of size m is called the subset of set A={a1,a2,,an}A = lbrace a_1, a_2, cdots, a_n rbraceA={a1,a2,,an} when bi∈Ab_i in Abi∈A holds for i=1,2,,mi = 1, 2, cdots, mi=1,2,,m and all integers in B are distinct.
"Today is another day! I'm five." With the fail of unit tests, XiaoYang tiredly lies on the sofa. As we all know, XiaoYang is not good at implementing algorithms. The unit test is for a subset searching algorithm. Here is the task. You are given a set A with n **distinct** integers a1,a2,⋯ ,ana_1, a_2, cdots, a_na1,a2,⋯,an. You should find a "five" subset S, so that the sum of numbers in S is maximized and the sum is divisible by 5. A set B={b1,b2,⋯ ,bm}B = lbrace b_1, b_2, cdots, b_m rbraceB={b1,b2,⋯,bm} of size m is called the subset of set A={a1,a2,⋯ ,an}A = lbrace a_1, a_2, cdots, a_n rbraceA={a1,a2,⋯,an} when bi∈Ab_i in Abi∈A holds for i=1,2,⋯ ,mi = 1, 2, cdots, mi=1,2,⋯,m and all integers in B are distinct.