QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#45873#4565. Rarest InsectsGuanYunchang10 109ms3860kbC++172.2kb2022-08-24 15:57:512022-08-24 15:58:39

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 3ms
memory: 3836kb

input:

6
1
1
1
2
2
2
2
2
3

output:

8
0 0
8
0 1
8
0 2
8
0 3
8
0 4
8
0 5
8
1 0
8
1 1
8
1 2
8
1 3
8
1 4
8
1 5
8
0 0
8
2
8
0 1
8
2
8
0 2
8
2
8
0 3
8
2
8
1 3
8
0 4
8
2
8
1 4
8
0 5
8
2
8
1 5
8
0 3
8
2
8
0 4
8
2
8
0 5
8
2
8
1 5
8
3 1

result:

ok 

Test #2:

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

input:

2
1
2
2

output:

8
0 0
8
0 1
8
1 0
8
1 1
8
0 0
8
2
8
0 1
8
2
8
1 1
8
0 1
8
2
8
3 2

result:

ok 

Test #3:

score: 0
Accepted
time: 3ms
memory: 3748kb

input:

2
1
1

output:

8
0 0
8
0 1
8
1 0
8
1 1
8
0 0
8
2
8
0 1
8
2
8
3 1

result:

ok 

Test #4:

score: 0
Accepted
time: 3ms
memory: 3860kb

input:

3
1
1
2

output:

8
0 0
8
0 1
8
0 2
8
1 0
8
1 1
8
1 2
8
0 0
8
2
8
0 1
8
2
8
0 2
8
2
8
1 2
8
3 1

result:

ok 

Test #5:

score: 0
Accepted
time: 3ms
memory: 3696kb

input:

5
1
1
2
2
2
2
2
3
3

output:

8
0 0
8
0 1
8
0 2
8
0 3
8
0 4
8
1 0
8
1 1
8
1 2
8
1 3
8
1 4
8
0 0
8
2
8
0 1
8
2
8
0 2
8
2
8
1 2
8
0 3
8
2
8
1 3
8
0 4
8
2
8
1 4
8
0 2
8
2
8
0 3
8
2
8
0 4
8
2
8
1 4
8
0 4
8
2
8
3 2

result:

ok 

Test #6:

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

input:

8
1
1
2
2
2
2
2
1
2
3
3
3
2

output:

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

result:

ok 

Test #7:

score: 0
Accepted
time: 109ms
memory: 3704kb

input:

199
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

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

result:

ok 

Test #8:

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

input:

200
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

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

result:

ok 

Test #9:

score: 0
Accepted
time: 36ms
memory: 3692kb

input:

200
1
1
1
2
1
2
1
2
2
2
1
1
1
1
1
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
1
1
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

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

result:

ok 

Test #10:

score: 0
Accepted
time: 16ms
memory: 3696kb

input:

198
1
1
1
1
1
1
2
1
2
2
2
2
1
2
1
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
1
2
2
2
1
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

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

result:

ok 

Test #11:

score: 0
Accepted
time: 11ms
memory: 3824kb

input:

199
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

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

result:

ok 

Test #12:

score: 0
Accepted
time: 18ms
memory: 3756kb

input:

197
1
1
1
2
1
2
1
1
1
2
1
2
2
1
2
2
2
2
1
1
2
1
1
1
1
1
2
2
1
2
1
1
2
1
2
1
1
2
2
1
1
2
2
1
2
1
1
1
2
2
2
1
1
2
2
2
1
1
2
2
2
2
2
1
1
2
1
2
2
2
1
1
2
2
1
1
2
1
2
1
1
2
1
2
2
1
1
2
1
2
1
2
2
1
1
1
1
2
1
2
2
1
2
1
1
1
1
1
1
1
2
2
2
2
2
2
1
1
1
2
2
1
2
1
2
1
2
1
1
2
2
2
1
1
1
2
2
2
2
2
1
1
2
2
2
2
1
2
...

output:

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

result:

ok 

Test #13:

score: 0
Accepted
time: 6ms
memory: 3844kb

input:

197
1
1
1
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

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

result:

ok 

Test #14:

score: 0
Accepted
time: 16ms
memory: 3752kb

input:

198
1
1
1
1
1
1
2
2
2
1
2
2
2
2
2
1
1
2
2
1
2
2
2
2
1
2
1
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
...

output:

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

result:

ok 

Test #15:

score: 0
Accepted
time: 32ms
memory: 3732kb

input:

200
1
1
2
1
1
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

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

result:

ok 

Test #16:

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

input:

196
1
1
1
1
1
2
1
2
2
2
2
1
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

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

result:

ok 

Test #17:

score: 0
Accepted
time: 9ms
memory: 3844kb

input:

199
1
1
1
1
2
1
2
2
2
2
1
2
1
2
2
2
2
1
1
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

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

