HDU - 1828(矩形周长并 扫描线算法 )
#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int maxn = 31111;int sumseg[maxn<<2],col[maxn<<2],len[maxn<<2],lbd[maxn<<2],rbd[maxn<<2];void build(int l,int r,int rt){sumseg[rt]=len[rt]=