[백준] 16099

당당·2023년 6월 15일
0

백준

목록 보기
147/179

https://www.acmicpc.net/problem/16099

📔문제

In a lot of places in the world, elite universities come in pairs and their students like to challenge each other every year. In England, Oxford and Cambridge are famous for The Boat Race, an annual rowing race that opposes them. In Switzerland, students from Zürich and Lausanne battle in a famous annual ski challenge.

TelecomParisTech and Eurecom, two famous French schools, are also planning to organize a multi-sport tournament. They have already agreed on the choice of sports and the rules of the game, but the only point of disagreement is on where the contest should be hosted. Indeed, every school has been bragging for years about the wonderful sport facilities that they have.

At last, it was agreed that the competition would be hosted at the school which has the larger rectangular sports field. The only thing left is to determine which school this is: given the size of the fields, determine which school has the field with the larger surface.


📝입력

The input consists of several test cases. The first line contains an integer indicating the number of test cases. Each test case follows. Each test case consists of a single line containing 4 integers 1 ≤ lt, wt, le, we ≤ 10^9 separated by single spaces: lt and wt represent the length and width of the sports field of TelecomParisTech, and le and we represent the length and width of the sports field at Eurecom.


📺출력

For each test case in the input, your program should produce one line. The contents of the line should be the name of the school that has the facility with the larger area: TelecomParisTech or Eurecom. In case of a tie, the contents of the line should be Tie. There should be no blank lines in your output.


📝예제 입력 1

2
3 2 4 2
536874368 268792221 598 1204

📺예제 출력 1

Eurecom
TelecomParisTech

🔍출처

ICPC > Regionals > Europe > Southwestern European Regional Contest > Télécom ParisTech Internal Selection > Concours interne de programmation Télécom ParisTech 2017 F번


🧮알고리즘 분류

  • 수학
  • 사칙연산

📃소스 코드

import java.util.Scanner;

public class Code16099 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();

        for(int i=0;i<n;i++){
            long lt=sc.nextLong();
            long wt=sc.nextLong();

            long le=sc.nextLong();
            long we=sc.nextLong();

            if(lt*wt>le*we){
                System.out.println("TelecomParisTech");
            }
            else if(lt*wt<le*we){
                System.out.println("Eurecom");
            }
            else{
                System.out.println("Tie");
            }
        }
    }
}

📰출력 결과


📂고찰

입력받은 네 수 중 앞 두개와 뒤 두개의 곱을 비교하는 문제이다.

만약, 같으면 Tie를 출력하면 된다.

profile
MySQL DBA 신입 지원

0개의 댓글