QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#45964#4565. Rarest InsectsZhaoZiLong0 107ms4016kbC++171.4kb2022-08-24 18:57:072022-08-24 18:57:09

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

6
1
2
1
2
1
2
1
1
1
2
2
2

output:

8
0 5
8
2
8
0 4
8
2
8
1 4
8
0 3
8
2
8
0 2
8
2
8
1 2
8
0 1
8
2
8
0 0
8
2
8
1 0
8
1 1
8
1 3
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
3 1

result:

ok 

Test #2:

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

input:

2
1
2
1
2
2

output:

8
0 1
8
2
8
0 0
8
2
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: 3856kb

input:

2
1
1
1
1

output:

8
0 1
8
2
8
0 0
8
2
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: 2ms
memory: 3872kb

input:

3
1
2
1
1
1
2

output:

8
0 2
8
2
8
0 1
8
2
8
1 1
8
0 0
8
2
8
1 0
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: 3768kb

input:

5
1
2
1
2
2
1
1
2
2
2
2
2
3

output:

8
0 4
8
2
8
0 3
8
2
8
1 3
8
0 2
8
2
8
0 1
8
2
8
1 1
8
0 0
8
2
8
1 0
8
1 2
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
3 2

result:

ok 

Test #6:

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

input:

8
1
1
1
2
2
2
2
2
1
1
2
2
2
2
2
1

output:

8
0 7
8
2
8
0 6
8
2
8
0 5
8
2
8
0 4
8
2
8
1 4
8
0 3
8
2
8
1 3
8
0 2
8
2
8
1 2
8
0 1
8
2
8
1 1
8
0 0
8
2
8
1 0
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
3 1

result:

ok 

Test #7:

score: 0
Accepted
time: 7ms
memory: 3872kb

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 198
8
2
8
0 197
8
2
8
1 197
8
0 196
8
2
8
1 196
8
0 195
8
2
8
1 195
8
0 194
8
2
8
1 194
8
0 193
8
2
8
1 193
8
0 192
8
2
8
1 192
8
0 191
8
2
8
1 191
8
0 190
8
2
8
1 190
8
0 189
8
2
8
1 189
8
0 188
8
2
8
1 188
8
0 187
8
2
8
1 187
8
0 186
8
2
8
1 186
8
0 185
8
2
8
1 185
8
0 184
8
2
8
1 184
8
0 183
...

result:

ok 

Test #8:

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

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 199
8
2
8
0 198
8
2
8
0 197
8
2
8
0 196
8
2
8
0 195
8
2
8
0 194
8
2
8
0 193
8
2
8
0 192
8
2
8
0 191
8
2
8
0 190
8
2
8
0 189
8
2
8
0 188
8
2
8
0 187
8
2
8
0 186
8
2
8
0 185
8
2
8
0 184
8
2
8
0 183
8
2
8
0 182
8
2
8
0 181
8
2
8
0 180
8
2
8
0 179
8
2
8
0 178
8
2
8
0 177
8
2
8
0 176
8
2
8
0 175
8
2
...

result:

ok 

Test #9:

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

input:

200
1
1
1
1
1
1
1
1
1
1
2
2
2
2
1
2
2
1
1
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
...

output:

8
0 199
8
2
8
0 198
8
2
8
0 197
8
2
8
0 196
8
2
8
0 195
8
2
8
0 194
8
2
8
0 193
8
2
8
0 192
8
2
8
0 191
8
2
8
0 190
8
2
8
0 189
8
2
8
1 189
8
0 188
8
2
8
1 188
8
0 187
8
2
8
1 187
8
0 186
8
2
8
1 186
8
0 185
8
2
8
0 184
8
2
8
1 184
8
0 183
8
2
8
1 183
8
0 182
8
2
8
0 181
8
2
8
0 180
8
2
8
1 180
8
0 ...

result:

ok 

Test #10:

score: -10
Wrong Answer
time: 1ms
memory: 3852kb

input:

198
1
1
1
1
2
1
1
2
1
2
2
2
1
2
2
2
2
2
1
2
2
1
1
2
2
2
2
2
1
2
2
2
2
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
2
...

output:

8
0 197
8
2
8
0 196
8
2
8
0 195
8
2
8
0 194
8
2
8
0 193
8
2
8
1 193
8
0 192
8
2
8
0 191
8
2
8
0 190
8
2
8
1 190
8
0 189
8
2
8
0 188
8
2
8
1 188
8
0 187
8
2
8
1 187
8
0 186
8
2
8
1 186
8
0 185
8
2
8
0 184
8
2
8
1 184
8
0 183
8
2
8
1 183
8
0 182
8
2
8
1 182
8
0 181
8
2
8
1 181
8
0 180
8
2
8
1 180
8
0 ...

result:

wrong answer Wrong answer.

Subtask #2:

score: 0
Wrong Answer

Test #24:

score: 15
Accepted
time: 12ms
memory: 3916kb

input:

1000
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 999
8
2
8
0 998
8
2
8
1 998
8
0 997
8
2
8
1 997
8
0 996
8
2
8
1 996
8
0 995
8
2
8
1 995
8
0 994
8
2
8
1 994
8
0 993
8
2
8
1 993
8
0 992
8
2
8
1 992
8
0 991
8
2
8
1 991
8
0 990
8
2
8
1 990
8
0 989
8
2
8
1 989
8
0 988
8
2
8
1 988
8
0 987
8
2
8
1 987
8
0 986
8
2
8
1 986
8
0 985
8
2
8
1 985
8
0 984
...

result:

ok 

Test #25:

score: 0
Accepted
time: 22ms
memory: 3800kb

input:

1000
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 999
8
2
8
0 998
8
2
8
0 997
8
2
8
0 996
8
2
8
0 995
8
2
8
0 994
8
2
8
0 993
8
2
8
0 992
8
2
8
0 991
8
2
8
0 990
8
2
8
0 989
8
2
8
0 988
8
2
8
0 987
8
2
8
0 986
8
2
8
0 985
8
2
8
0 984
8
2
8
0 983
8
2
8
0 982
8
2
8
0 981
8
2
8
0 980
8
2
8
0 979
8
2
8
0 978
8
2
8
0 977
8
2
8
0 976
8
2
8
0 975
8
2
...

result:

ok 

Test #26:

score: 0
Accepted
time: 22ms
memory: 3812kb

input:

999
1
1
1
1
1
2
1
1
1
1
1
1
1
2
1
1
2
1
1
1
1
2
1
2
2
2
1
1
2
1
2
2
2
2
2
1
2
2
1
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
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
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
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
...

output:

8
0 998
8
2
8
0 997
8
2
8
0 996
8
2
8
0 995
8
2
8
0 994
8
2
8
0 993
8
2
8
1 993
8
0 992
8
2
8
0 991
8
2
8
0 990
8
2
8
0 989
8
2
8
0 988
8
2
8
0 987
8
2
8
0 986
8
2
8
0 985
8
2
8
1 985
8
0 984
8
2
8
0 983
8
2
8
0 982
8
2
8
1 982
8
0 981
8
2
8
0 980
8
2
8
0 979
8
2
8
0 978
8
2
8
0 977
8
2
8
1 977
8
0 ...

result:

ok 

Test #27:

score: 0
Accepted
time: 69ms
memory: 3924kb

input:

999
1
1
1
2
1
2
1
1
1
1
2
1
1
2
2
2
1
1
1
1
1
2
1
1
2
1
2
1
1
2
1
2
2
2
1
2
2
2
1
2
2
2
1
2
2
2
2
1
2
2
2
1
2
2
2
2
2
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
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
1
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
...

output:

8
0 998
8
2
8
0 997
8
2
8
0 996
8
2
8
0 995
8
2
8
1 995
8
0 994
8
2
8
0 993
8
2
8
1 993
8
0 992
8
2
8
0 991
8
2
8
0 990
8
2
8
0 989
8
2
8
0 988
8
2
8
1 988
8
0 987
8
2
8
0 986
8
2
8
0 985
8
2
8
1 985
8
0 984
8
2
8
1 984
8
0 983
8
2
8
1 983
8
0 982
8
2
8
0 981
8
2
8
0 980
8
2
8
0 979
8
2
8
0 978
8
2
...

result:

ok 

Test #28:

score: 0
Accepted
time: 59ms
memory: 3916kb

input:

996
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 995
8
2
8
0 994
8
2
8
1 994
8
0 993
8
2
8
1 993
8
0 992
8
2
8
1 992
8
0 991
8
2
8
1 991
8
0 990
8
2
8
1 990
8
0 989
8
2
8
1 989
8
0 988
8
2
8
1 988
8
0 987
8
2
8
1 987
8
0 986
8
2
8
1 986
8
0 985
8
2
8
1 985
8
0 984
8
2
8
1 984
8
0 983
8
2
8
1 983
8
0 982
8
2
8
1 982
8
0 981
8
2
8
1 981
8
0 980
...

result:

ok 

Test #29:

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

input:

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

output:

8
0 994
8
2
8
0 993
8
2
8
0 992
8
2
8
1 992
8
0 991
8
2
8
0 990
8
2
8
0 989
8
2
8
1 989
8
0 988
8
2
8
0 987
8
2
8
1 987
8
0 986
8
2
8
0 985
8
2
8
1 985
8
0 984
8
2
8
1 984
8
0 983
8
2
8
1 983
8
0 982
8
2
8
1 982
8
0 981
8
2
8
0 980
8
2
8
0 979
8
2
8
1 979
8
0 978
8
2
8
0 977
8
2
8
1 977
8
0 976
8
2
...

result:

ok 

Test #30:

score: -15
Wrong Answer
time: 59ms
memory: 3944kb

input:

998
1
1
1
2
2
2
2
1
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
2
2
2
...

output:

8
0 997
8
2
8
0 996
8
2
8
0 995
8
2
8
0 994
8
2
8
1 994
8
0 993
8
2
8
1 993
8
0 992
8
2
8
1 992
8
0 991
8
2
8
1 991
8
0 990
8
2
8
0 989
8
2
8
1 989
8
0 988
8
2
8
1 988
8
0 987
8
2
8
1 987
8
0 986
8
2
8
1 986
8
0 985
8
2
8
1 985
8
0 984
8
2
8
1 984
8
0 983
8
2
8
1 983
8
0 982
8
2
8
1 982
8
0 981
8
2
...

result:

wrong answer Wrong answer.

Subtask #3:

score: 0
Wrong Answer

Test #43:

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

input:

2
1
2
1
2
2

output:

8
0 1
8
2
8
0 0
8
2
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: 3856kb

input:

2
1
1
1
1

output:

8
0 1
8
2
8
0 0
8
2
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: 3ms
memory: 3768kb

input:

3
1
2
1
1
1
2

output:

8
0 2
8
2
8
0 1
8
2
8
1 1
8
0 0
8
2
8
1 0
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: 3ms
memory: 3764kb

input:

6
1
2
2
1
2
2
1
2
2
3
3
3
2
1
1
2
2
2

output:

8
0 5
8
2
8
0 4
8
2
8
1 4
8
0 3
8
2
8
1 3
8
0 2
8
2
8
0 1
8
2
8
1 1
8
0 0
8
2
8
1 0
8
1 2
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 0
8
2
8
1 0
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
3 1

result:

ok 

Test #47:

score: 75
Accepted
time: 4ms
memory: 3772kb

input:

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

output:

8
0 9
8
2
8
0 8
8
2
8
1 8
8
0 7
8
2
8
0 6
8
2
8
1 6
8
0 5
8
2
8
1 5
8
0 4
8
2
8
1 4
8
0 3
8
2
8
1 3
8
0 2
8
2
8
1 2
8
0 1
8
2
8
1 1
8
0 0
8
2
8
1 0
8
1 7
8
1 9
8
0 0
8
2
8
0 1
8
2
8
0 2
8
2
8
0 3
8
2
8
0 4
8
2
8
0 5
8
2
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 6
8
2
8
0 7
...

