백준 2455 java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
public class bj2455 {
public static void main(String[] args) throws IOException {
//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int i;
int total = 0;
int out, in;
int max = 0;
Scanner scanner = new Scanner(System.in);
for(i = 0; i < 4; i++)
{
out = scanner.nextInt();
total -= out;
in = scanner.nextInt();
total += in;
if(max < total)
{
max = total;
}
}
System.out.println(max);
}
}