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

25815번 - Cat’s Age 다국어

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

문제

There are several proposals for converting a cat’s age to human age. One such approach is as follows:

  1. The first year of cat’s age is equivalent to 15 years of human age.
  2. The second year of cat’s age is equivalent to 9 years of human age.
  3. Every year after the second year of cat’s age is equivalent to 4 years of human age.

For example, if a cat is 13-year old, the cat would be {(15) + (9) + [(13 – 2) * 4)]} = 68-year old in human age. Note that the above approach implies:

  1. If a cat is less than one-year old, each month of cat’s age will be equivalent to 15 months of human age. For example, if a cat is 5-month old, the cat would be (5 * 15) = 75-month old in human age, which is 6-year-and-3-month old.
  2. If a cat is older than one year but less than two-year old, each month of cat’s age after the first year will be equivalent to 9 months of human age. For example, if a cat is 1-year-and7-month old, the cat would be {(15 years) + [(7 * 9) months]} = {(15 years) + [63 months]} = 20-year-and-3-month old in human age.
  3. If a cat is beyond 2-year old, each month of cat’s age after the second year will be equivalent to 4 months of human age. For example, if a cat is 5-year-and-7-month old, the cat would be {(15 years) + (9 years) + [(5 – 2) * 4 years] + [(7 * 4) months]} = 38-yearand-4-month old in human age.

Given a cat’s age, convert it to human age.

입력

There is only one input line; it contains two integers: y (0 ≤ y ≤ 20), indicating the year part of the cat’s age and m (0 ≤ m ≤ 11), indicating the month part of the cat’s age.

출력

Print two integers indicating the cat’s age in human age (years and months). Note that the output value for months should not exceed 11.

제한

예제 입력 1

13 0

예제 출력 1

68 0

예제 입력 2

0 5

예제 출력 2

6 3

예제 입력 3

1 7

예제 출력 3

20 3

예제 입력 4

5 7

예제 출력 4

38 4

예제 입력 5

20 11

예제 출력 5

99 8

힌트

출처

University > University of Central Florida > 2021 Local Programming Contest (Qualifying Round) 4번

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

출처

대학교 대회

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

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