func_code_string: #include <bits/stdc++.h>   using namespace std;   vector<int> x[100100], y[100100];   vector<int> p[100100], q[100100], v[100100], w[100100];   int a[100100], b[100100], c[100100];   map<pair<int, int>, int> mp;   void solve() {     mp.clear();     int n, m;     scanf( %d%d , &n, &m);     for (int i = 0; i < m; i++) {       scanf( %d%d , &a[i], &b[i]);       x[a[i]].push_back(b[i]);       y[b[i]].push_back(a[i]);       if (a[i] + b[i] <= n + 1) {         int o = a[i] - 1, oo = o + b[i];         p[oo].push_back(b[i]);       } else {         int oo = n - b[i], o = a[i] - oo;         q[o].push_back(a[i]);       }       if (a[i] <= b[i]) {         int o = a[i] - 1, oo = b[i] - o;         v[oo].push_back(b[i]);       } else {         int oo = b[i], o = a[i] - oo + 1;         w[o].push_back(a[i]);       }     }     for (int i = 1; i <= n; i++) {       if (x[i].size() <= 1) continue;       sort(x[i].begin(), x[i].end());       for (int j = 0; j < x[i].size(); j++) {         int xx = i, yy = x[i][j];         if (j == 0 || j == x[i].size() - 1) {           mp[make_pair(xx, yy)]++;         } else {           mp[make_pair(xx, yy)] += 2;         }       }     }     for (int i = 1; i <= n; i++) {       if (y[i].size() <= 1) continue;       sort(y[i].begin(), y[i].end());       for (int j = 0; j < y[i].size(); j++) {         int xx = y[i][j], yy = i;         if (j == 0 || j == y[i].size() - 1) {           mp[make_pair(xx, yy)]++;         } else {           mp[make_pair(xx, yy)] += 2;         }       }     }     for (int i = 1; i <= n; i++) {       if (p[i].size() <= 1) continue;       sort(p[i].begin(), p[i].end());       for (int j = 0; j < p[i].size(); j++) {         int yy = p[i][j];         int xx = i - yy + 1;         if (j == 0 || j == p[i].size() - 1) {           mp[make_pair(xx, yy)]++;         } else {           mp[make_pair(xx, yy)] += 2;         }       }     }     for (int i = 1; i <= n; i++) {       if (q[i].size() <= 1) continue;       sort(q[i].begin(), q[i].end());       for (int j = 0; j < q[i].size(); j++) {         int xx = q[i][j];         int yy = n - (xx - i);         if (j == 0 || j == q[i].size() - 1) {           mp[make_pair(xx, yy)]++;         } else {           mp[make_pair(xx, yy)] += 2;         }       }     }     for (int i = 1; i <= n; i++) {       if (v[i].size() <= 1) continue;       sort(v[i].begin(), v[i].end());       for (int j = 0; j < v[i].size(); j++) {         int yy = v[i][j];         int xx = yy - i + 1;         if (j == 0 || j == v[i].size() - 1) {           mp[make_pair(xx, yy)]++;         } else {           mp[make_pair(xx, yy)] += 2;         }       }     }     for (int i = 1; i <= n; i++) {       if (w[i].size() <= 1) continue;       sort(w[i].begin(), w[i].end());       for (int j = 0; j < w[i].size(); j++) {         int xx = w[i][j];         int yy = xx - i + 1;         if (j == 0 || j == w[i].size() - 1) {           mp[make_pair(xx, yy)]++;         } else {           mp[make_pair(xx, yy)] += 2;         }       }     }     map<pair<int, int>, int>::iterator iter;     iter = mp.begin();     int s = 0;     while (iter != mp.end()) {       int o = iter->second;       pair<int, int> v = iter->first;       c[o]++;       s++;       iter++;     }     printf( %d , m - s);     for (int i = 1; i < 9; i++) printf(  %d , c[i]);   }   int main() { solve(); }   