QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#870158#3315. Eulerian Flight TourHuangHanShengAC ✓2ms3968kbC++142.8kb2025-01-25 15:02:152025-01-25 15:02:21

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3840kb

input:

11 10
1 2
2 3
3 4
4 5
6 7
7 8
8 9
9 10
10 11
6 11

output:

45
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
2 4
2 5
2 6
2 7
2 8
2 9
2 10
2 11
3 5
3 6
3 7
3 8
3 9
3 10
3 11
4 6
4 7
4 8
4 9
4 10
4 11
5 6
5 7
5 8
5 9
5 10
5 11
6 8
6 9
6 10
7 9
7 10
7 11
8 10
8 11
9 11

result:

ok 

Test #2:

score: 0
Accepted
time: 1ms
memory: 3968kb

input:

87 86
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53
53 54...

output:

3655
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 ...

result:

ok 

Test #3:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

11 21
1 2
1 3
2 3
2 4
3 4
3 5
4 5
1 4
2 5
6 7
6 8
7 8
7 9
8 9
8 10
9 10
9 11
10 11
6 10
6 11
7 11

output:

34
1 5
1 6
1 7
1 8
1 9
1 10
1 11
2 6
2 7
2 8
2 9
2 10
2 11
3 6
3 7
3 8
3 9
3 10
3 11
4 6
4 7
4 8
4 9
4 10
4 11
5 6
5 7
5 8
5 9
5 10
5 11
6 9
7 10
8 11

result:

ok 

Test #4:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

87 260
1 2
1 3
1 4
2 3
2 4
2 5
3 4
3 5
3 6
4 5
4 6
4 7
5 6
5 7
5 8
6 7
6 8
6 9
7 8
7 9
7 10
8 9
8 10
8 11
9 10
9 11
9 12
10 11
10 12
10 13
11 12
11 13
11 14
12 13
12 14
12 15
13 14
13 15
13 16
14 15
14 16
14 17
15 16
15 17
15 18
16 17
16 18
16 19
17 18
17 19
17 20
18 19
18 20
18 21
19 20
19 21
19 22...

output:

3481
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 63
1 64
1 65
1 66
...

result:

ok 

Test #5:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

11 9
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
1 10

output:

46
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 11
2 4
2 5
2 6
2 7
2 8
2 9
2 10
2 11
3 5
3 6
3 7
3 8
3 9
3 10
3 11
4 6
4 7
4 8
4 9
4 10
4 11
5 7
5 8
5 9
5 10
5 11
6 8
6 9
6 10
6 11
7 9
7 10
7 11
8 10
8 11
9 11
10 11

result:

ok 

Test #6:

score: 0
Accepted
time: 0ms
memory: 3968kb

input:

87 85
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53
53 ...

output:

3656
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 6...

result:

ok 

Test #7:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

11 19
1 3
2 3
2 4
3 4
3 5
4 5
4 6
5 6
5 7
6 7
6 8
7 8
7 9
8 9
8 10
9 10
1 9
1 10
2 10

output:

36
1 2
1 4
1 5
1 6
1 7
1 8
1 11
2 5
2 6
2 7
2 8
2 9
2 11
3 6
3 7
3 8
3 9
3 10
3 11
4 7
4 8
4 9
4 10
4 11
5 8
5 9
5 10
5 11
6 9
6 10
6 11
7 10
7 11
8 11
9 11
10 11

result:

ok 

Test #8:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

87 343
1 3
1 4
1 5
2 3
2 4
2 5
2 6
3 4
3 5
3 6
3 7
4 5
4 6
4 7
4 8
5 6
5 7
5 8
5 9
6 7
6 8
6 9
6 10
7 8
7 9
7 10
7 11
8 9
8 10
8 11
8 12
9 10
9 11
9 12
9 13
10 11
10 12
10 13
10 14
11 12
11 13
11 14
11 15
12 13
12 14
12 15
12 16
13 14
13 15
13 16
13 17
14 15
14 16
14 17
14 18
15 16
15 17
15 18
15 19...

