After receiving the primary report from the technical committee in general body elections, there is a clear indication of technical interference from outside. In this scenario, we may need to go for repolling for all positions. Election must be postponed and fresh election should be conducted after getting the full report from the technical committee. Due to these discripancies in the IIT Mandi elections, Dean students have come up with a new strategy of voting.
According to the strategy instead of counting number of votes for a candidate we are interested in total number of agenda points provided by the candidates in the following way:
Given N candidates, each candidate i will be having some Ni number of agenda points. There are K number of voters who will vote for these candidates on the basis of number of agenda points provided by the candidates. It is compulsory for all the voters to cast their vote and each voter is allowed to vote for only one cadidate. Whenever a vote is casted for a candidate, his current number of agenda points will get added to the total T (initially T = 0) and then his current agenda points will be changed to its 3rd largest divisor (if 3rd largest divisor doesn't exists, then the agenda points will be halved i.e Ni changes to floor(Ni / 2)).
Help the election committee to guide voters to cast their votes in such a way that it maximizes the total T.
Output the answer in a single line.
1 ≤ N, K ≤ 106
1 ≤ Ni ≤ 105
3 3
1 2 3
6
1 10
1
1
Scores will be calculated as follows:
Score = (1 - c / 3000) * 200
, where c
is the number of characters in your code. In case the characters exceed 3000, your score will be zero.
Total (T) | Agenda Points | Voters |
0 | 1 2 3 | --- |
3 | 1 2 1 | V1 |
5 | 1 1 1 | V2 |
6 | 0 1 1 | V3 |