Aidana and Pita
면접 대비시간 제한2초메모리 제한1024 MB
n개의 피타(최대 25개)를 세 친구에게 나누어 행복도의 최댓값과 최솟값 차이를 최소로 만들고, 각 피타가 갈 친구 번호를 출력한다.
문제
Aidana loves pita. Yesterday she brought home pitas. Each pita has a tastiness value, which is an integer. Today three friends of Aidana will come to dinner. She will distribute all pitas among them; each pita will go to exactly one friend. The happiness of a friend is the sum of tastiness values of all pitas he or she received. Aidana wants to be fair. So help her find a distribution of pitas that minimizes the difference between her friends' maximum and minimum happiness.
입력
The first line contains one integer , the number of pitas .
The second line contains integers, , which are tastiness values for pitas ().
출력
Print integers: for each pita, print the friend's index to which this pita should go (friends' indices are 1, 2, and 3).
If there are several possible answers which minimize the difference between maximum and minimum happiness, print any one of them.