codeforces round 223, tle on C
codeforces 223, speed up C, replace avl tree with segment tree