#include int tot; int tree[20001]; void up(int x) { if (x==1) return; int y=x>>1; if (tree[x]tree[y+1]) y++; if (y<=tot&&tree[y]