public static void main(String[]args){ Scanner in = new Scanner(System.in); int N = in.nextInt(); ArrayList<Integer>list = new ArrayList<>(); while (N-- > 0){ list.add(in.nextInt()); } System.out.println(fun(list)); } public static int fun(ArrayList<Integer&...