;golfed it (apply * (map (comp count (fn [[t d]] (filter #(> (* (- t %) %) d) (range 1 t)))) {7 9 15 40 30 200}))