QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#742189#9432. PermutationHuluoboAC ✓273ms1736kbC++171.3kb2024-11-13 16:03:072024-11-13 16:03:07

详细

Test #1:

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

input:

5
0
0
2
0
0

output:

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

result:

ok Accepted

Test #2:

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

input:

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

output:

0 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 205 20...

result:

ok Accepted

Test #3:

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

input:

1

output:

1 1 

result:

ok Accepted

Test #4:

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

input:

2
0

output:

0 1 2 
1 2 1 

result:

ok Accepted

Test #5:

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

input:

3
1
2
2

output:

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

result:

ok Accepted

Test #6:

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

input:

4
2
0
2
2

output:

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

result:

ok Accepted

Test #7:

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

input:

6
1
2
2
1
2
2
0
0

output:

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

result:

ok Accepted

Test #8:

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

input:

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

output:

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

result:

ok Accepted

Test #9:

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

input:

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

output:

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

result:

ok Accepted

Test #10:

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

input:

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

output:

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

result:

ok Accepted

Test #11:

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

input:

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

output:

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

result:

ok Accepted

Test #12:

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

input:

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

output:

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

result:

ok Accepted

Test #13:

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

input:

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

output:

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

result:

ok Accepted

Test #14:

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

input:

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

output:

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

result:

ok Accepted

Test #15:

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

input:

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

output:

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

result:

ok Accepted

Test #16:

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

input:

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

output:

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

result:

ok Accepted

Test #17:

score: 0
Accepted
time: 253ms
memory: 1712kb

input:

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

output:

0 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 167 16...

result:

ok Accepted

Test #18:

score: 0
Accepted
time: 250ms
memory: 1720kb

input:

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

output:

0 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 358 35...

result:

ok Accepted

Test #19:

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

input:

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

output:

0 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 631 63...

result:

ok Accepted

Test #20:

score: 0
Accepted
time: 253ms
memory: 1700kb

input:

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

output:

0 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 855 85...

result:

ok Accepted

Test #21:

score: 0
Accepted
time: 252ms
memory: 1720kb

input:

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

output:

0 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 954 95...

result:

ok Accepted

Test #22:

score: 0
Accepted
time: 247ms
memory: 1728kb

input:

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

output:

0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 25...

result:

ok Accepted

Test #23:

score: 0
Accepted
time: 258ms
memory: 1716kb

input:

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

output:

0 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 576 57...

result:

ok Accepted

Test #24:

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

input:

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

output:

0 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 587 58...

result:

ok Accepted

Test #25:

score: 0
Accepted
time: 259ms
memory: 1680kb

input:

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

output:

0 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 60...

result:

ok Accepted

Test #26:

score: 0
Accepted
time: 244ms
memory: 1736kb

input:

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

output:

0 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 244 24...

result:

ok Accepted

Test #27:

score: 0
Accepted
time: 269ms
memory: 1728kb

input:

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

output:

0 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 311 31...

result:

ok Accepted

Test #28:

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

input:

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

output:

0 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 892 89...

result:

ok Accepted

Test #29:

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

input:

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

output:

0 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 357 35...

result:

ok Accepted

Test #30:

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

input:

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

output:

0 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 593 59...

result:

ok Accepted

Test #31:

score: 0
Accepted
time: 254ms
memory: 1636kb

input:

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

output:

0 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 947 94...

result:

ok Accepted

Test #32:

score: 0
Accepted
time: 244ms
memory: 1636kb

input:

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

output:

0 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 11...

result:

ok Accepted

Test #33:

score: 0
Accepted
time: 263ms
memory: 1696kb

input:

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

output:

0 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 79...

result:

ok Accepted

Test #34:

score: 0
Accepted
time: 245ms
memory: 1688kb

input:

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

output:

0 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 10...

result:

ok Accepted

Test #35:

score: 0
Accepted
time: 234ms
memory: 1688kb

input:

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

output:

0 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 125 12...

result:

ok Accepted

Test #36:

score: 0
Accepted
time: 273ms
memory: 1668kb

input:

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

output:

0 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 4...

result:

ok Accepted

Test #37:

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

input:

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

output:

0 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 242 24...

result:

ok Accepted

Test #38:

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

input:

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

output:

0 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 798 79...

result:

ok Accepted

Test #39:

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

input:

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

output:

0 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 729 72...

result:

ok Accepted

Test #40:

score: 0
Accepted
time: 259ms
memory: 1688kb

input:

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

output:

0 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 318 31...

result:

ok Accepted

Test #41:

score: 0
Accepted
time: 258ms
memory: 1640kb

input:

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

output:

0 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 427 42...

result:

ok Accepted

Extra Test:

score: 0
Extra Test Passed