QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#626649#9432. PermutationRegister#AC ✓290ms3896kbC++201.3kb2024-10-10 11:20:502024-10-10 11:20:50

详细

Test #1:

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

input:

5
2
0
2
0
2
2
2

output:

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

result:

ok Accepted

Test #2:

score: 0
Accepted
time: 290ms
memory: 3708kb

input:

1000
1
1
2
1
1
0
0
1
0
2
2
1
1
0
0
2
2
1
0
2
1
2
2
1
1
2
0
1
0
1
1
1
1
0
1
0
0
1
0
2
1
0
1
2
1
1
0
2
2
1
0
1
1
0
2
1
0
2
1
2
2
1
1
1
2
1
1
1
1
0
0
1
1
2
0
0
1
0
1
2
1
1
0
0
1
2
1
1
2
1
1
1
1
0
1
1
1
1
1
2
2
1
1
1
2
0
2
2
1
1
1
1
0
1
1
1
0
0
2
1
0
1
1
2
1
1
2
2
2
1
0
1
0
1
1
1
1
0
2
0
0
1
1
0
0
1
1
1...

output:

0 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 337 33...

result:

ok Accepted

Test #3:

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

input:

1

output:

1 1

result:

ok Accepted

Test #4:

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

input:

2
0

output:

0 1 2
1 2 1

result:

ok Accepted

Test #5:

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

input:

3
0
2
0

output:

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

result:

ok Accepted

Test #6:

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

input:

4
0
0
0
0

output:

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

result:

ok Accepted

Test #7:

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

input:

6
2
1
0
1
0
2
0
2
2
0

output:

0 3 3 3 6 6 6
0 5 5 5 1 1 1
0 5 5 5 4 4 4
0 3 3 3 2 2 2
0 4 3 3 3 3 3
0 3 2 2 3 3 3
0 4 2 4 4 4 4
0 6 6 6 1 6 6
0 1 1 1 1 5 5
0 6 6 6 6 5 6
1 3 4 2 1 6 5

result:

ok Accepted

Test #8:

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

input:

7
2
0
1
0
2
2
2
0
0
2
2

output:

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

result:

ok Accepted

Test #9:

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

input:

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

output:

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

result:

ok Accepted

Test #10:

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

input:

9
1
1
1
0
1
1
2
1
0
1
2
2
0
1
0
2
0
2
2

output:

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

result:

ok Accepted

Test #11:

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

input:

10
2
1
0
1
0
1
1
1
2
1
2
0
1
0
2
1
1
0
1
0
2
2
0

output:

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

result:

ok Accepted

Test #12:

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

input:

11
2
2
1
2
1
1
0
2
2
2
2
2
2
0
2
0
0
0
2
2
0
2
0

output:

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

result:

ok Accepted

Test #13:

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

input:

12
1
1
2
1
0
1
1
0
1
0
0
0
0
2
0
1
0
2
2
0
0
2
2
2
2
2
0

output:

0 3 3 3 3 3 3 5 5 5 5 5 5
0 3 3 3 3 3 3 10 10 10 10 10 10
0 3 3 3 3 3 3 4 4 4 4 4 4
0 2 2 2 2 2 2 6 6 6 6 6 6
0 2 2 2 2 2 2 9 9 9 9 9 9
0 11 11 11 11 11 11 12 12 12 12 12 12
0 11 11 11 11 11 11 8 8 8 8 8 8
0 11 11 11 11 11 11 7 7 7 7 7 7
0 3 3 3 3 3 3 1 1 1 1 1 1
0 5 5 5 3 3 3 3 3 3 3 3 3
0 1 1 1 7 ...

result:

ok Accepted

Test #14:

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

input:

13
1
2
0
2
1
0
1
0
0
2
0
0
2
2
2
2
0
2
1
2
1
2
2
2
2
2
2
2
2

output:

