纯粹思维题
#include <stdio.h>
#include <iostream>
#include <algorithm>
#define MME(i,j) memset(i,j,sizeof(i))
#include <string.h>
#define maxs 100100
#include <set>
using namespace std;
set<int>x,y;
int osx,osy;
__int64 ans[maxs];
int main()
{
int n,m;
while(~scanf("%d %d",&n,&m))
{
x.clear();
y.clear();
for(int i=0;i<m;i++)
{
scanf("%d %d",&osx,&osy);
x.insert(osx);
y.insert(osy);
ans[i]=(long long)(n-x.size())*(long long)( n-y.size() );
}
for(int i=0;i<m-1;i++)
printf("%I64d ",ans[i]);
printf("%I64d\n",ans[m-1]);
}
return 0;
}