two solutions added: one got AC (Fenwick trees), second got TL (segment trees)