0 9 9 9 9 9 9 13 13 13 13 13 13 13
0 9 9 9 9 9 9 12 12 12 12 12 12 12
0 4 4 4 4 4 4 1 1 1 1 1 1 1
0 10 10 10 10 10 10 6 6 6 6 6 6 6
0 2 2 2 2 2 2 11 11 11 11 11 11 11
0 2 2 2 2 2 2 7 7 7 7 7 7 7
0 8 8 8 8 8 8 3 3 3 3 3 3 3
0 8 8 8 8 8 8 5 5 5 5 5 5 5
0 5 5 5 13 13 13 13 13 13 13 13 13 13
0 10 10 10 ...

result:

ok Accepted

Test #15:

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

input:

14
1
2
0
0
0
1
2
1
2
0
0
0
2
2
2
2
2
2
2
2
1
0
2
2
0
2
0
2
0
2
2

output:

0 1 1 1 1 1 1 1 7 7 7 7 7 7 7
0 1 1 1 1 1 1 1 8 8 8 8 8 8 8
0 2 2 2 2 2 2 2 14 14 14 14 14 14 14
0 5 5 5 5 5 5 5 9 9 9 9 9 9 9
0 11 11 11 11 11 11 11 4 4 4 4 4 4 4
0 10 10 10 10 10 10 10 13 13 13 13 13 13 13
0 10 10 10 10 10 10 10 6 6 6 6 6 6 6
0 12 12 12 12 12 12 12 3 3 3 3 3 3 3
0 1 1 1 1 1 1 1 12...

result:

ok Accepted

Test #16:

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

input:

15
1
1
0
2
0
0
1
0
1
1
1
2
1
0
2
0
2
0
2
2
2
2
2
0
0
0
0
2
0
2
0
0
2
0

output:

0 2 2 2 2 2 2 2 14 14 14 14 14 14 14 14
0 2 2 2 2 2 2 2 5 5 5 5 5 5 5 5
0 2 2 2 2 2 2 2 4 4 4 4 4 4 4 4
0 13 13 13 13 13 13 13 3 3 3 3 3 3 3 3
0 11 11 11 11 11 11 11 1 1 1 1 1 1 1 1
0 8 8 8 8 8 8 8 15 15 15 15 15 15 15 15
0 6 6 6 6 6 6 6 12 12 12 12 12 12 12 12
0 6 6 6 6 6 6 6 9 9 9 9 9 9 9 9
0 10 1...

result:

ok Accepted

Test #17:

score: 0
Accepted
time: 260ms
memory: 3644kb

input:

975
1
1
0
1
2
1
1
2
0
2
0
1
0
1
1
2
2
1
1
1
1
2
1
1
1
1
0
1
1
0
1
0
2
1
0
1
2
1
1
0
1
1
1
0
1
1
0
0
1
0
0
2
2
1
0
2
2
1
1
0
0
0
0
0
1
2
2
0
0
1
2
0
2
0
0
1
1
0
1
1
2
0
1
1
1
0
1
1
0
2
1
2
2
2
1
0
0
2
2
1
0
1
1
1
1
2
1
1
1
1
1
1
1
0
2
2
0
1
0
2
1
1
1
1
1
0
1
2
2
2
2
1
1
1
2
0
1
1
0
0
0
1
2
1
0
1
2
2
...

output:

0 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 33...

result:

ok Accepted

Test #18:

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

input:

976
1
2
1
0
2
1
1
2
1
1
2
2
0
0
1
2
0
1
1
0
0
1
1
0
0
2
2
1
0
2
1
2
1
2
2
1
1
1
2
1
1
1
1
1
1
1
2
2
0
1
0
1
1
2
1
0
2
2
2
1
1
0
1
0
2
1
1
2
1
2
0
1
2
1
2
0
1
1
1
0
2
0
1
2
0
1
2
0
2
2
0
2
2
0
1
2
1
0
1
0
1
1
1
1
0
1
2
1
1
0
1
0
2
1
1
1
1
2
1
1
1
2
1
2
0
2
1
2
0
1
0
1
2
1
0
2
1
0
1
1
1
0
1
2
2
1
1
2
...

output:

0 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 956 95...

result:

ok Accepted

Test #19:

score: 0
Accepted
time: 268ms
memory: 3644kb

input:

977
2
0
1
1
1
1
1
2
1
1
0
1
1
1
1
1
2
2
0
0
1
1
1
1
2
0
2
0
1
1
1
1
0
1
2
0
1
1
1
1
2
2
1
1
2
1
1
1
1
2
2
1
1
0
0
0
0
1
2
1
1
0
2
1
0
1
0
1
1
1
0
2
1
0
2
2
1
0
0
0
1
0
0
1
1
0
0
0
2
1
1
2
2
1
2
0
1
1
2
1
1
1
1
1
2
2
1
2
2
1
1
0
1
1
1
1
1
1
2
1
2
1
2
2
1
2
1
1
2
1
2
0
1
0
0
1
2
2
1
0
2
2
0
1
1
1
0
1
...

output:

0 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 539 53...

result:

ok Accepted

Test #20:

score: 0
Accepted
time: 256ms
memory: 3892kb

input:

978
0
2
0
0
0
1
1
1
0
1
1
0
0
2
0
0
2
1
0
1
1
1
0
2
0
0
1
2
0
1
0
1
2
2
1
2
0
1
2
1
1
1
2
2
1
0
1
1
0
2
0
0
2
2
1
2
0
0
0
0
0
1
2
0
0
1
1
2
2
1
2
1
1
1
1
0
0
2
0
0
2
1
1
0
1
1
2
0
1
1
2
1
1
2
2
1
2
1
2
0
0
1
1
1
1
2
1
0
2
0
1
2
1
1
0
1
1
2
1
1
1
1
1
1
1
1
1
0
1
1
1
1
2
2
2
0
0
1
1
1
1
0
1
0
1
0
1
2
...

output:

0 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 561 56...

result:

ok Accepted

Test #21:

score: 0
Accepted
time: 272ms
memory: 3588kb

input:

979
1
1
1
2
2
1
1
0
2
1
0
1
2
1
0
1
1
1
2
1
1
1
2
2
0
1
0
0
0
0
1
0
0
2
2
2
2
2
2
2
2
1
1
2
2
0
2
1
1
0
1
0
1
1
0
0
1
1
1
1
1
0
1
2
0
0
1
0
1
1
1
0
2
2
1
1
0
1
2
1
1
0
1
2
1
1
1
2
1
1
2
2
2
1
0
1
1
1
1
1
1
1
1
2
1
2
1
0
0
0
1
1
0
2
1
2
1
1
2
0
0
0
1
1
1
1
2
0
1
0
2
1
0
1
1
2
1
2
1
0
2
2
1
2
2
1
1
1
...

output:

0 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 88...

result:

ok Accepted

Test #22:

score: 0
Accepted
time: 272ms
memory: 3648kb

input:

980
2
0
1
1
1
1
1
1
1
1
1
0
1
1
0
1
1
2
1
1
1
0
1
1
2
1
2
1
1
0
1
1
0
1
1
2
1
1
0
0
0
1
1
2
2
1
0
1
2
1
1
0
0
0
2
1
0
2
0
2
2
0
1
2
0
1
1
1
2
1
1
2
1
1
1
2
1
0
1
0
0
1
0
0
1
2
1
2
2
0
0
2
1
1
0
2
2
0
2
1
1
1
2
2
0
1
0
2
1
2
0
1
2
0
2
0
1
1
1
1
1
1
1
1
0
1
2
0
1
1
2
2
2
1
0
1
1
2
2
1
1
0
2
1
2
1
0
1
...

output:

0 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 963 96...

result:

ok Accepted

Test #23:

score: 0
Accepted
time: 272ms
memory: 3708kb

input:

981
1
1
1
2
1
1
1
1
1
1
1
1
2
1
0
1
1
1
1
1
1
2
2
1
1
1
1
2
1
0
0
0
2
1
1
2
2
1
0
1
1
1
1
2
1
2
2
1
1
1
1
0
1
0
1
1
1
0
1
0
1
1
0
2
1
0
1
2
2
0
1
0
1
1
1
1
1
1
2
0
2
1
0
1
1
0
0
1
1
1
1
0
1
0
1
1
1
2
0
0
0
2
0
0
1
1
1
1
2
1
1
0
1
1
2
2
0
1
1
2
1
1
1
1
0
2
1
2
0
0
1
2
2
1
1
2
1
1
1
1
0
0
1
1
1
2
1
0
...

