[BOJ 8095] The Number of N-k-special Sets

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 128M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

We say that a set X of natural numbers is n-k-special if:</p>

  • for every x ∈ X we have 1 ≤ x ≤ n,
  • the sum of all integers from X is greater than k,
  • X does not contain a pair of consecutive natural numbers.

Write a program that:

  • reads two natural numbers n and k from the standard input,
  • computes the number of n-k-special sets,
  • writes the result to the standard output.
## 입력 형식

In the first line of the standard input there are two natural numbers n and k separated by a single space, 1 ≤ n ≤ 100, 0 ≤ k ≤ 400.

출력 형식

In the first line of the standard output there should be written one non-negative integer, which equals the number of n-k-special sets for the given n and k.

예제 입력

5 6

예제 출력

3

Comments

There are no comments at the moment.