import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.stream.Stream;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
ArrayList<Integer> sums = new ArrayList<Integer>();
int max = 0;
int maxCount = 0;
for(int i = 0;i<5;i++) {
String[] input = br.readLine().split(" ");
Stream<String> stream = Arrays.stream(input);
int[] scores = stream.mapToInt(Integer::parseInt).toArray();
int sum = Arrays.stream(scores).sum();
if(max < sum){
max = sum;
maxCount=i+1;
}
}
bw.write(String.format("%d %d",maxCount, max));
bw.flush();
bw.close();
}
}
댓글 영역