N-K Special

View as PDF

Submit solution

Points: 10 (partial)
Time limit: 1.0s
Memory limit: 16M

Problem type

We define "n-k special" set X of positive integer numbers as follows:

  • each element x that belongs to set X must meet the restriction 1xn.
  • the sum of elements of the set X must be larger than k.
  • no pair of elements belonging to the set can be consecutive numbers.

Write a program that reads n and k (1n100;0k400) as its input and outputs the total number of "n-k special" sets.

Sample Input

Copy
5 6

Sample Output

Copy
3

Explanation

Sets:

  1. {1,3,5}
  2. {2,5}
  3. {3,5}

meet the given criteria. No other sets exist.


Comments

There are no comments at the moment.