#include #include #include using namespace std; #define Z(C,D,P)for(R=0,lo=0,hi=N-1;lov(N*=2); for(int i=0;i)Z((v[lo]+v[hi]==0?R++|hi--:1,lo++),hi--,<=) }