#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(int i=0;i0;x-=x&-x) ret+=bit[x]; return ret; } int main(void){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll i,j,k; ll M; cin >> N >> M; ll a=0; for(i=0;i> v[i]; for(i=0;i