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

24573번 - Good Fours and Good Fives 서브태스크다국어

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

문제

Finn loves Fours and Fives. In fact, he loves them so much that he wants to know the number of ways a number can be formed by using a sum of fours and fives, where the order of the fours and fives does not matter. If Finn wants to form the number 14, there is one way to do this which is 14 = 4 + 5 + 5. As another example, if Finn wants to form the number 20, this can be done two ways, which are 20 = 4 +たす 4 +たす 4 +たす 4 +たす 4 and 20 = 5 +たす 5 +たす 5 +たす 5. As a final example, Finn can form the number 40 in three ways: 40 = 4+たす4+たす4+たす4+たす4+たす4+たす4+たす4+たす4+たす4, 40 = 4 +たす 4 +たす 4 +たす 4 +たす 4 +たす 5 +たす 5 +たす 5 +たす 5, and 40 = 5 +たす 5 +たす 5 +たす 5 +たす 5 +たす 5 +たす 5 +たす 5.

Your task is to help Finn determine the number of ways that a number can be written as a sum of fours and fives.

입력

The input consists of one line containing a number N.

출력

Output the number of unordered sums of fours and fives which form the number N. Output 0 if there are no such sums of fours and fives.

제한

서브태스크

번호배점제한
13

1 ≤ N ≤ 10

22

1 ≤ N ≤ 100 000, N is a multiple of 4

32

1 ≤ N ≤ 100 000, N is a multiple of 5

48

1 ≤ N ≤ 1 000 000

예제 입력 1

14

예제 출력 1

1

This is one of the examples in the problem description.

예제 입력 2

40

예제 출력 2

3

This is one of the examples in the problem description.

예제 입력 3

6

예제 출력 3

0

There is no way to use a sum of fours and fives to get 6.

힌트

출처

Olympiad > Canadian Computing Competition & Olympiad > 2022 > CCC 2022 Senior Division 1번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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