@@ -0,0 +1,839 @@
+import java.util.*;%0Aimport java.io.*;%0A%0Aclass NewYearChaos %7B%0A%09static void minimumBribes(int%5B%5D q) %7B%0A        int ans = 0;%0A        for (int i = q.length - 1; i %3E= 0; i--) %7B%0A            if (q%5Bi%5D - (i + 1) %3E 2) %7B%0A                System.out.println(%22Too chaotic%22);%0A                return;%0A            %7D%0A            for (int j = Math.max(0, q%5Bi%5D - 2); j %3C i; j++)%0A                if (q%5Bj%5D %3E q%5Bi%5D) ans++;%0A        %7D%0A        System.out.println(ans);%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        int t = in.nextInt();%0A        for(int a0 = 0; a0 %3C t; a0++)%7B%0A            int n = in.nextInt();%0A            int%5B%5D q = new int%5Bn%5D;%0A            for(int q_i = 0; q_i %3C n; q_i++)%7B%0A                q%5Bq_i%5D = in.nextInt();%0A            %7D%0A            minimumBribes(q);%0A        %7D%0A        in.close();%0A    %7D%0A%7D

Add one more solution