from AtCoder Library Practice Contest ACLPC_B B - Fenwick Tree フェニック木 木を作って、和を親に伝搬しておくことで範囲和がlogオーダーになる