Contests | Virtual Contests | Problems | Submit | Runs Status | Rank List | Forum |

Time Limit: 1.0 Seconds Memory Limit: 65536K

Total Runs: 622 Accepted Runs: 229 Multiple test files

Farmer John is calling his *N* (1 ≤ *N* ≤ 10) cows to a very important
meeting at a round table. ### Input

* Line 1: Two space-separated integers, *N* and *K* ### Output

* Line 1: The number of ways that the cows can sit down at the round
table such that two adjacent cows do not differ in height by
more than *K* millimeters.
### Sample Input

### Sample Output

### Input Details

There are 4 cows, with heights 2, 16, 6, and 10. Two cows whose heights
differ by more than 10 do not want to sit next to each other.
### Output Details

Clearly the cows with heights 2 and 16 must be opposite each other, so
there are 2 ways to place the cows of height 6 and 10.

The cows are rather anxious about this meeting since they want to
put forth their very best image. To make the table arrangement
attractive, they want to ensure that any two cows sitting next to
each other to differ in height by no more than *K* (1 ≤ *K* ≤ 1,000,000)
millimeters (cow *i* has integer height *H _{i}* (1 ≤

Help calculate the number of ways the cows can sit down at the round
table such that no two adjacent cows differ in height by more than
*K* millimeters. Two ways are different if there is at least one cow
with a different cow to its left in each arrangement.

The answer is guaranteed to fit in a 32-bit signed integer.

* Lines 2..*N* + 1: Line *i*+1 contains height *H _{i}*

4 10 2 16 6 10

2

Maintance:Fxz. Developer: SuperHacker, G.D.Retop, Fxz