I think that 3294 is not easy. I think I have a O(n (lg (n))^3) divide and conquer algorithm that uses range trees and that recursively bisects the point set according to bamboo "deliciousness", and intuitively I think that in practice my algo would run in O(n (lg (n))^2)