int[] numbers = IntStream.range(0, N).map(i -> scan.nextInt()).toArray();
int[] numbers = IntStream.generate(() -> scan.nextInt()).limit(N).toArray();