result:

ok 

Test #18:

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

input:

196
1
1
2
1
1
2
2
1
2
2
1
1
2
1
2
2
2
2
2
2
1
1
1
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

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

result:

ok 

Test #19:

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

input:

196
1
1
2
1
1
2
1
1
1
1
1
1
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

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

result:

ok 

Test #20:

score: 0
Accepted
time: 16ms
memory: 3692kb

input:

196
1
1
1
2
1
1
1
1
1
2
2
1
2
2
1
1
2
2
2
2
2
1
2
2
2
2
2
2
1
1
1
2
2
2
2
2
1
2
2
2
2
2
1
2
1
1
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

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

result:

ok 

Test #21:

score: 0
Accepted
time: 3ms
memory: 3756kb

input:

200
1
1
1
1
2
1
1
2
1
1
1
1
2
2
1
1
1
2
1
1
1
1
2
2
1
2
2
1
1
2
2
1
2
1
1
2
2
1
1
1
2
2
1
1
1
2
1
1
2
1
1
2
2
2
1
1
1
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
1
2
2
2
1
2
2
2
2
2
2
1
2
1
2
2
2
2
2
2
2
2
1
2
2
1
1
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

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

result:

ok 

Test #22:

score: 0
Accepted
time: 13ms
memory: 3832kb

input:

199
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
2
1
1
2
1
2
1
1
2
1
1
1
1
2
1
1
2
1
2
1
1
2
1
1
2
2
2
2
2
2
2
1
2
2
1
2
2
2
2
2
1
1
2
2
2
2
1
1
2
2
2
2
2
2
1
2
2
2
2
2
2
1
1
1
2
1
1
2
2
2
1
2
2
2
2
2
1
2
2
2
1
2
1
2
2
2
2
2
1
2
2
2
1
2
2
2
2
2
2
2
1
2
1
2
1
2
2
...

output:

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

result:

ok 

Test #23:

score: 0
Accepted
time: 13ms
memory: 3832kb

input:

198
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
2
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
2
2
1
1
1
2
1
1
2
1
1
2
1
2
1
1
1
2
1
1
1
2
2
1
1
2
1
1
2
1
1
1
1
1
1
1
2
1
1
1
1
1
2
1
1
2
1
2
2
2
2
2
1
1
2
2
2
1
2
1
1
2
2
2
2
1
1
1
1
1
1
1
1
1
1
2
1
1
2
2
2
1
2
2
1
1
1
1
1
1
2
1
2
1
...

output:

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

result:

ok 

Subtask #2:

score: 0
Wrong Answer

Test #24:

score: 0
Wrong Answer
time: 8ms
memory: 3844kb

input:

1000
1000
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
99...

output:

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

result:

wrong answer Wrong answer.

Subtask #3:

score: 0
Wrong Answer

Test #43:

score: 75
Accepted
time: 3ms
memory: 3752kb

input:

2
1
2
2

output:

8
0 0
8
0 1
8
1 0
8
1 1
8
0 0
8
2
8
0 1
8
2
8
1 1
8
0 1
8
2
8
3 2

result:

ok 

Test #44:

score: 75
Accepted
time: 3ms
memory: 3840kb

input:

2
1
1

output:

8
0 0
8
0 1
8
1 0
8
1 1
8
0 0
8
2
8
0 1
8
2
8
3 1

result:

ok 

Test #45:

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

input:

3
1
1
2

output:

8
0 0
8
0 1
8
0 2
8
1 0
8
1 1
8
1 2
8
0 0
8
2
8
0 1
8
2
8
0 2
8
2
8
1 2
8
3 1

result:

ok 

Test #46:

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

input:

6
1
2
1
2
2
2
2
3
3
3

output:

8
0 0
8
0 1
8
0 2
8
0 3
8
0 4
8
0 5
8
1 0
8
1 1
8
1 2
8
1 3
8
1 4
8
1 5
8
0 0
8
2
8
0 1
8
2
8
1 1
8
0 2
8
2
8
0 3
8
2
8
1 3
8
0 4
8
2
8
1 4
8
0 5
8
2
8
1 5
8
0 1
8
2
8
0 3
8
2
8
1 3
8
0 4
8
2
8
1 4
8
0 5
8
2
8
1 5
8
3 1

result:

ok 

Test #47:

score: 70.33
Acceptable Answer
time: 0ms
memory: 3848kb

input:

10
1
1
2
2
2
2
2
2
2
2
2
3
2
3
3
3
3
3
3
3
4
4
4
4
4
4
5
5
5
6

output:

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

result:

points 0.93773333330 points  0.93773333330

Test #48:

score: 0
Wrong Answer
time: 0ms
memory: 3732kb

input:

2000
2000
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
...

output:

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

result:

wrong answer Wrong answer.