본문 바로가기

백준/기타 문제

백준 25600 자바

반응형

 

 

import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int n = Integer.parseInt(br.readLine());

        int max = 0;
        for (int i = 0; i < n; i++) {
            StringTokenizer st = new StringTokenizer(br.readLine());

            int score;

            int a = Integer.parseInt(st.nextToken());
            int b = Integer.parseInt(st.nextToken());
            int c = Integer.parseInt(st.nextToken());

            if (a == (b + c)) {
               score = (a * (b+c)) * 2;
            } else {
                score = a * (b+c);
            }
            max = Math.max(score,max);
        }
        System.out.println(max);
    }
}
반응형

'백준 > 기타 문제' 카테고리의 다른 글

백준 20001 자바  (0) 2022.12.21
백준 11328 자바  (0) 2022.11.09
백준 23627 자바  (0) 2022.11.04
백준 17838 자바  (0) 2022.11.04
백준 25494 자바  (0) 2022.11.01