#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n, m, i, x, y;
  int r[100001] = {0}, c[100001] = {0};
  long long rc, cc;
  scanf("%d %d", &n, &m);
  rc = n;
  cc = n;
  while (m--) {
    scanf("%d %d", &x, &y);
    if (!r[x]) {
      r[x] = 1;
      --rc;
    }
    if (!c[y]) {
      c[y] = 1;
      --cc;
    }
    printf("%I64d ", rc * cc);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc3540,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x61aa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x61a84,%edx
call   1040 <memset@plt>
lea    -0xc3530(%rbp),%rdi
xor    %esi,%esi
mov    $0x61a84,%edx
call   1040 <memset@plt>
lea    0xe91(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
movslq -0x8(%rbp),%rax
mov    %rax,-0xc3538(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0xc3540(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1240 <main+0x110>
lea    0xe53(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
movslq -0x14(%rbp),%rax
cmpl   $0x0,-0x61aa0(%rbp,%rax,4)
jne    11ed <main+0xbd>
movslq -0x14(%rbp),%rax
movl   $0x1,-0x61aa0(%rbp,%rax,4)
mov    -0xc3538(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0xc3538(%rbp)
movslq -0x18(%rbp),%rax
cmpl   $0x0,-0xc3530(%rbp,%rax,4)
jne    1220 <main+0xf0>
movslq -0x18(%rbp),%rax
movl   $0x1,-0xc3530(%rbp,%rax,4)
mov    -0xc3540(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0xc3540(%rbp)
mov    -0xc3538(%rbp),%rsi
imul   -0xc3540(%rbp),%rsi
ff
lea    0xdd0(%rip),%rdi
call   1030 <printf@plt>
jmp    1192 <main+0x62>
mov    -0x4(%rbp),%eax
add    $0xc3540,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc3528,%rsp
lea    0x61aa0(%rsp),%rdi
mov    $0x61a84,%edx
xor    %esi,%esi
call   1040 <memset@plt>
lea    0x10(%rsp),%rdi
mov    $0x61a84,%edx
xor    %esi,%esi
call   1040 <memset@plt>
lea    0xe93(%rip),%rdi
lea    0xc(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rbx
subl   $0x1,(%rsp)
jae    1199 <main+0x69>
xor    %eax,%eax
add    $0xc3528,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe60(%rip),%r14
lea    0x8(%rsp),%r15
lea    0x4(%rsp),%r12
lea    0xe55(%rip),%r13
mov    %rbx,%rbp
jmp    11d5 <main+0xa5>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rsi
imul   %rbp,%rsi
mov    %r13,%rdi
call   1030 <printf@plt>
subl   $0x1,(%rsp)
jb     1185 <main+0x55>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1050 <scanf@plt>
movslq 0x8(%rsp),%rax
cmpl   $0x0,0x61aa0(%rsp,%rax,4)
jne    1201 <main+0xd1>
movl   $0x1,0x61aa0(%rsp,%rax,4)
add    $0xffffffffffffffff,%rbp
movslq 0x4(%rsp),%rax
cmpl   $0x0,0x10(%rsp,%rax,4)
jne    11c0 <main+0x90>
movl   $0x1,0x10(%rsp,%rax,4)
add    $0xffffffffffffffff,%rbx
jmp    11c0 <main+0x90>

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [7 x i8] c"%I64d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [100001 x i32]
%8 = alloca [100001 x i32]
%9 = alloca i64
%10 = alloca i64
store i32 0, i32* %1
%11 = bitcast [100001 x i32]* %7 to i8*
%12 = bitcast [100001 x i32]* %8 to i8*
%13 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
store i64 %15, i64* %9
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
store i64 %17, i64* %10
br label %18
18: ; preds = %47, %0
%19 = load i32, i32* %3
%20 = add nsw i32 %19, -1
store i32 %20, i32* %3
%21 = icmp ne i32 %19, 0
br i1 %21, label %22, label %52
22: ; preds = %18
%23 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6)
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [100001 x i32], [100001 x i32]* %7, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = icmp ne i32 %27, 0
br i1 %28, label %35, label %29
29: ; preds = %22
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [100001 x i32], [100001 x i32]* %7, i64 0, i64 %31
store i32 1, i32* %32
%33 = load i64, i64* %9
%34 = add nsw i64 %33, -1
store i64 %34, i64* %9
br label %35
35: ; preds = %29, %22
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [100001 x i32], [100001 x i32]* %8, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = icmp ne i32 %39, 0
br i1 %40, label %47, label %41
41: ; preds = %35
%42 = load i32, i32* %6
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [100001 x i32], [100001 x i32]* %8, i64 0, i64 %43
store i32 1, i32* %44
%45 = load i64, i64* %10
%46 = add nsw i64 %45, -1
store i64 %46, i64* %10
br label %47
47: ; preds = %41, %35
%48 = load i64, i64* %9
%49 = load i64, i64* %10
%50 = mul nsw i64 %48, %49
%51 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %50)
br label %18
52: ; preds = %18
%53 = load i32, i32* %1
ret i32 %53
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [7 x i8] c"%I64d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [100001 x i32]
%6 = alloca [100001 x i32]
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast [100001 x i32]* %5 to i8*
%12 = bitcast [100001 x i32]* %6 to i8*
%13 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%14 = load i32, i32* %1
%15 = sext i32 %14 to i64
%16 = load i32, i32* %2
%17 = add nsw i32 %16, -1
store i32 %17, i32* %2
%18 = icmp eq i32 %16, 0
br i1 %18, label %46, label %19
19: ; preds = %0, %39
%20 = phi i64 [ %40, %39 ], [ %15, %0 ]
%21 = phi i64 [ %31, %39 ], [ %15, %0 ]
%22 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [100001 x i32], [100001 x i32]* %5, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %19
store i32 1, i32* %25
%29 = add nsw i64 %21, -1
br label %30
30: ; preds = %28, %19
%31 = phi i64 [ %21, %19 ], [ %29, %28 ]
%32 = load i32, i32* %4
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [100001 x i32], [100001 x i32]* %6, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %30
store i32 1, i32* %34
%38 = add nsw i64 %20, -1
br label %39
39: ; preds = %37, %30
%40 = phi i64 [ %20, %30 ], [ %38, %37 ]
%41 = mul nsw i64 %40, %31
%42 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %41)
%43 = load i32, i32* %2
%44 = add nsw i32 %43, -1
store i32 %44, i32* %2
%45 = icmp eq i32 %43, 0
br i1 %45, label %46, label %19
46: ; preds = %39, %0
ret i32 0
}