result:

ok 

Test #48:

score: 75
Accepted
time: 40ms
memory: 3960kb

input:

2000
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 1999
8
2
8
0 1998
8
2
8
1 1998
8
0 1997
8
2
8
1 1997
8
0 1996
8
2
8
1 1996
8
0 1995
8
2
8
1 1995
8
0 1994
8
2
8
1 1994
8
0 1993
8
2
8
1 1993
8
0 1992
8
2
8
1 1992
8
0 1991
8
2
8
1 1991
8
0 1990
8
2
8
1 1990
8
0 1989
8
2
8
1 1989
8
0 1988
8
2
8
1 1988
8
0 1987
8
2
8
1 1987
8
0 1986
8
2
8
1 1986
8...

result:

ok 

Test #49:

score: 75
Accepted
time: 14ms
memory: 3952kb

input:

2000
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 1999
8
2
8
0 1998
8
2
8
0 1997
8
2
8
0 1996
8
2
8
0 1995
8
2
8
0 1994
8
2
8
0 1993
8
2
8
0 1992
8
2
8
0 1991
8
2
8
0 1990
8
2
8
0 1989
8
2
8
0 1988
8
2
8
0 1987
8
2
8
0 1986
8
2
8
0 1985
8
2
8
0 1984
8
2
8
0 1983
8
2
8
0 1982
8
2
8
0 1981
8
2
8
0 1980
8
2
8
0 1979
8
2
8
0 1978
8
2
8
0 1977
8
2
8...

result:

ok 

Test #50:

score: 75
Accepted
time: 10ms
memory: 4016kb

input:

2000
1
1
1
1
1
1
1
1
1
1
1
1
2
2
1
1
2
1
1
1
1
2
1
1
1
2
1
1
2
2
2
2
1
1
2
2
1
1
2
2
1
2
1
2
1
2
2
2
2
1
2
2
2
2
1
1
2
2
2
2
2
2
2
1
1
2
1
2
2
2
1
1
1
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
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...

output:

8
0 1999
8
2
8
0 1998
8
2
8
0 1997
8
2
8
0 1996
8
2
8
0 1995
8
2
8
0 1994
8
2
8
0 1993
8
2
8
0 1992
8
2
8
0 1991
8
2
8
0 1990
8
2
8
0 1989
8
2
8
0 1988
8
2
8
0 1987
8
2
8
1 1987
8
0 1986
8
2
8
1 1986
8
0 1985
8
2
8
0 1984
8
2
8
0 1983
8
2
8
1 1983
8
0 1982
8
2
8
0 1981
8
2
8
0 1980
8
2
8
0 1979
8
2
...

result:

ok 

Test #51:

score: 0
Wrong Answer
time: 107ms
memory: 3904kb

input:

2000
1
2
1
1
1
1
1
1
1
1
1
2
1
1
1
1
2
1
2
1
1
1
1
1
1
1
1
2
2
2
1
1
1
2
2
1
1
2
2
2
2
2
2
2
2
2
2
2
1
1
2
1
2
2
1
2
1
2
2
2
2
2
2
2
2
1
2
1
1
1
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
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...

output:

8
0 1999
8
2
8
0 1998
8
2
8
1 1998
8
0 1997
8
2
8
0 1996
8
2
8
0 1995
8
2
8
0 1994
8
2
8
0 1993
8
2
8
0 1992
8
2
8
0 1991
8
2
8
0 1990
8
2
8
0 1989
8
2
8
0 1988
8
2
8
1 1988
8
0 1987
8
2
8
0 1986
8
2
8
0 1985
8
2
8
0 1984
8
2
8
0 1983
8
2
8
1 1983
8
0 1982
8
2
8
0 1981
8
2
8
1 1981
8
0 1980
8
2
8
0 ...

result:

wrong answer Wrong answer.