#include #include #include #define repeat(i,n) for (int i = 0; (i) < (n); ++(i)) #define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x) using namespace std; template T input(istream & in) { T a; in >> a; return a; } int signof(int x) { return x > 0 ? 1 : x < 0 ? -1 : 0; } int foo(vector const & a, int sign) { int cnt = 0; for (int i = 0, j = a.size() - 1; i < j; ++ i, -- j) { while (i < j and signof(a[i] + a[j]) != sign) -- j; if (i == j) break; ++ cnt; } return cnt; } int main() { int n; cin >> n; vector a(2*n); repeat (i,2*n) cin >> a[i]; int dry = foo(a, -1); int moist = foo(a, 0); whole(reverse, a); int wet = foo(a, 1); cout << dry << ' ' << wet << ' ' << moist << endl; return 0; }