Error says: "Make sure that your solution works with negative numbers like -2000000000
package pl.codegym.task.task05.task0532;
import java.io.*;
/*
Zadanie z algorytmami
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
long maksimum = 0;
int ilosc = Integer.parseInt(reader.readLine());
for (int i = 0; i < ilosc; i++) {
long a = Integer.parseInt(reader.readLine());
if (a<0 && maksimum == 0) {
long b = Integer.parseInt(reader.readLine());
maksimum = Math.max(a,b);
i++;
}
else maksimum = Math.max(maksimum, a);
}
//tutaj wpisz swój kod
System.out.println(maksimum);
}
}