output:

3398
1 2
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 63
1 64
...

result:

ok 

Test #9:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

11 20
5 9
4 5
4 9
1 9
1 4
4 8
1 8
1 6
6 8
8 10
6 10
3 6
3 10
2 10
2 3
3 11
2 11
2 5
5 11
9 11

output:

35
1 2
1 3
1 5
1 7
1 10
1 11
2 4
2 6
2 7
2 8
2 9
3 4
3 5
3 7
3 8
3 9
4 6
4 7
4 10
4 11
5 6
5 7
5 8
5 10
6 7
6 9
6 11
7 8
7 9
7 10
7 11
8 9
8 11
9 10
10 11

result:

ok 

Test #10:

score: 0
Accepted
time: 0ms
memory: 3968kb

input:

87 344
38 45
45 70
45 75
45 72
38 70
38 75
38 72
35 38
70 75
70 72
35 70
47 70
72 75
35 75
47 75
4 75
35 72
47 72
4 72
23 72
35 47
4 35
23 35
35 85
4 47
23 47
47 85
47 82
4 23
4 85
4 82
2 4
23 85
23 82
2 23
13 23
82 85
2 85
13 85
80 85
2 82
13 82
80 82
57 82
2 13
2 80
2 57
2 15
13 80
13 57
13 15
13 ...

output:

3397
1 2
1 3
1 4
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 18
1 20
1 21
1 22
1 23
1 25
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 50
1 51
1 52
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 63
1 64
1 65
1 66
1 67
1 68
1 ...

result:

ok 

Test #11:

score: 0
Accepted
time: 2ms
memory: 3840kb

input:

100 4850
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62...

output:

2
23 47
23 91

result:

ok 

Test #12:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

100 4849
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62...

output:

3
24 45
24 98
75 76

result:

ok 

Test #13:

score: 0
Accepted
time: 2ms
memory: 3840kb

input:

100 4848
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 60
1 61
1 62...

output:

4
6 59
25 68
35 59
49 69

result:

ok 

Test #14:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

100 4804
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 59
1 60
1 61
1 62
1 63
1 64...

output:

48
1 57
1 58
1 92
3 84
3 90
4 24
6 8
6 78
9 89
10 60
12 14
12 86
13 38
15 29
15 35
16 79
18 85
19 33
21 90
22 83
25 48
26 57
26 81
26 97
30 63
30 77
31 45
31 66
32 68
32 81
36 43
37 86
41 86
42 85
43 70
43 84
43 86
45 61
47 69
59 72
59 83
65 68
70 71
73 86
74 92
75 90
93 95
97 99

result:

ok 

Test #15:

score: 0
Accepted
time: 2ms
memory: 3840kb

input:

100 4801
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 58
1 59
1 60
1 61
1 62
1 63...

output:

51
1 20
2 16
3 63
3 91
3 99
5 63
7 62
7 82
12 53
14 64
15 77
17 37
17 74
18 24
18 64
19 69
19 75
19 91
20 57
21 33
22 63
23 24
23 40
24 64
25 73
25 100
28 57
29 52
30 38
32 84
33 44
34 71
36 77
43 84
43 93
47 83
48 52
48 99
50 97
54 57
54 91
55 83
59 65
62 71
63 97
64 96
65 70
66 73
68 75
72 74
78 89

result:

ok 

Test #16:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

10 36
1 2
1 3
1 5
1 6
1 7
1 8
1 9
1 10
2 3
2 5
2 6
2 7
2 8
2 9
2 10
3 5
3 6
3 7
3 8
3 9
3 10
5 6
5 7
5 8
5 9
5 10
6 7
6 8
6 9
6 10
7 8
7 9
7 10
8 9
8 10
9 10

output:

-1

result:

ok 

Test #17:

score: 0
Accepted
time: 2ms
memory: 3456kb

input:

100 4851
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61...

output:

-1

result:

ok 

Test #18:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

