On output i got min and max but sill is one requirements not meet.

package com.codegym.task.task07.task0721;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Arrays;
/*
Min and max in arrays
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int[] list = new int[20];
for (int i = 0; i < 20; i++) {
list[i] = (Integer.parseInt(reader.readLine()));
}
int max = 0;
int min = 0;
for (int i = 0; i < list.length; i++) {
if (list[i] > max) {
max = list[i];
} else if (list[i] < min) {
min = list[i];
}
}
int maximum = max;
int minimum = min;
//write your code here
System.out.print(maximum + " " + minimum);
}
}