https://school.programmers.co.kr/learn/courses/30/lessons/135808
import java.util.*;
class Solution {
public int solution(int k, int m, int[] score) {
int answer=0;
Arrays.sort(score);
int[] tScore=new int[score.length];
for(int i=0; i<score.length;i++){
tScore[i]=score[score.length-1-i];
}
int index=0;
while(true){
if(index>=tScore.length || index+m >tScore.length){
break;
}
answer += tScore[index+m-1]*m;
index+=m;
}
return answer;
}
}