9 28
1 2
1 3
1 4
1 6
1 7
1 8
1 9
2 3
2 4
2 6
2 7
2 8
2 9
3 4
3 6
3 7
3 8
3 9
4 6
4 7
4 8
4 9
6 7
6 8
6 9
7 8
7 9
8 9

output:

8
1 5
2 5
3 5
4 5
5 6
5 7
5 8
5 9

result:

ok 

Test #19:

score: 0
Accepted
time: 2ms
memory: 3840kb

input:

99 4753
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
...

output:

98
1 81
2 81
3 81
4 81
5 81
6 81
7 81
8 81
9 81
10 81
11 81
12 81
13 81
14 81
15 81
16 81
17 81
18 81
19 81
20 81
21 81
22 81
23 81
24 81
25 81
26 81
27 81
28 81
29 81
30 81
31 81
32 81
33 81
34 81
35 81
36 81
37 81
38 81
39 81
40 81
41 81
42 81
43 81
44 81
45 81
46 81
47 81
48 81
49 81
50 81
51 81
...

result:

ok 

Test #20:

score: 0
Accepted
time: 1ms
memory: 3968kb

input:

96 0

output:

4466
1 2
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 ...

result:

ok 

Test #21:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

97 0

output:

4656
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 6...

result:

ok 

Test #22:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

10 40
1 2
1 3
1 4
1 6
1 7
1 8
1 9
1 10
2 4
2 5
2 6
2 7
2 8
2 9
2 10
3 4
3 5
3 6
3 7
3 8
3 9
3 10
4 5
4 7
4 8
4 9
4 10
5 6
5 7
5 8
5 9
5 10
6 7
6 8
6 9
6 10
7 9
7 10
8 9
8 10

output:

0

result:

ok 

Test #23:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

20 148
1 2
1 4
1 6
1 7
1 8
1 9
1 10
1 11
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
2 3
2 4
2 5
2 6
2 8
2 9
2 10
2 11
2 12
2 13
2 14
2 15
2 16
2 17
2 18
2 19
2 20
3 4
3 6
3 7
3 8
3 9
3 10
3 11
3 13
3 14
3 15
3 16
3 17
3 18
3 19
3 20
4 5
4 6
4 7
4 9
4 11
4 12
4 16
4 17
4 19
5 6
5 7
5 8
5 9
5 10
5 11
5 1...

output:

32
1 5
1 12
3 5
3 12
4 10
4 13
4 14
4 15
4 18
4 20
6 17
6 19
8 10
8 13
8 14
8 15
8 18
8 20
10 14
10 15
10 18
10 20
13 14
13 15
13 18
13 20
14 18
14 20
15 18
15 20
16 17
16 19

result:

ok 

Test #24:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

30 348
1 2
1 3
1 4
1 5
1 6
1 8
1 9
1 10
1 11
1 12
1 13
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 24
1 26
1 27
1 28
1 29
1 30
2 3
2 4
2 6
2 7
2 10
2 11
2 12
2 13
2 14
2 15
2 16
2 18
2 20
2 21
2 22
2 23
2 24
2 25
2 28
2 29
2 30
3 4
3 5
3 6
3 7
3 8
3 9
3 10
3 11
3 12
3 13
3 14
3 15
3 16
3 17
3 18
3 19
3 20
...

output:

72
1 14
1 15
1 23
1 25
2 8
2 9
2 17
2 19
2 26
2 27
4 16
4 22
4 28
4 30
5 8
5 9
5 17
5 19
5 26
5 27
6 16
6 22
6 28
6 30
7 14
7 15
7 23
7 25
8 17
8 19
8 26
8 27
9 17
9 19
9 26
9 27
10 12
10 13
10 18
10 20
10 21
10 24
11 12
11 13
11 18
11 20
11 21
11 24
12 18
12 20
12 21
12 24
13 18
13 20
13 21
13 24
1...

result:

ok 

Test #25:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

