http://acm.hdu.edu.cn/showproblem.php?pid=4348
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
const int maxn = 100010;
int n, m;
struct Node {
long long d, td;
int timelabel;
Node() {};
Node(long long _d, long long _td, int t) {
d = _d; td = _td; timelabel = t;
}
};
vector<Node> bit[maxn];
long long a[maxn], sum[maxn] = {0};
inline int lowbit(int x)
{
return x & (-x);
}
inline void update(int x, long long w, int timelabel)
{
int size;
long long tw = w * x;
while (x <= n) {
size = bit[x].size();
bit[x].push