반응형
Notice
Recent Posts
Recent Comments
Link
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Archives
Today
Total
07-02 00:01
관리 메뉴

ImJay

[파이썬/Python] 백준 16099번 Larger Sport Facility 본문

Solved.ac - Python/Bronze V

[파이썬/Python] 백준 16099번 Larger Sport Facility

ImJay 2022. 11. 21. 16:40
반응형

[파이썬/Python] 백준 16099번 Larger Sport Facility

 

16099번: Larger Sport Facility

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 f

www.acmicpc.net


문제

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.

 

해설

TelecomParisTech and Eurecom, two famous French schools, are also planning to organize a multi-sport tournament.

프랑스의 유명 학교인 TelecomParisTech와 Eurecom은 멀티 스포츠 토너먼트를 조직할 계획입니다.

 

At last, it was agreed that the competition would be hosted at the school which has the larger rectangular sports field.

더 큰 직사각형 운동장이 있는 학교에서 대회를 개최합니다.

 

given the size of the fields, determine which school has the field with the larger surface.

필드의 크기가 주어지면 더 큰 표면을 가진 필드가 있는 학교를 결정하십시오.

코드

test_case = int(input())

for _ in range (test_case):
    LT, WT, LE, WE = map(int, input().split())
    if LT * WT > LE * WE :
        print("TelecomParisTech")
    elif LT * WT < LE * WE :
        print("Eurecom")
    else :
        print("Tie")

풀이

1. 테스트 케이스 수 test_case 값을 입력 받습니다.

The input consists of several test cases. The first line contains an integer indicating the number of test cases. 

test_case = int(input())

 

2.  test_case 만큼 반복하여 lt, wt, le, we 를 입력 받습니다.

( lt, wt 는 TelecomParisTech 운동장의 길이와 너비, le, we 는 Eurecom 운동장의 길이와 너비 )

Each test case follows. Each test case consists of a single line containing 4 integers 1 ≤ lt, wt, le, we ≤ 109 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 _ in range (test_case):
    LT, WT, LE, WE = map(int, input().split())

 

3. 운동장의 넓이(LT * WT, LE * WE)를 비교하여 더 큰 운동장의 학교를 출력합니다. 같을 경우 Tie 를 출력합니다.

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.

for _ in range (test_case):
    LT, WT, LE, WE = map(int, input().split())
    if LT * WT > LE * WE :
        print("TelecomParisTech")
    elif LT * WT < LE * WE :
        print("Eurecom")
    else :
        print("Tie")

 

반응형
Comments