40 516
1 2
1 4
1 6
1 7
1 8
1 9
1 13
1 15
1 17
1 18
1 19
1 21
1 22
1 23
1 25
1 32
1 34
1 35
1 36
1 37
2 3
2 4
2 5
2 6
2 7
2 9
2 10
2 11
2 12
2 13
2 14
2 15
2 16
2 17
2 18
2 19
2 20
2 21
2 22
2 23
2 24
2 26
2 27
2 28
2 29
2 30
2 31
2 32
2 33
2 34
2 35
2 37
2 38
2 39
2 40
3 4
3 6
3 7
3 8
3 9
3 13
3 15
...

output:

244
1 5
1 10
1 11
1 12
1 14
1 16
1 20
1 24
1 26
1 27
1 28
1 29
1 30
1 31
1 33
1 38
1 39
1 40
2 25
2 36
3 5
3 10
3 11
3 12
3 14
3 16
3 20
3 24
3 26
3 27
3 28
3 29
3 30
3 31
3 33
3 38
3 39
3 40
4 7
4 9
4 13
4 17
4 18
4 19
4 23
4 32
4 35
4 37
5 11
5 12
5 14
5 16
5 20
5 24
5 26
5 27
5 28
5 29
5 30
5 31
...

result:

ok 

Test #26:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

50 960
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 12
1 13
1 16
1 17
1 18
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 33
1 35
1 36
1 38
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 50
2 3
2 5
2 7
2 8
2 10
2 11
2 12
2 14
2 15
2 17
2 18
2 19
2 20
2 22
2 23
2 24
2 25
2 27
2 28
2 29
2 30
2 31
2 32
...

output:

240
1 11
1 14
1 15
1 19
1 32
1 34
1 37
1 39
1 48
1 49
2 6
2 9
2 13
2 16
2 21
2 26
2 38
2 40
2 41
2 42
2 43
2 44
2 47
2 50
3 24
3 29
3 31
3 33
3 36
3 45
4 6
4 9
4 13
4 16
4 21
4 26
4 38
4 40
4 41
4 42
4 43
4 44
4 47
4 50
5 17
5 20
5 22
5 23
5 25
5 30
5 35
5 46
6 13
6 16
6 21
6 26
6 38
6 40
6 41
6 42
...

result:

ok 

Test #27:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

4 2
1 2
2 3

output:

2
1 4
3 4

result:

ok 

Test #28:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

4 3
1 2
2 3
1 3

output:

-1

result:

ok 

Test #29:

score: 0
Accepted
time: 0ms
memory: 3712kb

input:

4 3
1 2
2 3
3 4

output:

1
1 4

result:

ok 

Test #30:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

4 2
2 3
3 4

output:

2
1 2
1 4

result:

ok 

Test #31:

score: 0
Accepted
time: 0ms
memory: 3712kb

input:

4 2
3 4
1 4

output:

2
1 2
2 3

result:

ok 

Test #32:

score: 0
Accepted
time: 0ms
memory: 3712kb

input:

4 2
1 4
1 2

output:

2
2 3
3 4

result:

ok 

Test #33:

score: 0
Accepted
time: 1ms
memory: 3584kb

input:

98 4753
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
...

output:

-1

result:

ok 

Test #34:

score: 0
Accepted
time: 1ms
memory: 3584kb

input:

99 4851
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
...

output:

0

result:

ok 

Test #35:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

10 31
1 2
1 4
1 5
1 6
1 7
1 8
2 4
2 5
2 6
2 8
2 10
3 4
3 5
3 6
3 7
3 9
3 10
4 6
4 8
4 9
4 10
5 6
5 8
5 10
6 7
6 9
7 8
7 9
7 10
8 9
9 10

output:

8
1 9
1 10
2 7
2 9
4 5
5 7
6 8
8 10

result:

ok 

Test #36:

score: 0
Accepted
time: 2ms
memory: 3840kb

input:

100 4801
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 63...

output:

88
1 35
1 75
4 73
4 93
6 15
6 24
7 69
7 95
8 36
9 30
9 97
10 55
10 59
11 48
11 99
12 85
12 87
14 33
15 21
17 44
17 82
18 58
18 98
19 28
19 92
20 37
20 64
21 89
22 26
22 35
23 65
23 86
24 74
25 52
25 62
26 84
28 76
29 69
29 73
30 94
31 50
31 66
32 68
32 86
33 91
34 36
34 62
37 79
38 48
38 70
39 61
39...

result:

ok 

Test #37:

score: 0
Accepted
time: 2ms
memory: 3712kb

input:

100 4803
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 63
1 64...

output:

89
1 30
1 51
2 47
2 59
3 61
3 72
4 74
4 93
5 22
5 97
6 46
6 51
7 71
10 16
10 39
12 45
12 91
13 23
13 85
14 25
14 99
15 57
15 66
16 59
17 44
18 24
18 89
19 74
19 97
20 61
20 100
21 54
21 71
22 82
23 50
24 53
25 33
26 58
26 78
27 31
28 72
28 98
30 36
31 86
32 55
32 92
33 78
34 88
34 89
36 65
37 62
37 ...

result:

ok 

Test #38:

score: 0
Accepted
time: 1ms
memory: 3584kb

input:

92 4049
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
...

output:

-1

result:

ok 

Test #39:

score: 0
Accepted
time: 1ms
memory: 3584kb

input:

92 4005
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 63
...

output:

-1

result:

ok 

Test #40:

score: 0
Accepted
time: 1ms
memory: 3712kb

input:

93 4143
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
...

output:

135
1 38
2 21
2 42
2 87
3 80
3 81
4 46
4 56
4 58
4 89
5 27
5 44
5 61
6 80
6 81
7 11
7 23
7 51
7 53
8 15
8 27
8 44
8 75
9 13
9 27
9 45
9 70
9 82
9 91
9 92
10 18
10 20
10 28
10 33
11 57
11 62
12 26
13 19
13 54
13 69
14 33
15 47
16 21
16 26
16 80
17 26
17 30
17 88
18 33
18 93
19 58
19 68
19 81
19 86
20...

result:

ok 

Test #41:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

93 4096
1 2
1 3
1 4
1 5
1 6
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 61
1 62
1 63
1 64...

output:

182
1 7
1 20
1 60
1 84
2 27
2 66
3 18
3 60
3 83
4 91
5 38
5 43
5 61
5 85
6 9
6 57
6 90
7 12
7 47
7 72
7 78
7 84
8 25
8 42
8 62
8 74
8 77
9 73
10 34
10 76
11 51
11 52
11 82
11 88
12 17
12 33
12 45
12 82
13 27
13 38
13 53
13 54
13 61
13 77
13 80
13 83
14 27
14 34
14 58
14 75
14 78
15 31
15 57
16 32
17...

result:

ok 

Test #42:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

94 140
76 94
13 94
43 62
61 93
10 88
42 68
29 79
3 70
34 50
75 78
2 25
14 34
20 28
10 78
5 33
29 86
10 37
41 66
68 94
16 21
10 72
20 82
38 61
6 67
65 68
35 79
61 87
43 85
23 56
51 75
28 75
37 89
48 72
74 82
12 67
25 62
58 61
52 54
38 58
16 76
27 83
17 69
7 28
2 42
47 83
34 89
86 91
59 89
6 8
10 65
6...

output:

4139
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 46
1 47
1 48
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 63
1 64
1 6...

result:

ok 

Test #43:

score: 0
Accepted
time: 0ms
memory: 3968kb

input:

94 184
72 88
43 75
15 88
21 49
58 73
2 43
68 89
39 88
15 53
7 82
18 50
25 63
35 90
26 28
9 84
37 70
18 56
38 90
8 10
47 52
43 50
28 94
24 25
66 83
26 66
35 42
3 14
47 77
2 74
9 49
4 86
47 80
52 53
53 77
1 10
47 48
58 72
2 7
37 42
28 50
64 93
13 22
1 41
54 80
53 58
62 67
16 75
2 63
1 56
17 82
11 79
4...

