N-K Special
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 1 ≤ x ≤ n
- 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
SAMPLE INPUT
5 6
SAMPLE OUTPUT
3
EXPLANATION
Sets:1. {1, 3, 5}
2. {2, 5}
3. {3, 5}
meet the given criteria. No other sets exist.
All Submissions
Best Solutions
Point Value: 20 (partial)
Time Limit: 2.00s
Memory Limit: 16M
Added: Jan 13, 2009
Languages Allowed:
C++03, PAS, C, ASM, C#, C++11
Comments (Search)
You can either a) use string math or b) use 3 longints to store the number. (You might want to try aplusb2 first)