import java.util.*; public class Gift { public int getValue(int[] gifts, int n) { // write code here int pd = n / 2 + n % 2; Arrays.sort(gifts); int []sum=new int[100010]; for(int i=0;i<gifts.length;i++){ sum[gifts[i]]++; if(sum...