#include <bits/stdc++.h>   using namespace std;   int main() {     long long N, M;     cin >> N >> M;     set<long long> x_t;     set<long long> y_t;     vector<long long> ans;     for (long long i = 0; i < M; i++) {       long long x, y;       cin >> x >> y;       if (x_t.find(x) == x_t.end()) x_t.insert(x);       if (y_t.find(y) == y_t.end()) y_t.insert(y);       long long tam_x = x_t.size();       long long tam_y = y_t.size();       ans.push_back(N * N - (tam_x + tam_y) * N + (tam_x * tam_y));     }     for (long long i = 0; i < ans.size() - 1; i++) cout << ans[i] <<    ;     cout << ans[ans.size() - 1] <<   n ;     return 0;   }   