#define _USE_MATH_DEFINES #include #include #include #include #include //#include #include #include #include #include #include #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)< ///////// typedef long long LL; typedef long double LD; ///////// using namespace::std; ///////// int main(void){ std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed;// //cout << setprecision(10);// int N;cin>>N; vector m,p,z; int a; rep(i,2*N){ cin>>a; if(a<0){ m.push_back(a); }else if(a==0){ z.push_back(a); }else{ p.push_back(a); } } int Dry=0,Wet=0,Moist=0;//-,+,0 vector::iterator mitr,pitr,zitr; sort( m.begin(), m.end() );//-5 -1 sort( p.begin(), p.end(), greater());//5 1 mitr = m.begin(); pitr = p.begin(); zitr = z.begin(); while( mitr != m.end() && pitr != p.end() ){ if(*mitr + *pitr < 0){ ++Dry;++mitr;++pitr; }else{ ++pitr; } } while( mitr != m.end() && zitr != z.end() ){ ++Dry;++mitr;++zitr;} Dry += (m.size() - Dry)/2; //// mitr = m.begin(); pitr = p.begin(); zitr = z.begin(); while( mitr != m.end() && pitr != p.end() ){ if( *mitr + *pitr > 0 ){ ++Wet;++mitr;++pitr; }else{ ++mitr; } } while( pitr != p.end() && zitr != z.end() ){ ++Wet;++pitr;++zitr;} Wet += (p.size() - Wet)/2; /////////// sort( m.begin(), m.end() ,greater() ); sort( p.begin(), p.end() ); mitr = m.begin(); pitr = p.begin(); while(mitr != m.end() && pitr != p.end() ){ if( *mitr + *pitr == 0){ ++Moist;++mitr;++pitr; }else if( -(*mitr) < *pitr ){ ++mitr; }else{ ++pitr; } } Moist += z.size()/2; cout << Dry << " " << Wet << " " << Moist << endl; return 0; }