I'm not sure what I did here because when I print both of the smaller arrays I get "two small arrays of 10 numbers each". I'm also not sure how it is possible to meet 1, 2, & 4, and still not meet 3.
package com.codegym.task.task07.task0705;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
One large array and two small ones
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int[] a = new int[20];
int[] a1 = new int[a.length/2];
int[] a2 = new int[a.length/2];
for (int i = 0; i<20; i++){
int r = Integer.parseInt(reader.readLine());
a[i] = r;
}
for (int i = 0; i<a.length; i++) {
if (i < a.length/2) {
a1[i] = a[i];
}
else {
a2[i-(a.length/2)] = a[i];
}
}
for (int e : a2) {
System.out.println(e);
}
//for (int e : a1) {
// System.out.println(e);
//}
}
}