spoj dtree. Count the number of distinct elements in a given range. Usage is done using fenwick trees. Offline algorithm for queries