본문 바로가기

백준

[백준]8370 Plane python

Plane 출처다국어분류

시간 제한메모리 제한제출정답맞은 사람정답 비율

1 초 128 MB 1364 1232 1175 91.511%

문제

Byteland Airlines recently extended their aircraft fleet with a new model of a plane. The new acquisition has n1 rows of seats in the business class and n2 rows in the economic class. In the business class each row contains k1 seats, while each row in the economic class has k2 seats.

Write a program which:

  • reads information about available seats in the plane,
  • calculates the sum of all seats available in that plane,
  • writes the result.

입력

In the first and only line of the standard input there are four integers n1, k1, n2 and k2 (1 ≤ n1, k1, n2, k2 ≤ 1 000), separated by single spaces.

출력

The first and only line of the standard output should contain one integer - the total number of seats available in the plane.

뭔가 예제만 보면 2*5 + 3*20 = 70 이거 아닐까? 했는데

일단 문제를 한번 본다.

읽어보니까 n1 줄에는 k1 갯수의 좌석이 있고,

n2 줄에는 k2개의 좌석이 있다.

모두 좌석의 갯수를 구하는 거니까 내가 생각했던 2*5 + 3*20이 맞다.

 

a_list= list(map(int, input().split()))
print(a_list[0]*a_list[1] + a_list[2]*a_list[3])
반응형

'백준' 카테고리의 다른 글

[프로그래머스]프린터 python  (0) 2021.05.17
[백준]8393 합 python  (0) 2021.04.16
[백준]7287 등록 python  (0) 2021.04.14
[백준]Next in line 6749 python  (0) 2021.04.13
[백준]5554 심부름 가는 길 python  (0) 2021.04.12