class segtree: def __init__(self,n): self.size=1 while self.size1: x//=2 self.dat[x]=(self.dat[2*x]+self.dat[2*x+1]) def querry(self,u,v): u+=self.size v+=self.size score=0 while u