@@ -0,0 +1,2010 @@
+import java.io.*;%0Aimport java.math.*;%0Aimport java.security.*;%0Aimport java.text.*;%0Aimport java.util.*;%0Aimport java.util.concurrent.*;%0Aimport java.util.regex.*;%0A%0Apublic class Solution %7B%0A%0A    // Complete the maximumPerimeterTriangle function below.%0A    static int%5B%5D maximumPerimeterTriangle(int%5B%5D sticks) %7B%0A        Arrays.sort(sticks);%0A        int i= sticks.length-1;%0A        if(true)%7B%0A            int max = sticks%5Bi%5D;%0A            int l1 = sticks%5Bi-1%5D;%0A            int l2 = sticks%5Bi-2%5D;%0A            while(i-2%3E=0)%7B%0A                if(l1+l2%3Emax)%7B%0A                    int%5B%5D k = %7Bl2,l1,max%7D;%0A                    return k;%0A                %7D%0A                while(sticks%5Bi%5D==max)%7B%0A                    --i;%0A                %7D%0A                //continue;%0A                if(i-2%3C0) break;%0A                max=sticks%5Bi%5D;%0A                l1 = sticks%5Bi-1%5D;%0A                l2 = sticks%5Bi-2%5D;%0A            %7D%0A        %7D%0A        int%5B%5D l =%7B-1%7D;%0A        //System.out.println(%22-1%22);%0A        return l;        %0A    %7D%0A%0A    private static final Scanner scanner = new Scanner(System.in);%0A%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv(%22OUTPUT_PATH%22)));%0A%0A        int n = scanner.nextInt();%0A        scanner.skip(%22(%5Cr%5Cn%7C%5B%5Cn%5Cr%5Cu2028%5Cu2029%5Cu0085%5D)?%22);%0A%0A        int%5B%5D sticks = new int%5Bn%5D;%0A%0A        String%5B%5D sticksItems = scanner.nextLine().split(%22 %22);%0A        scanner.skip(%22(%5Cr%5Cn%7C%5B%5Cn%5Cr%5Cu2028%5Cu2029%5Cu0085%5D)?%22);%0A%0A        for (int i = 0; i %3C n; i++) %7B%0A            int sticksItem = Integer.parseInt(sticksItems%5Bi%5D);%0A            sticks%5Bi%5D = sticksItem;%0A        %7D%0A%0A        int%5B%5D result = maximumPerimeterTriangle(sticks);%0A%0A        for (int i = 0; i %3C result.length; i++) %7B%0A            bufferedWriter.write(String.valueOf(result%5Bi%5D));%0A%0A            if (i != result.length - 1) %7B%0A                bufferedWriter.write(%22 %22);%0A            %7D%0A        %7D%0A%0A        bufferedWriter.newLine();%0A%0A        bufferedWriter.close();%0A%0A        scanner.close();%0A    %7D%0A%7D%0A

add MaximumPerimeterTriangle.java