output:

0 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 722 72...

result:

ok Accepted

Test #24:

score: 0
Accepted
time: 274ms
memory: 3608kb

input:

982
1
2
2
2
1
2
0
1
1
0
2
0
0
2
1
0
1
1
0
1
2
2
2
2
0
1
1
2
2
1
1
1
1
0
0
1
1
1
0
2
1
1
1
2
2
0
0
1
1
0
1
2
1
2
2
1
1
1
0
1
0
1
2
1
0
0
1
0
0
1
1
1
1
2
2
1
1
1
2
1
1
1
1
1
0
0
1
2
1
0
1
1
0
0
1
2
0
0
1
1
0
2
1
0
1
0
2
1
1
1
1
1
2
1
1
1
0
2
1
1
1
0
0
0
0
1
0
1
2
0
0
2
2
1
2
2
1
2
2
0
2
0
0
1
2
1
0
1
...

output:

0 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 787 78...

result:

ok Accepted

Test #25:

score: 0
Accepted
time: 285ms
memory: 3648kb

input:

983
1
0
0
2
2
1
1
2
1
1
1
0
2
1
1
0
0
0
2
2
0
1
0
1
2
1
2
0
1
2
1
1
0
1
2
1
0
0
2
1
2
0
1
1
1
1
2
2
1
1
1
1
1
0
1
0
1
2
2
1
2
2
0
1
1
1
1
1
1
1
1
2
1
1
0
1
2
1
0
0
0
1
1
0
1
1
1
0
0
1
1
1
2
2
1
1
2
0
1
1
1
1
1
1
1
0
2
1
1
1
1
1
0
1
0
1
1
2
1
2
0
2
1
2
2
1
1
2
2
1
1
1
0
0
2
1
1
2
1
1
1
2
0
2
0
2
2
2
...

output:

0 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 872 87...

result:

ok Accepted

Test #26:

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

input:

984
0
1
0
1
0
1
1
1
1
1
0
0
2
1
0
1
2
1
1
0
1
2
1
1
2
1
2
1
1
1
2
1
1
0
2
2
0
2
1
1
1
2
1
2
0
1
1
2
1
0
1
2
1
1
2
0
1
2
2
0
1
0
1
1
1
1
2
1
0
2
1
2
0
2
0
1
1
0
1
1
2
1
1
0
1
1
0
0
2
1
1
2
2
1
0
0
1
0
0
0
0
0
1
1
1
2
2
1
2
1
0
0
2
2
0
1
2
1
2
1
0
1
1
0
1
1
2
1
1
1
1
1
1
0
1
1
1
1
0
1
0
1
0
2
1
1
1
1
...

output:

0 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 476 47...

result:

ok Accepted

Test #27:

score: 0
Accepted
time: 266ms
memory: 3820kb

input:

985
2
1
1
0
0
1
2
1
1
2
1
0
1
1
1
0
0
0
1
2
1
1
0
1
2
1
0
0
1
0
0
2
0
2
1
1
0
0
2
1
1
1
2
2
1
0
1
1
0
1
1
2
0
1
2
0
1
1
2
1
0
1
1
1
0
2
0
1
1
1
1
0
0
1
2
1
0
0
1
2
1
0
1
0
2
2
1
1
1
2
1
0
0
0
2
2
1
0
1
1
2
1
1
1
1
1
0
2
0
1
1
2
1
0
0
0
1
1
0
2
1
0
1
1
1
1
1
1
2
1
1
2
1
0
2
1
1
1
1
2
1
1
0
0
1
2
0
0
...

output:

0 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 773 77...

result:

ok Accepted

Test #28:

score: 0
Accepted
time: 267ms
memory: 3588kb

input:

986
1
1
2
1
1
0
0
0
1
1
0
0
1
0
2
1
0
1
0
1
1
0
1
1
1
1
0
1
1
1
1
1
0
0
2
1
2
1
0
2
2
1
1
1
2
0
1
2
0
1
1
2
0
1
1
1
0
1
1
1
2
0
1
1
2
0
2
2
1
1
0
2
2
0
0
2
1
2
0
1
1
1
1
0
1
2
2
1
1
0
1
1
1
1
0
1
0
1
1
1
0
1
1
1
0
0
1
2
2
2
2
1
1
0
1
1
2
2
1
1
1
0
0
1
0
0
1
2
2
0
1
1
0
1
0
1
2
2
0
2
2
2
0
1
0
2
0
0
...

output:

0 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 626 62...

result:

ok Accepted

Test #29:

score: 0
Accepted
time: 272ms
memory: 3648kb

input:

987
2
0
2
1
0
2
2
1
1
1
2
0
0
1
1
0
1
0
2
1
1
0
0
2
1
1
1
1
1
0
1
1
1
1
0
2
2
0
1
1
1
1
1
0
1
2
1
2
1
0
1
1
1
1
1
1
1
1
0
1
0
2
2
2
1
0
0
2
1
0
1
0
1
2
1
0
1
1
2
1
1
0
0
1
1
2
1
1
1
2
1
1
2
0
1
1
1
0
2
2
1
0
0
2
1
2
2
1
2
2
1
0
1
2
1
2
1
0
1
1
1
1
2
1
0
2
1
2
1
0
1
2
0
0
1
1
1
0
1
1
2
0
1
1
1
1
1
1
...

output:

0 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 24...

result:

ok Accepted

Test #30:

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

input:

988
1
2
1
1
2
1
1
1
2
1
0
1
0
0
1
1
1
1
1
1
0
2
1
2
0
1
1
0
1
0
1
2
1
2
1
0
0
1
0
1
1
0
2
2
0
0
1
1
1
1
1
2
0
0
1
2
1
1
1
2
1
0
1
1
1
2
1
2
2
2
1
1
2
2
1
0
0
0
1
2
2
1
0
1
1
1
2
2
0
0
1
1
1
1
0
1
1
2
1
2
1
1
1
0
0
0
0
0
0
1
0
1
0
2
2
0
0
1
2
2
0
1
1
1
1
2
1
2
2
0
0
2
0
1
1
1
1
1
2
2
1
1
1
0
2
2
2
2
...

output:

0 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 852 85...

result:

ok Accepted

Test #31:

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

input:

989
1
1
0
1
0
1
0
0
1
2
2
2
2
2
1
1
1
1
0
2
1
1
0
1
0
0
1
1
1
1
0
0
1
1
0
2
1
1
1
1
2
0
2
0
1
2
0
2
0
0
1
1
2
0
0
2
1
1
1
0
0
0
1
1
1
1
0
1
2
1
1
1
2
1
2
0
1
1
1
0
2
0
1
2
1
2
1
2
0
0
1
2
1
1
1
1
0
0
2
0
1
2
0
2
1
1
1
2
2
1
1
1
0
1
1
2
1
2
1
1
2
2
2
1
2
1
1
2
1
0
0
1
2
0
1
2
1
1
2
1
1
2
1
2
0
1
2
0
...

output:

0 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 701 70...

result:

ok Accepted

Test #32:

score: 0
Accepted
time: 257ms
memory: 3624kb

input:

990
2
1
1
0
2
1
2
1
2
1
2
2
1
1
2
1
0
1
1
1
0
2
0
1
1
1
2
1
2
1
1
1
1
2
0
0
1
0
0
0
0
0
1
1
1
2
1
2
1
0
2
0
2
1
2
2
2
1
0
1
2
0
0
2
0
0
0
2
1
0
1
0
2
0
2
0
0
0
2
1
2
0
2
1
0
1
2
1
0
1
2
2
0
2
2
1
0
0
1
1
1
0
0
1
1
0
2
1
1
0
0
1
1
2
1
0
0
1
2
0
0
1
0
0
0
0
1
0
1
1
0
1
1
0
0
1
1
2
2
0
1
1
2
1
1
1
1
0
...