output:

4095
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 40
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 57
1 58
1 59
1 60
1 61
1 62
1 63
1 64
1 65
1 66
1 ...

result:

ok 

Test #44:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

95 141
83 92
15 69
44 84
8 22
3 45
46 60
36 71
71 73
9 53
89 95
13 57
8 13
7 57
62 69
12 93
6 55
32 72
28 58
3 22
5 20
14 35
52 63
28 55
48 55
43 91
19 34
31 60
5 91
39 73
5 71
44 78
26 59
42 75
45 82
36 46
31 41
54 61
16 74
55 62
15 33
31 37
41 55
59 92
54 79
28 61
61 65
37 94
4 31
35 41
21 92
40 9...

output:

4324
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 6...

result:

ok 

Test #45:

score: 0
Accepted
time: 1ms
memory: 3968kb

input:

95 184
35 51
77 94
31 39
2 28
12 57
10 63
57 70
15 55
40 46
1 31
12 84
11 65
71 79
52 71
11 35
2 92
37 60
11 92
1 33
24 91
37 76
56 86
16 42
17 73
45 63
38 41
43 89
8 16
29 90
42 70
50 77
20 32
4 28
6 33
3 25
38 39
5 92
18 85
19 47
76 82
16 93
24 40
20 88
62 70
10 38
48 49
48 69
54 92
10 11
79 83
13...

output:

4281
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 32
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 64
1 65
1 66
1 6...

result:

ok 

Test #46:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

31 46
28 29
17 29
4 18
9 25
6 28
1 16
15 31
28 31
1 22
22 31
14 18
4 7
5 12
22 27
21 25
4 5
1 15
14 21
1 14
16 18
19 24
18 28
10 25
3 14
14 23
5 28
13 16
4 28
6 13
22 26
18 20
7 19
1 20
15 17
3 26
5 20
5 13
13 24
2 17
14 24
27 29
1 29
5 25
29 31
4 22
1 23

output:

419
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 17
1 18
1 19
1 21
1 24
1 25
1 26
1 27
1 28
1 30
1 31
2 3
2 4
2 5
2 6
2 7
2 8
2 9
2 10
2 11
2 12
2 13
2 14
2 15
2 16
2 18
2 19
2 20
2 21
2 22
2 23
2 24
2 25
2 26
2 27
2 28
2 29
2 30
2 31
3 4
3 5
3 6
3 7
3 8
3 9
3 10
3 11
3 12
3 13
3 15
3 16
3 ...

result:

ok 

Test #47:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

31 57
5 26
1 3
3 29
19 23
16 19
11 21
5 20
19 29
7 12
26 29
18 27
10 23
11 15
23 26
27 31
6 30
2 15
3 24
8 12
4 16
15 23
15 18
6 29
16 21
9 21
28 31
10 12
7 24
25 26
6 11
13 17
9 16
7 18
12 16
12 31
3 31
23 28
12 23
7 25
13 27
9 11
3 17
14 20
4 17
4 12
12 19
1 17
28 30
26 28
5 11
21 27
10 25
22 23
1...

output:

408
1 2
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
2 3
2 4
2 5
2 6
2 7
2 8
2 9
2 10
2 11
2 12
2 13
2 14
2 16
2 17
2 18
2 19
2 20
2 21
2 22
2 23
2 24
2 25
2 26
2 27
2 30
2 31
3 4
3 5
3 6
3 7
3 8
3 9
3 10
3 11
3 12
3...

result:

ok 

Test #48:

score: 0
Accepted
time: 0ms
memory: 3712kb

input:

32 47
14 25
13 20
14 21
2 24
6 7
24 26
12 32
19 31
9 29
6 22
1 3
4 16
12 31
7 10
4 18
2 31
8 17
18 29
14 30
3 22
18 30
12 23
12 18
14 31
25 32
15 21
21 28
6 23
2 22
16 29
25 26
2 14
16 23
10 21
23 31
14 18
28 31
10 28
10 17
2 13
7 21
3 12
15 20
1 31
5 16
20 28
15 23

