221D — Little Elephant and Array
I've solved this problem using sqrt decomposition. but how can i solve it using segment tree?
Thanks in advance :)