Qi the Chuan Shen (船神) has decided to build a tower using boats! Each boat i has a width Wi. In order to prevent the tower from toppling, Qi has calculated that a boat of width A can only be placed directly on top of a boat of width B if A ≤ B+Q, where Q is Qi's constant. Help Qi compute the number of different towers he can build using each of the N boats exactly once!
Note: Two towers are different if the order of boats from bottom to top is different.
4 1 1 2 3 3