Logo
(追記) (追記ここまで)

20571번 - Elevators 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB26220518178.696%

문제

Whenever a new building is built, it must comply with all the relevant building regulations. In particular, there are rules governing the number of elevators a building must have depending on its number of floors and zoning district.

If a building has only one floor, it doesn't need any elevators; otherwise, it needs more elevators the more floors it has, and the exact number depends on its zoning district. The following tables describe the number of elevators necessary for a building in each of the residential, commercial, and industrial zoning districts.

Residential Commercial Industrial
Floors Elevators Floors Elevators Floors Elevators
1ドル$ 0ドル$ 1ドル$ 0ドル$ 1ドル$ 0ドル$
2ドル-5$ 1ドル$ 2ドル-7$ 1ドル$ 2ドル-4$ 1ドル$
6ドル-10$ 2ドル$ 8ドル-14$ 2ドル$ 5ドル-8$ 2ドル$
11ドル-15$ 3ドル$ 15ドル-20$ 3ドル$ 9ドル-12$ 3ドル$
16ドル-20$ 4ドル$ 13ドル-16$ 4ドル$
17ドル-20$ 5ドル$

Table 1: Elevator requirements by zone

You are given the zoning district of a new building and how many floors it has. How many elevators does it need?

입력

The only line of input contains a string representing the zoning district of the building ("residential", "commercial", or "industrial"), followed by a space and an integer $N$ (1ドル \leq N \leq 20$), the number of floors the building has.

출력

Output a single integer: the number of elevators the building must have.

제한

예제 입력 1

residential 6

예제 출력 1

2

예제 입력 2

industrial 20

예제 출력 2

5

힌트

출처

University > UT Invitational Programming Contest > UT Invitational Programming Contest 2019 G번

  • 문제를 만든 사람: Ethan Arnold
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /