Polish version    English version  
  History of OI -> IV OI 1996/1997 -> Problems


 News
 About Olympic
 History of OI
XVII OI 2009/2010
XVI OI 2008/2009
XV OI 2007/2008
XIV OI 2006/2007
XIII OI 2005/2006
XII OI 2004/2005
XI OI 2003/2004
X OI 2002/2003
IX OI 2001/2002
VIII OI 2000/2001
VII OI 1999/2000
VI OI 1998/1999
V OI 1997/1998
IV OI 1996/1997
Stage III - results
Stage II - results
Stage I - results
Problems
Regulations
Organization
Hints
Schedule
III OI 1995/1996
II OI 1994/1995
I OI 1993/1994
 OI books
 National team
 Olympic camps
 Photo gallery
 Links
 SIO
 MAIN
Niebieskie ksi.eczki
IV Olimpiada Informatyczna 1996/1997

Task: LIC
Author: Wojciech Rytter
The number of n-k-special sets

III stage contest  
Source fileLIC.??? (e.g. PAS,C, CPP)
Executable fileLIC.EXE
Input fileLIC.IN
Output fileLIC.OUT

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

  1. for every x belonging to the set X: 1 <= x <= n,
  2. the sum of all integers from X is greater than k,
  3. X does not contain a pair of consecutive natural numbers.

Task

Write a program that:
  • reads two natural numbers n and k from the text file LIC.IN,
  • computes the number of n-k-special sets,
  • writes the result to the text file LIC.OUT.

Input

In the first line of the text file LIC.IN there are two natural numbers n and k separated by a single space, 1 <= n <= 100, 0 <= k <= 400.

Output

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

Example

For the text file LIC.IN:
5 6
the correct solution is the text file LIC.OUT
3





Print friendly version