output:

0 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 283 28...

result:

ok Accepted

Test #33:

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

input:

991
0
1
1
1
2
2
1
2
1
1
1
2
1
0
1
1
2
1
0
1
0
1
0
1
1
1
1
2
1
1
1
1
1
1
1
0
2
1
1
0
2
1
2
0
0
0
1
1
1
1
1
1
1
2
1
1
2
1
0
1
0
0
2
1
1
2
0
1
1
0
1
2
1
0
1
0
1
0
0
0
0
1
0
2
2
1
1
1
1
2
0
1
0
0
1
0
1
1
0
1
2
0
1
1
0
2
2
2
1
0
0
1
1
1
1
1
2
1
2
1
2
0
0
1
1
1
1
1
0
1
0
1
2
0
0
2
2
1
0
2
2
0
2
0
1
2
1
1
...

output:

0 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 435 43...

result:

ok Accepted

Test #34:

score: 0
Accepted
time: 272ms
memory: 3896kb

input:

992
1
1
0
0
0
1
2
1
1
1
1
1
1
1
1
2
2
1
2
0
2
1
0
1
2
0
0
1
1
1
0
1
2
1
1
1
2
0
1
1
0
0
0
0
1
1
1
0
0
1
1
1
1
1
1
1
2
2
2
2
2
0
1
2
2
1
1
2
0
0
2
2
2
1
1
1
0
1
1
1
0
1
1
0
1
2
1
1
2
0
1
0
1
0
2
1
1
0
0
1
1
2
1
2
2
1
2
2
2
2
1
0
1
0
2
2
1
1
2
2
0
2
0
1
2
0
2
0
2
1
2
2
1
1
1
0
0
1
0
2
1
2
1
1
1
1
0
0
...

output:

0 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 415 41...

result:

ok Accepted

Test #35:

score: 0
Accepted
time: 277ms
memory: 3612kb

input:

993
1
1
0
1
1
2
0
0
0
1
2
0
1
1
1
0
2
0
1
2
0
1
1
1
1
1
1
1
0
1
1
0
1
0
0
0
2
1
1
2
0
2
1
2
0
0
1
2
1
0
1
0
1
1
2
1
1
1
2
2
1
0
1
1
0
1
2
1
0
0
1
2
1
1
0
2
2
2
0
1
1
2
2
1
1
1
1
2
1
1
1
2
1
1
2
0
2
0
0
2
1
1
1
2
1
1
1
1
0
1
1
2
1
1
1
2
1
2
1
1
2
2
1
1
1
1
1
1
1
1
1
2
1
2
1
2
1
2
2
1
0
1
0
2
0
2
1
0
...

output:

0 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 18...

result:

ok Accepted

Test #36:

score: 0
Accepted
time: 282ms
memory: 3604kb

input:

994
1
2
0
1
2
0
1
0
1
1
2
2
0
1
0
1
0
1
1
1
0
0
0
1
2
1
0
1
2
2
1
1
2
1
0
0
1
2
0
0
1
1
1
0
2
1
2
2
2
1
0
0
1
0
1
2
2
0
2
1
2
0
1
2
2
1
1
1
1
2
1
1
2
1
1
1
1
1
0
2
0
2
2
0
1
0
2
1
2
1
1
2
1
0
0
0
1
1
2
1
1
0
0
0
1
1
2
0
2
1
1
1
2
1
2
1
2
1
1
1
0
0
1
1
1
1
1
2
0
2
0
1
1
1
0
1
1
1
1
1
0
2
1
1
1
2
1
2
...

output:

0 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 264 26...

result:

ok Accepted

Test #37:

score: 0
Accepted
time: 271ms
memory: 3628kb

input:

