최대 1 분 소요

1. 문제

[Bronze V] Plane - 8370

문제 링크

성능 요약

메모리: 30864 KB, 시간: 72 ms

분류

사칙연산(arithmetic), 수학(math)

문제 설명

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.

출처: 백준, https://https://www.acmicpc.net/

2. 해결방법 시간복잡도

  1. 단순 코딩 O(1)

3. 문제 해결 및 코드


  • 주석을 참고하면서 이해를 돕습니다.

4. 알고리즘 및 해설

  1. 받은 4개의 값을 위의 문제에서 제시한 조건에 맞게 출력해준다.