output:

419
1 2
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 32
2 3
2 4
2 5
2 6
2 7
2 8
2 9
2 10
2 11
2 12
2 15
2 16
2 17
2 18
2 19
2 20
2 21
2 23
2 25
2 26
2 28
2 29
2 30
2 32
3 4
3 5
3 6
3 7
3 8
3 9
3 10
3 11
3 13
3 14
3 15
3...

result:

ok 

Test #49:

score: 0
Accepted
time: 0ms
memory: 3712kb

input:

32 60
26 29
17 28
4 21
6 9
3 4
22 25
9 31
5 17
12 15
5 31
3 14
1 22
6 32
15 19
19 26
6 26
30 31
2 13
15 23
14 26
18 24
13 21
26 32
4 24
10 20
4 27
21 22
7 18
11 23
25 28
16 26
15 17
11 29
11 30
15 29
6 20
5 18
13 25
17 22
24 27
20 32
1 7
11 31
14 28
2 29
6 23
8 21
10 18
8 32
5 13
11 19
20 23
9 14
16...

output:

420
1 3
1 4
1 5
1 6
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
2 3
2 4
2 5
2 6
2 7
2 9
2 10
2 11
2 12
2 14
2 15
2 16
2 17
2 18
2 19
2 20
2 21
2 22
2 23
2 24
2 25
2 26
2 27
2 28
2 30
2 31
2 32
3 6
3 7
3 8
3 9
3 10
3 11
3 12
3 ...

result:

ok 

Test #50:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

10 38
1 2
1 3
1 4
1 5
1 6
1 8
1 9
2 3
2 4
2 5
2 6
2 7
2 8
2 9
2 10
3 4
3 5
3 6
3 7
3 10
4 5
4 6
4 7
4 8
4 9
4 10
5 7
5 8
5 9
5 10
6 7
6 8
6 9
6 10
7 8
7 9
8 10
9 10

output:

-1

result:

ok 

Test #51:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

20 144
1 2
1 5
1 6
1 9
1 11
1 12
1 15
1 16
1 17
1 18
1 19
1 20
2 3
2 4
2 6
2 7
2 8
2 10
2 12
2 13
2 14
2 15
2 16
2 17
2 20
3 5
3 6
3 9
3 11
3 12
3 15
3 16
3 17
3 18
3 19
3 20
4 5
4 6
4 9
4 11
4 12
4 15
4 16
4 17
4 18
4 19
4 20
5 6
5 7
5 8
5 10
5 12
5 13
5 14
5 15
5 16
5 17
5 20
6 7
6 8
6 9
6 10
6 11...

output:

36
1 4
1 7
1 8
1 10
1 13
1 14
2 9
2 11
2 18
2 19
3 4
3 7
3 8
3 10
3 13
3 14
4 8
4 10
4 13
4 14
5 9
5 11
5 18
5 19
7 8
7 10
7 13
7 14
8 13
8 14
9 18
9 19
10 13
10 14
11 18
11 19

result:

ok 

Test #52:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

30 333
1 2
1 3
1 4
1 5
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
2 4
2 6
2 8
2 9
2 12
2 13
2 14
2 15
2 16
2 17
2 20
2 21
2 22
2 23
2 24
2 25
2 26
2 30
3 4
3 6
3 8
3 9
3 12
3 13
3 14
3 15
3 16
3 17
3 20
3 21
3 22
3 23
3 24
3 25
3 2...

output:

-1

result:

ok 

Test #53:

score: 0
Accepted
time: 1ms
memory: 3456kb

input:

40 567
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 11
1 13
1 14
1 16
1 17
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 30
1 31
1 32
1 34
1 35
1 36
1 38
1 39
2 3
2 4
2 6
2 10
2 11
2 12
2 14
2 15
2 17
2 18
2 19
2 22
2 24
2 25
2 26
2 28
2 29
2 30
2 31
2 33
2 34
2 37
2 40
3 5
3 7
3 8
3 9
3 10
3 11
3 12
3 13
3 14
3 1...

output:

-1

result:

ok 

Test #54:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

50 875
1 2
1 3
1 5
1 6
1 7
1 9
1 11
1 12
1 13
1 15
1 16
1 17
1 19
1 20
1 21
1 24
1 26
1 27
1 32
1 33
1 34
1 35
1 37
1 40
1 42
1 43
1 45
1 46
1 49
1 50
2 4
2 6
2 7
2 8
2 9
2 10
2 11
2 13
2 14
2 17
2 18
2 19
2 22
2 23
2 25
2 26
2 28
2 29
2 30
2 31
2 36
2 38
2 39
2 40
2 41
2 42
2 43
2 44
2 47
2 48
2 49...

output:

-1

result:

ok 

Test #55:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

3 0

output:

3
1 2
1 3
2 3

result:

ok 

Test #56:

score: 0
Accepted
time: 0ms
memory: 3712kb

input:

3 1
1 2

output:

2
1 3
2 3

result:

ok 

Test #57:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

3 3
1 2
2 3
1 3

output:

0

result:

ok 

Test #58:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

90 90
21 71
21 66
66 69
69 80
22 80
22 87
9 87
9 49
17 49
17 83
45 83
5 45
5 57
35 57
35 44
33 44
33 70
2 70
2 20
10 20
10 23
23 58
40 58
40 72
72 79
13 79
13 15
15 88
60 88
4 60
4 12
12 14
14 63
47 63
1 47
1 41
41 43
43 54
31 54
31 32
32 73
73 81
29 81
29 74
65 74
65 67
53 67
36 53
36 82
82 84
42 8...

output:

3855
1 2
1 3
1 4
1 5
1 6
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 42
1 43
1 44
1 45
1 46
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 63
1 64
1 ...

result:

ok 

Test #59:

score: 0
Accepted
time: 1ms
memory: 3968kb

input:

90 160
9 83
70 83
7 83
64 83
1 83
33 83
12 83
68 83
59 83
81 83
22 83
18 83
36 83
51 83
83 86
57 83
48 83
72 83
47 83
56 83
10 83
71 83
41 83
15 83
60 83
45 83
16 83
19 83
82 83
83 90
67 83
46 83
37 83
83 88
4 83
28 83
83 87
17 83
32 83
21 83
69 83
44 83
13 83
6 83
7 33
15 32
56 82
57 69
12 44
6 32
...

output:

3800
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 63
1 ...

result:

ok 

Test #60:

score: 0
Accepted
time: 1ms
memory: 3968kb

input:

91 91
4 8
8 66
66 71
58 71
58 61
50 61
28 50
11 28
11 23
23 82
40 82
10 40
10 89
2 89
2 69
57 69
13 57
13 81
26 81
25 26
14 25
14 59
37 59
7 37
3 7
3 22
22 78
15 78
15 62
18 62
16 18
16 65
48 65
32 48
32 33
33 60
60 84
84 90
1 90
1 5
5 20
20 73
19 73
19 80
70 80
12 70
12 83
39 83
21 39
21 29
29 64
2...

output:

4004
1 2
1 3
1 4
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 ...

result:

ok 

Test #61:

score: 0
Accepted
time: 1ms
memory: 3968kb

input:

91 162
57 79
47 57
57 60
57 71
9 57
18 57
57 76
13 57
12 57
57 82
34 57
57 58
19 57
11 57
57 80
46 57
57 85
37 57
57 59
57 81
57 87
50 57
36 57
57 69
10 57
48 57
57 89
26 57
57 90
57 62
57 65
56 57
54 57
57 83
45 57
55 57
42 57
57 64
15 57
8 57
57 70
21 57
32 57
52 57
9 58
15 80
26 37
45 70
58 82
36...

output:

3933
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 61
1 62
1 6...

result:

ok