995
0
1
0
0
1
1
0
1
1
1
1
1
2
1
0
0
1
0
2
1
1
1
2
0
2
0
2
0
1
1
1
0
0
0
1
0
2
2
1
0
1
0
1
2
1
0
2
0
1
1
1
0
2
1
0
1
1
1
0
2
1
1
2
0
0
2
1
2
0
2
2
0
2
1
2
1
1
0
0
2
1
1
2
0
1
1
0
1
1
0
2
1
1
2
2
1
1
2
0
2
1
0
1
1
2
0
1
1
1
2
1
1
0
1
1
0
0
1
1
0
0
2
1
1
1
0
2
1
2
1
1
1
0
1
2
1
0
2
0
1
1
1
0
0
2
2
1
1
...

output:

0 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 673 67...

result:

ok Accepted

Test #38:

score: 0
Accepted
time: 282ms
memory: 3648kb

input:

996
1
0
1
1
0
0
2
2
2
1
1
1
0
0
0
1
1
1
0
0
1
2
0
0
2
0
1
2
1
2
1
1
0
0
0
0
2
2
1
1
0
0
1
0
1
1
2
1
2
1
1
1
1
2
2
2
0
2
1
2
1
2
0
2
1
1
0
0
1
1
1
1
0
1
2
2
1
2
1
1
2
1
1
2
0
1
2
1
2
1
2
1
0
0
1
1
1
0
1
1
0
1
2
2
2
2
0
1
1
1
1
0
1
1
0
2
0
0
1
0
0
0
1
0
0
1
2
1
2
1
2
0
2
0
2
1
1
2
1
1
2
1
2
1
1
0
1
1
...

output:

0 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ...

result:

ok Accepted

Test #39:

score: 0
Accepted
time: 286ms
memory: 3640kb

input:

997
1
1
1
2
0
1
1
2
1
2
1
1
1
1
1
2
2
1
0
1
1
0
2
1
2
2
2
1
1
1
1
2
1
1
0
2
2
1
0
0
1
1
1
1
1
0
1
0
0
2
2
1
0
1
1
1
1
2
0
1
0
0
2
2
2
1
0
1
2
0
1
2
0
2
1
2
0
2
1
1
1
2
1
2
2
2
0
0
1
2
2
0
2
2
1
0
1
1
0
0
0
1
1
2
2
1
1
2
0
2
0
1
0
0
1
2
1
1
1
2
2
1
1
0
1
0
2
1
1
2
2
1
1
2
1
1
1
1
0
1
1
2
0
2
0
1
0
0
...

output:

0 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 437 43...

result:

ok Accepted

Test #40:

score: 0
Accepted
time: 256ms
memory: 3580kb

input:

998
1
1
1
1
1
0
0
1
2
1
0
0
2
2
0
1
1
0
1
1
0
0
2
1
1
1
1
0
0
0
1
1
0
2
1
1
1
1
1
1
1
1
0
2
0
0
2
2
2
1
0
0
2
1
2
0
1
2
2
2
1
1
0
0
1
0
0
1
2
0
2
1
0
1
1
1
1
1
2
1
1
2
0
2
2
1
0
1
1
1
2
1
2
1
1
0
0
2
2
0
1
2
1
2
1
2
2
2
1
2
1
1
0
1
2
1
2
1
2
0
1
0
1
1
2
1
1
2
2
1
2
0
1
0
2
1
2
2
1
1
1
1
1
1
2
0
2
1
...

output:

0 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 87...

result:

ok Accepted

Test #41:

score: 0
Accepted
time: 274ms
memory: 3652kb

input:

999
0
0
2
1
1
0
1
1
1
0
2
0
2
1
2
1
0
0
1
2
2
2
1
1
0
0
2
1
1
1
1
0
1
1
1
1
1
2
1
0
0
2
1
0
2
0
1
0
0
2
1
0
2
2
1
2
1
1
0
1
0
2
1
0
1
1
1
0
0
0
2
1
1
1
0
1
1
1
0
2
2
1
0
0
1
1
2
0
1
2
0
1
1
0
0
1
0
0
0
0
1
0
1
2
1
0
2
2
1
0
1
2
1
1
2
1
0
1
1
1
1
0
1
1
1
2
1
1
0
1
1
0
1
1
1
1
1
1
2
1
0
1
1
0
2
1
2
1
...

output:

0 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 930 93...

result:

ok Accepted

Extra Test:

score: 0
Extra Test Passed