QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#45864#4565. Rarest InsectsZhangYiDe50.03 219ms3988kbC++171.5kb2022-08-24 15:51:482022-08-24 15:52:38

详细

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 4ms
memory: 3852kb

input:

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

output:

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

result:

ok 

Test #2:

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

input:

2
1
2

output:

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

result:

ok 

Test #3:

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

input:

2
1
1

output:

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

result:

ok 

Test #4:

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

input:

3
1
2
1
2

output:

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

result:

ok 

Test #5:

score: 0
Accepted
time: 4ms
memory: 3856kb

input:

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

output:

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

result:

ok 

Test #6:

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

input:

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

output:

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

result:

ok 

Test #7:

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

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 184
8
2
8
0 105
8
2
8
1 105
8
0 50
8
2
8
1 50
8
0 62
8
2
8
1 62
8
0 110
8
2
8
1 110
8
0 49
8
2
8
1 49
8
0 90
8
2
8
1 90
8
0 96
8
2
8
1 96
8
0 181
8
2
8
1 181
8
0 172
8
2
8
1 172
8
0 60
8
2
8
1 60
8
0 83
8
2
8
1 83
8
0 195
8
2
8
1 195
8
0 12
8
2
8
1 12
8
0 169
8
2
8
1 169
8
0 48
8
2
8
1 48
8
0 18...

result:

ok 

Test #8:

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

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 197
8
2
8
0 51
8
2
8
0 189
8
2
8
0 119
8
2
8
0 137
8
2
8
0 181
8
2
8
0 36
8
2
8
0 133
8
2
8
0 2
8
2
8
0 155
8
2
8
0 14
8
2
8
0 148
8
2
8
0 178
8
2
8
0 75
8
2
8
0 86
8
2
8
0 84
8
2
8
0 80
8
2
8
0 116
8
2
8
0 26
8
2
8
0 165
8
2
8
0 45
8
2
8
0 73
8
2
8
0 59
8
2
8
0 83
8
2
8
0 166
8
2
8
0 131
8
2
8
...

result:

ok 

Test #9:

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

input:

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

output:

8
0 197
8
2
8
0 51
8
2
8
0 189
8
2
8
0 119
8
2
8
1 119
8
0 137
8
2
8
0 181
8
2
8
0 36
8
2
8
1 36
8
0 133
8
2
8
1 133
8
0 2
8
2
8
0 155
8
2
8
0 14
8
2
8
1 14
8
0 148
8
2
8
0 178
8
2
8
0 75
8
2
8
0 86
8
2
8
1 86
8
0 84
8
2
8
1 84
8
0 80
8
2
8
1 80
8
0 116
8
2
8
1 116
8
0 26
8
2
8
0 165
8
2
8
1 165
8
0...

result:

ok 

Test #10:

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

input:

198
1
1
1
1
1
2
2
1
1
2
2
1
1
2
2
1
2
1
2
1
2
2
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
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 143
8
2
8
0 60
8
2
8
0 98
8
2
8
0 163
8
2
8
0 103
8
2
8
0 190
8
2
8
1 190
8
0 120
8
2
8
1 120
8
0 73
8
2
8
0 65
8
2
8
0 182
8
2
8
1 182
8
0 69
8
2
8
1 69
8
0 82
8
2
8
0 115
8
2
8
0 175
8
2
8
1 175
8
0 79
8
2
8
1 79
8
0 150
8
2
8
0 174
8
2
8
1 174
8
0 134
8
2
8
0 173
8
2
8
1 173
8
0 94
8
2
8
0 15...

result:

ok 

Test #11:

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

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
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 184
8
2
8
0 105
8
2
8
1 105
8
0 50
8
2
8
1 50
8
0 62
8
2
8
1 62
8
0 110
8
2
8
1 110
8
0 49
8
2
8
1 49
8
0 90
8
2
8
1 90
8
0 96
8
2
8
1 96
8
0 181
8
2
8
1 181
8
0 172
8
2
8
1 172
8
0 60
8
2
8
1 60
8
0 83
8
2
8
1 83
8
0 195
8
2
8
1 195
8
0 12
8
2
8
1 12
8
0 169
8
2
8
1 169
8
0 48
8
2
8
1 48
8
0 18...

result:

ok 

Test #12:

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

input:

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

output:

8
0 124
8
2
8
0 29
8
2
8
1 29
8
0 181
8
2
8
1 181
8
0 106
8
2
8
0 92
8
2
8
1 92
8
0 42
8
2
8
1 42
8
0 174
8
2
8
0 56
8
2
8
0 62
8
2
8
1 62
8
0 43
8
2
8
0 97
8
2
8
1 97
8
0 196
8
2
8
0 165
8
2
8
0 35
8
2
8
0 13
8
2
8
0 82
8
2
8
0 88
8
2
8
0 162
8
2
8
0 154
8
2
8
0 67
8
2
8
1 67
8
0 44
8
2
8
1 44
8
0 ...

result:

ok 

Test #13:

score: 0
Accepted
time: 3ms
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
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
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
...

output:

8
0 124
8
2
8
0 29
8
2
8
0 181
8
2
8
0 106
8
2
8
1 106
8
0 92
8
2
8
1 92
8
0 42
8
2
8
1 42
8
0 174
8
2
8
1 174
8
0 56
8
2
8
1 56
8
0 62
8
2
8
1 62
8
0 43
8
2
8
0 97
8
2
8
1 97
8
0 196
8
2
8
1 196
8
0 165
8
2
8
1 165
8
0 35
8
2
8
1 35
8
0 13
8
2
8
1 13
8
0 82
8
2
8
1 82
8
0 88
8
2
8
1 88
8
0 162
8
2
...

result:

ok 

Test #14:

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

input:

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

output:

8
0 143
8
2
8
0 60
8
2
8
0 98
8
2
8
0 163
8
2
8
0 103
8
2
8
0 190
8
2
8
0 120
8
2
8
0 73
8
2
8
1 73
8
0 65
8
2
8
1 65
8
0 182
8
2
8
1 182
8
0 69
8
2
8
0 82
8
2
8
1 82
8
0 115
8
2
8
0 175
8
2
8
1 175
8
0 79
8
2
8
0 150
8
2
8
1 150
8
0 174
8
2
8
0 134
8
2
8
1 134
8
0 173
8
2
8
0 94
8
2
8
0 157
8
2
8
1...

result:

ok 

Test #15:

score: 0
Accepted
time: 25ms
memory: 3864kb

input:

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

output:

8
0 197
8
2
8
0 51
8
2
8
0 189
8
2
8
0 119
8
2
8
0 137
8
2
8
0 181
8
2
8
1 181
8
0 36
8
2
8
1 36
8
0 133
8
2
8
1 133
8
0 2
8
2
8
1 2
8
0 155
8
2
8
1 155
8
0 14
8
2
8
1 14
8
0 148
8
2
8
1 148
8
0 178
8
2
8
1 178
8
0 75
8
2
8
1 75
8
0 86
8
2
8
1 86
8
0 84
8
2
8
1 84
8
0 80
8
2
8
1 80
8
0 116
8
2
8
1 1...

result:

ok 

Test #16:

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

input:

196
1
1
1
1
1
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
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
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 96
8
2
8
0 66
8
2
8
0 40
8
2
8
0 55
8
2
8
0 178
8
2
8
0 113
8
2
8
1 113
8
0 99
8
2
8
0 128
8
2
8
1 128
8
0 46
8
2
8
1 46
8
0 148
8
2
8
1 148
8
0 45
8
2
8
1 45
8
0 14
8
2
8
1 14
8
0 108
8
2
8
1 108
8
0 160
8
2
8
1 160
8
0 183
8
2
8
1 183
8
0 155
8
2
8
1 155
8
0 2
8
2
8
1 2
8
0 35
8
2
8
1 35
8
0 1...

result:

ok 

Test #17:

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

input:

199
1
1
1
1
1
1
1
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
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
...

output:

8
0 184
8
2
8
0 105
8
2
8
0 50
8
2
8
0 62
8
2
8
0 110
8
2
8
0 49
8
2
8
0 90
8
2
8
0 96
8
2
8
1 96
8
0 181
8
2
8
1 181
8
0 172
8
2
8
1 172
8
0 60
8
2
8
1 60
8
0 83
8
2
8
1 83
8
0 195
8
2
8
1 195
8
0 12
8
2
8
0 169
8
2
8
1 169
8
0 48
8
2
8
1 48
8
0 189
8
2
8
1 189
8
0 138
8
2
8
0 59
8
2
8
1 59
8
0 25
...

result:

ok 

Test #18:

score: 0
Accepted
time: 14ms
memory: 3828kb

input:

196
1
1
1
1
1
2
1
1
2
2
1
2
2
1
1
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
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 96
8
2
8
0 66
8
2
8
0 40
8
2
8
0 55
8
2
8
0 178
8
2
8
0 113
8
2
8
1 113
8
0 99
8
2
8
0 128
8
2
8
0 46
8
2
8
1 46
8
0 148
8
2
8
1 148
8
0 45
8
2
8
0 14
8
2
8
1 14
8
0 108
8
2
8
1 108
8
0 160
8
2
8
0 183
8
2
8
0 155
8
2
8
1 155
8
0 2
8
2
8
1 2
8
0 35
8
2
8
1 35
8
0 159
8
2
8
1 159
8
0 105
8
2
8
0 ...

result:

ok 

Test #19:

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

input:

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

output:

8
0 96
8
2
8
0 66
8
2
8
0 40
8
2
8
0 55
8
2
8
0 178
8
2
8
0 113
8
2
8
1 113
8
0 99
8
2
8
0 128
8
2
8
0 46
8
2
8
0 148
8
2
8
1 148
8
0 45
8
2
8
0 14
8
2
8
1 14
8
0 108
8
2
8
1 108
8
0 160
8
2
8
1 160
8
0 183
8
2
8
1 183
8
0 155
8
2
8
1 155
8
0 2
8
2
8
1 2
8
0 35
8
2
8
1 35
8
0 159
8
2
8
1 159
8
0 105...

result:

ok 

Test #20:

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

input:

196
1
1
1
1
1
2
1
1
2
1
2
1
1
2
2
1
1
1
2
2
1
2
2
2
1
1
2
2
2
2
1
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
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 96
8
2
8
0 66
8
2
8
0 40
8
2
8
0 55
8
2
8
0 178
8
2
8
0 113
8
2
8
1 113
8
0 99
8
2
8
0 128
8
2
8
0 46
8
2
8
1 46
8
0 148
8
2
8
0 45
8
2
8
1 45
8
0 14
8
2
8
0 108
8
2
8
0 160
8
2
8
1 160
8
0 183
8
2
8
1 183
8
0 155
8
2
8
0 2
8
2
8
0 35
8
2
8
0 159
8
2
8
1 159
8
0 105
8
2
8
1 105
8
0 185
8
2
8
0 9...

result:

ok 

Test #21:

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

input:

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

output:

8
0 197
8
2
8
0 51
8
2
8
0 189
8
2
8
0 119
8
2
8
0 137
8
2
8
0 181
8
2
8
1 181
8
0 36
8
2
8
0 133
8
2
8
0 2
8
2
8
0 155
8
2
8
1 155
8
0 14
8
2
8
0 148
8
2
8
0 178
8
2
8
1 178
8
0 75
8
2
8
0 86
8
2
8
0 84
8
2
8
0 80
8
2
8
0 116
8
2
8
0 26
8
2
8
0 165
8
2
8
1 165
8
0 45
8
2
8
0 73
8
2
8
0 59
8
2
8
1 5...

result:

ok 

Test #22:

score: 0
Accepted
time: 10ms
memory: 3856kb

input:

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

output:

8
0 184
8
2
8
0 105
8
2
8
0 50
8
2
8
0 62
8
2
8
0 110
8
2
8
0 49
8
2
8
0 90
8
2
8
0 96
8
2
8
0 181
8
2
8
0 172
8
2
8
0 60
8
2
8
0 83
8
2
8
0 195
8
2
8
0 12
8
2
8
0 169
8
2
8
0 48
8
2
8
1 48
8
0 189
8
2
8
0 138
8
2
8
0 59
8
2
8
0 25
8
2
8
1 25
8
0 177
8
2
8
0 188
8
2
8
0 45
8
2
8
0 3
8
2
8
0 170
8
2
...

result:

ok 

Test #23:

score: 0
Accepted
time: 24ms
memory: 3776kb

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

output:

8
0 143
8
2
8
0 60
8
2
8
0 98
8
2
8
0 163
8
2
8
0 103
8
2
8
0 190
8
2
8
0 120
8
2
8
0 73
8
2
8
0 65
8
2
8
0 182
8
2
8
0 69
8
2
8
0 82
8
2
8
0 115
8
2
8
0 175
8
2
8
0 79
8
2
8
0 150
8
2
8
0 174
8
2
8
0 134
8
2
8
0 173
8
2
8
0 94
8
2
8
0 157
8
2
8
0 48
8
2
8
0 44
8
2
8
0 14
8
2
8
1 14
8
0 95
8
2
8
0 1...

result:

ok 

Subtask #2:

score: 15
Accepted

Test #24:

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

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 28
8
2
8
0 281
8
2
8
1 281
8
0 352
8
2
8
1 352
8
0 518
8
2
8
1 518
8
0 430
8
2
8
1 430
8
0 743
8
2
8
1 743
8
0 515
8
2
8
1 515
8
0 581
8
2
8
1 581
8
0 186
8
2
8
1 186
8
0 768
8
2
8
1 768
8
0 377
8
2
8
1 377
8
0 869
8
2
8
1 869
8
0 381
8
2
8
1 381
8
0 199
8
2
8
1 199
8
0 821
8
2
8
1 821
8
0 742
8...

result:

ok 

Test #25:

score: 0
Accepted
time: 14ms
memory: 3904kb

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 28
8
2
8
0 281
8
2
8
0 352
8
2
8
0 518
8
2
8
0 430
8
2
8
0 743
8
2
8
0 515
8
2
8
0 581
8
2
8
0 186
8
2
8
0 768
8
2
8
0 377
8
2
8
0 869
8
2
8
0 381
8
2
8
0 199
8
2
8
0 821
8
2
8
0 742
8
2
8
0 991
8
2
8
0 23
8
2
8
0 677
8
2
8
0 223
8
2
8
0 694
8
2
8
0 900
8
2
8
0 442
8
2
8
0 568
8
2
8
0 172
8
2
8
...

result:

ok 

Test #26:

score: 0
Accepted
time: 38ms
memory: 3792kb

input:

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

output:

8
0 494
8
2
8
0 227
8
2
8
0 276
8
2
8
0 907
8
2
8
0 711
8
2
8
0 365
8
2
8
0 892
8
2
8
1 892
8
0 328
8
2
8
0 449
8
2
8
0 305
8
2
8
0 466
8
2
8
0 348
8
2
8
0 119
8
2
8
0 959
8
2
8
0 829
8
2
8
1 829
8
0 673
8
2
8
0 942
8
2
8
1 942
8
0 362
8
2
8
1 362
8
0 166
8
2
8
0 534
8
2
8
0 774
8
2
8
0 406
8
2
8
1 ...

result:

ok 

Test #27:

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

input:

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

output:

8
0 494
8
2
8
0 227
8
2
8
0 276
8
2
8
0 907
8
2
8
0 711
8
2
8
1 711
8
0 365
8
2
8
0 892
8
2
8
0 328
8
2
8
0 449
8
2
8
0 305
8
2
8
0 466
8
2
8
0 348
8
2
8
0 119
8
2
8
1 119
8
0 959
8
2
8
0 829
8
2
8
0 673
8
2
8
0 942
8
2
8
0 362
8
2
8
0 166
8
2
8
1 166
8
0 534
8
2
8
1 534
8
0 774
8
2
8
1 774
8
0 406
...

result:

ok 

Test #28:

score: 0
Accepted
time: 88ms
memory: 3728kb

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 475
8
2
8
0 501
8
2
8
1 501
8
0 743
8
2
8
1 743
8
0 297
8
2
8
1 297
8
0 394
8
2
8
1 394
8
0 513
8
2
8
1 513
8
0 585
8
2
8
1 585
8
0 670
8
2
8
1 670
8
0 425
8
2
8
1 425
8
0 677
8
2
8
1 677
8
0 750
8
2
8
1 750
8
0 464
8
2
8
1 464
8
0 82
8
2
8
1 82
8
0 518
8
2
8
1 518
8
0 265
8
2
8
1 265
8
0 137
8
...

result:

ok 

Test #29:

score: 0
Accepted
time: 26ms
memory: 3736kb

input:

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

output:

8
0 882
8
2
8
0 395
8
2
8
0 289
8
2
8
0 901
8
2
8
0 846
8
2
8
0 280
8
2
8
0 448
8
2
8
1 448
8
0 30
8
2
8
1 30
8
0 189
8
2
8
1 189
8
0 166
8
2
8
0 162
8
2
8
0 7
8
2
8
1 7
8
0 591
8
2
8
0 544
8
2
8
0 799
8
2
8
1 799
8
0 318
8
2
8
1 318
8
0 924
8
2
8
0 230
8
2
8
0 554
8
2
8
0 156
8
2
8
1 156
8
0 150
8
...

result:

ok 

Test #30:

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

input:

998
1
2
1
2
2
2
1
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
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
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 410
8
2
8
0 393
8
2
8
1 393
8
0 23
8
2
8
0 240
8
2
8
1 240
8
0 177
8
2
8
1 177
8
0 819
8
2
8
1 819
8
0 182
8
2
8
0 683
8
2
8
0 448
8
2
8
1 448
8
0 304
8
2
8
1 304
8
0 332
8
2
8
1 332
8
0 94
8
2
8
1 94
8
0 601
8
2
8
1 601
8
0 229
8
2
8
0 828
8
2
8
1 828
8
0 568
8
2
8
1 568
8
0 273
8
2
8
1 273
8
0...

result:

ok 

Test #31:

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

input:

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

output:

8
0 410
8
2
8
0 393
8
2
8
1 393
8
0 23
8
2
8
0 240
8
2
8
0 177
8
2
8
0 819
8
2
8
0 182
8
2
8
0 683
8
2
8
0 448
8
2
8
0 304
8
2
8
1 304
8
0 332
8
2
8
0 94
8
2
8
0 601
8
2
8
0 229
8
2
8
0 828
8
2
8
1 828
8
0 568
8
2
8
0 273
8
2
8
0 794
8
2
8
0 285
8
2
8
0 382
8
2
8
1 382
8
0 915
8
2
8
0 627
8
2
8
1 62...

result:

ok 

Test #32:

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

input:

1000
1
1
2
2
1
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
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 28
8
2
8
0 281
8
2
8
0 352
8
2
8
1 352
8
0 518
8
2
8
1 518
8
0 430
8
2
8
0 743
8
2
8
0 515
8
2
8
1 515
8
0 581
8
2
8
0 186
8
2
8
1 186
8
0 768
8
2
8
1 768
8
0 377
8
2
8
1 377
8
0 869
8
2
8
1 869
8
0 381
8
2
8
1 381
8
0 199
8
2
8
1 199
8
0 821
8
2
8
1 821
8
0 742
8
2
8
1 742
8
0 991
8
2
8
1 991
8...

result:

ok 

Test #33:

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

input:

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

output:

8
0 475
8
2
8
0 501
8
2
8
0 743
8
2
8
0 297
8
2
8
0 394
8
2
8
1 394
8
0 513
8
2
8
0 585
8
2
8
0 670
8
2
8
1 670
8
0 425
8
2
8
0 677
8
2
8
1 677
8
0 750
8
2
8
1 750
8
0 464
8
2
8
0 82
8
2
8
1 82
8
0 518
8
2
8
1 518
8
0 265
8
2
8
1 265
8
0 137
8
2
8
1 137
8
0 682
8
2
8
1 682
8
0 216
8
2
8
1 216
8
0 41...

result:

ok 

Test #34:

score: 0
Accepted
time: 23ms
memory: 3900kb

input:

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

output:

8
0 28
8
2
8
0 281
8
2
8
0 352
8
2
8
0 518
8
2
8
1 518
8
0 430
8
2
8
0 743
8
2
8
1 743
8
0 515
8
2
8
0 581
8
2
8
0 186
8
2
8
0 768
8
2
8
1 768
8
0 377
8
2
8
1 377
8
0 869
8
2
8
1 869
8
0 381
8
2
8
0 199
8
2
8
1 199
8
0 821
8
2
8
1 821
8
0 742
8
2
8
1 742
8
0 991
8
2
8
1 991
8
0 23
8
2
8
1 23
8
0 677...

result:

ok 

Test #35:

score: 0
Accepted
time: 24ms
memory: 3900kb

input:

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

output:

8
0 28
8
2
8
0 281
8
2
8
0 352
8
2
8
0 518
8
2
8
0 430
8
2
8
1 430
8
0 743
8
2
8
0 515
8
2
8
0 581
8
2
8
0 186
8
2
8
1 186
8
0 768
8
2
8
1 768
8
0 377
8
2
8
0 869
8
2
8
0 381
8
2
8
1 381
8
0 199
8
2
8
0 821
8
2
8
1 821
8
0 742
8
2
8
1 742
8
0 991
8
2
8
1 991
8
0 23
8
2
8
1 23
8
0 677
8
2
8
1 677
8
0...

result:

ok 

Test #36:

score: 0
Accepted
time: 20ms
memory: 3920kb

input:

997
1
1
1
1
1
2
1
2
1
1
1
2
2
1
2
1
1
2
2
2
1
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
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
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 302
8
2
8
0 658
8
2
8
0 836
8
2
8
0 419
8
2
8
0 592
8
2
8
0 12
8
2
8
1 12
8
0 586
8
2
8
0 661
8
2
8
1 661
8
0 232
8
2
8
0 643
8
2
8
0 518
8
2
8
0 230
8
2
8
1 230
8
0 108
8
2
8
1 108
8
0 903
8
2
8
0 533
8
2
8
1 533
8
0 460
8
2
8
0 315
8
2
8
0 43
8
2
8
1 43
8
0 181
8
2
8
1 181
8
0 163
8
2
8
1 163
...

result:

ok 

Test #37:

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

input:

995
1
1
1
1
1
1
1
1
2
2
2
2
1
2
1
1
2
2
2
2
2
1
1
2
2
1
2
1
2
2
2
2
2
1
2
2
2
1
2
1
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
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
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 882
8
2
8
0 395
8
2
8
0 289
8
2
8
0 901
8
2
8
0 846
8
2
8
0 280
8
2
8
0 448
8
2
8
0 30
8
2
8
0 189
8
2
8
1 189
8
0 166
8
2
8
1 166
8
0 162
8
2
8
1 162
8
0 7
8
2
8
1 7
8
0 591
8
2
8
0 544
8
2
8
1 544
8
0 799
8
2
8
0 318
8
2
8
0 924
8
2
8
1 924
8
0 230
8
2
8
1 230
8
0 554
8
2
8
1 554
8
0 156
8
2
8...

result:

ok 

Test #38:

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

input:

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

output:

8
0 302
8
2
8
0 658
8
2
8
0 836
8
2
8
0 419
8
2
8
0 592
8
2
8
1 592
8
0 12
8
2
8
0 586
8
2
8
0 661
8
2
8
0 232
8
2
8
0 643
8
2
8
0 518
8
2
8
0 230
8
2
8
1 230
8
0 108
8
2
8
1 108
8
0 903
8
2
8
0 533
8
2
8
0 460
8
2
8
0 315
8
2
8
1 315
8
0 43
8
2
8
0 181
8
2
8
1 181
8
0 163
8
2
8
0 902
8
2
8
1 902
8
...

result:

ok 

Test #39:

score: 0
Accepted
time: 35ms
memory: 3884kb

input:

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

output:

8
0 302
8
2
8
0 658
8
2
8
0 836
8
2
8
0 419
8
2
8
0 592
8
2
8
0 12
8
2
8
0 586
8
2
8
1 586
8
0 661
8
2
8
0 232
8
2
8
0 643
8
2
8
0 518
8
2
8
0 230
8
2
8
0 108
8
2
8
0 903
8
2
8
1 903
8
0 533
8
2
8
0 460
8
2
8
0 315
8
2
8
0 43
8
2
8
1 43
8
0 181
8
2
8
0 163
8
2
8
0 902
8
2
8
0 171
8
2
8
0 989
8
2
8
0...

result:

ok 

Test #40:

score: 0
Accepted
time: 43ms
memory: 3880kb

input:

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

output:

8
0 475
8
2
8
0 501
8
2
8
0 743
8
2
8
0 297
8
2
8
0 394
8
2
8
0 513
8
2
8
0 585
8
2
8
0 670
8
2
8
0 425
8
2
8
0 677
8
2
8
0 750
8
2
8
0 464
8
2
8
0 82
8
2
8
0 518
8
2
8
0 265
8
2
8
0 137
8
2
8
0 682
8
2
8
0 216
8
2
8
0 416
8
2
8
0 854
8
2
8
0 667
8
2
8
0 152
8
2
8
0 366
8
2
8
0 680
8
2
8
1 680
8
0 7...

result:

ok 

Test #41:

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

input:

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

output:

8
0 882
8
2
8
0 395
8
2
8
0 289
8
2
8
0 901
8
2
8
0 846
8
2
8
0 280
8
2
8
0 448
8
2
8
1 448
8
0 30
8
2
8
0 189
8
2
8
0 166
8
2
8
0 162
8
2
8
0 7
8
2
8
0 591
8
2
8
0 544
8
2
8
0 799
8
2
8
0 318
8
2
8
0 924
8
2
8
0 230
8
2
8
0 554
8
2
8
0 156
8
2
8
0 150
8
2
8
0 375
8
2
8
0 452
8
2
8
0 148
8
2
8
0 880...

result:

ok 

Test #42:

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

input:

995
1
1
1
1
1
1
1
1
1
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
1
1
1
1
2
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
2
1
1
1
1
2
1
1
1
2
2
1
1
2
1
1
1
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 882
8
2
8
0 395
8
2
8
0 289
8
2
8
0 901
8
2
8
0 846
8
2
8
0 280
8
2
8
0 448
8
2
8
0 30
8
2
8
0 189
8
2
8
0 166
8
2
8
0 162
8
2
8
0 7
8
2
8
0 591
8
2
8
0 544
8
2
8
0 799
8
2
8
0 318
8
2
8
0 924
8
2
8
0 230
8
2
8
0 554
8
2
8
0 156
8
2
8
0 150
8
2
8
0 375
8
2
8
0 452
8
2
8
0 148
8
2
8
0 880
8
2
8
0...

result:

ok 

Subtask #3:

score: 25.03
Acceptable Answer

Test #43:

score: 75
Accepted
time: 1ms
memory: 3844kb

input:

2
1
2

output:

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

result:

ok 

Test #44:

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

input:

2
1
1

output:

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

result:

ok 

Test #45:

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

input:

3
1
2
1
2

output:

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

result:

ok 

Test #46:

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

input:

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

output:

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

result:

ok 

Test #47:

score: 75
Accepted
time: 5ms
memory: 3744kb

input:

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

output:

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

result:

ok 

Test #48:

score: 75
Accepted
time: 21ms
memory: 3708kb

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 1243
8
2
8
0 560
8
2
8
1 560
8
0 1830
8
2
8
1 1830
8
0 1431
8
2
8
1 1431
8
0 665
8
2
8
1 665
8
0 690
8
2
8
1 690
8
0 289
8
2
8
1 289
8
0 266
8
2
8
1 266
8
0 1674
8
2
8
1 1674
8
0 278
8
2
8
1 278
8
0 726
8
2
8
1 726
8
0 1636
8
2
8
1 1636
8
0 1980
8
2
8
1 1980
8
0 1529
8
2
8
1 1529
8
0 545
8
2
8
1...

result:

ok 

Test #49:

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

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 1243
8
2
8
0 560
8
2
8
0 1830
8
2
8
0 1431
8
2
8
0 665
8
2
8
0 690
8
2
8
0 289
8
2
8
0 266
8
2
8
0 1674
8
2
8
0 278
8
2
8
0 726
8
2
8
0 1636
8
2
8
0 1980
8
2
8
0 1529
8
2
8
0 545
8
2
8
0 1256
8
2
8
0 527
8
2
8
0 765
8
2
8
0 845
8
2
8
0 1955
8
2
8
0 119
8
2
8
0 197
8
2
8
0 1112
8
2
8
0 902
8
2
8
...

result:

ok 

Test #50:

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

input:

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

output:

8
0 1243
8
2
8
0 560
8
2
8
0 1830
8
2
8
0 1431
8
2
8
0 665
8
2
8
0 690
8
2
8
0 289
8
2
8
0 266
8
2
8
0 1674
8
2
8
0 278
8
2
8
0 726
8
2
8
0 1636
8
2
8
0 1980
8
2
8
0 1529
8
2
8
0 545
8
2
8
0 1256
8
2
8
1 1256
8
0 527
8
2
8
0 765
8
2
8
0 845
8
2
8
0 1955
8
2
8
0 119
8
2
8
0 197
8
2
8
1 197
8
0 1112
8...

result:

ok 

Test #51:

score: 70.58
Acceptable Answer
time: 68ms
memory: 3900kb

input:

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

output:

8
0 1243
8
2
8
0 560
8
2
8
0 1830
8
2
8
0 1431
8
2
8
0 665
8
2
8
0 690
8
2
8
0 289
8
2
8
0 266
8
2
8
0 1674
8
2
8
0 278
8
2
8
0 726
8
2
8
0 1636
8
2
8
1 1636
8
0 1980
8
2
8
0 1529
8
2
8
0 545
8
2
8
0 1256
8
2
8
0 527
8
2
8
1 527
8
0 765
8
2
8
0 845
8
2
8
0 1955
8
2
8
1 1955
8
0 119
8
2
8
0 197
8
2
8...

result:

points 0.94106666670 points  0.94106666670

Test #52:

score: 25.03
Acceptable Answer
time: 219ms
memory: 3888kb

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 1243
8
2
8
0 560
8
2
8
1 560
8
0 1830
8
2
8
1 1830
8
0 1431
8
2
8
1 1431
8
0 665
8
2
8
1 665
8
0 690
8
2
8
1 690
8
0 289
8
2
8
1 289
8
0 266
8
2
8
1 266
8
0 1674
8
2
8
1 1674
8
0 278
8
2
8
1 278
8
0 726
8
2
8
1 726
8
0 1636
8
2
8
1 1636
8
0 1980
8
2
8
1 1980
8
0 1529
8
2
8
1 1529
8
0 545
8
2
8
1...

result:

points 0.33373333330 points  0.33373333330

Test #53:

score: 75
Accepted
time: 25ms
memory: 3932kb

input:

2000
1
1
1
2
1
1
1
1
1
1
1
1
2
2
1
1
2
2
1
1
1
2
1
1
2
2
1
2
2
1
1
2
1
1
1
2
2
2
2
1
1
1
1
2
1
1
2
2
2
2
1
1
2
1
2
2
2
1
2
2
2
2
2
1
1
1
2
1
1
2
1
2
1
2
1
2
1
1
1
2
2
2
1
1
2
1
2
2
2
2
2
1
1
2
1
2
2
2
2
2
2
2
1
2
2
1
1
2
1
1
2
2
1
2
2
2
1
2
2
2
1
2
1
2
2
1
1
2
1
1
2
1
2
1
1
1
2
1
2
2
1
2
1
1
2
2
2
1...

output:

8
0 1243
8
2
8
0 560
8
2
8
0 1830
8
2
8
0 1431
8
2
8
1 1431
8
0 665
8
2
8
0 690
8
2
8
0 289
8
2
8
0 266
8
2
8
0 1674
8
2
8
0 278
8
2
8
0 726
8
2
8
0 1636
8
2
8
0 1980
8
2
8
1 1980
8
0 1529
8
2
8
1 1529
8
0 545
8
2
8
0 1256
8
2
8
0 527
8
2
8
1 527
8
0 765
8
2
8
1 765
8
0 845
8
2
8
0 1955
8
2
8
0 119
...

result:

ok 

Test #54:

score: 28.2
Acceptable Answer
time: 131ms
memory: 3916kb

input:

2000
1
1
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
2
2
2
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 1243
8
2
8
0 560
8
2
8
0 1830
8
2
8
0 1431
8
2
8
1 1431
8
0 665
8
2
8
0 690
8
2
8
1 690
8
0 289
8
2
8
1 289
8
0 266
8
2
8
1 266
8
0 1674
8
2
8
1 1674
8
0 278
8
2
8
1 278
8
0 726
8
2
8
1 726
8
0 1636
8
2
8
1 1636
8
0 1980
8
2
8
1 1980
8
0 1529
8
2
8
1 1529
8
0 545
8
2
8
1 545
8
0 1256
8
2
8
1 125...

result:

points 0.3760 points  0.3760

Test #55:

score: 57.87
Acceptable Answer
time: 129ms
memory: 3828kb

input:

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

output:

8
0 1243
8
2
8
0 560
8
2
8
0 1830
8
2
8
0 1431
8
2
8
0 665
8
2
8
0 690
8
2
8
0 289
8
2
8
0 266
8
2
8
0 1674
8
2
8
0 278
8
2
8
0 726
8
2
8
0 1636
8
2
8
0 1980
8
2
8
0 1529
8
2
8
0 545
8
2
8
1 545
8
0 1256
8
2
8
0 527
8
2
8
1 527
8
0 765
8
2
8
1 765
8
0 845
8
2
8
0 1955
8
2
8
0 119
8
2
8
0 197
8
2
8
0...

result:

points 0.77160 points  0.77160

Test #56:

score: 74.56
Acceptable Answer
time: 38ms
memory: 3932kb

input:

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

output:

8
0 321
8
2
8
0 662
8
2
8
0 1290
8
2
8
0 179
8
2
8
1 179
8
0 594
8
2
8
1 594
8
0 838
8
2
8
1 838
8
0 1073
8
2
8
0 1486
8
2
8
1 1486
8
0 1161
8
2
8
1 1161
8
0 245
8
2
8
0 1412
8
2
8
1 1412
8
0 715
8
2
8
1 715
8
0 1361
8
2
8
1 1361
8
0 1635
8
2
8
1 1635
8
0 1337
8
2
8
1 1337
8
0 213
8
2
8
1 213
8
0 50...

result:

points 0.99413333330 points  0.99413333330

Test #57:

score: 74.51
Acceptable Answer
time: 88ms
memory: 3952kb

input:

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

output:

8
0 1967
8
2
8
0 1317
8
2
8
0 1674
8
2
8
0 132
8
2
8
1 132
8
0 1287
8
2
8
1 1287
8
0 980
8
2
8
0 1235
8
2
8
1 1235
8
0 1487
8
2
8
0 1634
8
2
8
1 1634
8
0 1475
8
2
8
1 1475
8
0 1413
8
2
8
1 1413
8
0 393
8
2
8
1 393
8
0 48
8
2
8
1 48
8
0 584
8
2
8
1 584
8
0 1907
8
2
8
1 1907
8
0 192
8
2
8
1 192
8
0 44...

result:

points 0.99346666670 points  0.99346666670

Test #58:

score: 73.62
Acceptable Answer
time: 35ms
memory: 3808kb

input:

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

output:

8
0 1225
8
2
8
0 256
8
2
8
1 256
8
0 1861
8
2
8
0 951
8
2
8
1 951
8
0 292
8
2
8
0 1042
8
2
8
0 1762
8
2
8
1 1762
8
0 985
8
2
8
1 985
8
0 1013
8
2
8
0 1218
8
2
8
1 1218
8
0 1996
8
2
8
0 1334
8
2
8
1 1334
8
0 419
8
2
8
0 1978
8
2
8
1 1978
8
0 426
8
2
8
0 669
8
2
8
1 669
8
0 887
8
2
8
1 887
8
0 666
8
2...

result:

points 0.98160 points  0.98160

Test #59:

score: 72.83
Acceptable Answer
time: 43ms
memory: 3948kb

input:

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

output:

8
0 321
8
2
8
0 662
8
2
8
1 662
8
0 1290
8
2
8
0 179
8
2
8
0 594
8
2
8
0 838
8
2
8
1 838
8
0 1073
8
2
8
0 1486
8
2
8
0 1161
8
2
8
1 1161
8
0 245
8
2
8
1 245
8
0 1412
8
2
8
1 1412
8
0 715
8
2
8
0 1361
8
2
8
1 1361
8
0 1635
8
2
8
1 1635
8
0 1337
8
2
8
1 1337
8
0 213
8
2
8
1 213
8
0 503
8
2
8
1 503
8
0...

result:

points 0.97106666670 points  0.97106666670

Test #60:

score: 72.3
Acceptable Answer
time: 62ms
memory: 3908kb

input:

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

output:

8
0 1225
8
2
8
0 1513
8
2
8
0 1860
8
2
8
0 649
8
2
8
0 1963
8
2
8
0 1519
8
2
8
1 1519
8
0 1740
8
2
8
1 1740
8
0 352
8
2
8
1 352
8
0 1076
8
2
8
0 1707
8
2
8
0 1183
8
2
8
0 1322
8
2
8
1 1322
8
0 340
8
2
8
1 340
8
0 249
8
2
8
1 249
8
0 1987
8
2
8
1 1987
8
0 755
8
2
8
0 1405
8
2
8
1 1405
8
0 315
8
2
8
0...

result:

points 0.9640 points  0.9640

Test #61:

score: 72.83
Acceptable Answer
time: 73ms
memory: 3808kb

input:

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

output:

8
0 1243
8
2
8
0 560
8
2
8
0 1830
8
2
8
0 1431
8
2
8
1 1431
8
0 665
8
2
8
0 690
8
2
8
0 289
8
2
8
1 289
8
0 266
8
2
8
0 1674
8
2
8
0 278
8
2
8
1 278
8
0 726
8
2
8
1 726
8
0 1636
8
2
8
0 1980
8
2
8
0 1529
8
2
8
0 545
8
2
8
1 545
8
0 1256
8
2
8
1 1256
8
0 527
8
2
8
0 765
8
2
8
0 845
8
2
8
1 845
8
0 19...

result:

points 0.97106666670 points  0.97106666670

Test #62:

score: 70.74
Acceptable Answer
time: 108ms
memory: 3932kb

input:

1998
1
1
1
1
1
1
1
1
1
2
2
2
1
1
2
1
1
2
1
1
1
1
1
2
1
1
1
1
2
1
2
2
2
2
2
1
2
1
2
2
1
2
1
2
1
1
2
2
2
1
2
2
1
1
2
1
1
2
1
1
2
2
2
1
2
2
1
2
2
2
1
2
1
2
2
1
2
2
2
2
2
1
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
1
2
2
2
2
2
1
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2...

output:

8
0 321
8
2
8
0 662
8
2
8
0 1290
8
2
8
0 179
8
2
8
0 594
8
2
8
0 838
8
2
8
0 1073
8
2
8
0 1486
8
2
8
0 1161
8
2
8
0 245
8
2
8
1 245
8
0 1412
8
2
8
1 1412
8
0 715
8
2
8
1 715
8
0 1361
8
2
8
0 1635
8
2
8
0 1337
8
2
8
1 1337
8
0 213
8
2
8
0 503
8
2
8
0 1791
8
2
8
1 1791
8
0 749
8
2
8
0 1356
8
2
8
0 396...

result:

points 0.94320 points  0.94320

Test #63:

score: 73.07
Acceptable Answer
time: 63ms
memory: 3848kb

input:

2000
1
1
1
1
1
1
2
1
1
1
1
2
1
1
2
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
2
1
2
2
1
1
2
1
1
1
2
2
1
2
1
2
1
1
2
1
1
2
1
1
1
1
1
1
1
2
1
2
1
2
1
1
1
2
1
2
1
1
2
2
1
2
2
2
1
2
1
1
2
2
2
1
2
2
2
2
1
2
2
2
1
1
1
2
2
2
2
2
1
1
1
1
2
2
2
2
2
1
2
1
1
2
2
1
2
2
1
2
2
2
2
2
1
2
2
2
1
2
1
2
2
1
2
2
2
2
2
2
2
1
2
2
2...

output:

8
0 1243
8
2
8
0 560
8
2
8
0 1830
8
2
8
0 1431
8
2
8
0 665
8
2
8
0 690
8
2
8
0 289
8
2
8
1 289
8
0 266
8
2
8
0 1674
8
2
8
0 278
8
2
8
0 726
8
2
8
0 1636
8
2
8
1 1636
8
0 1980
8
2
8
0 1529
8
2
8
0 545
8
2
8
1 545
8
0 1256
8
2
8
0 527
8
2
8
0 765
8
2
8
0 845
8
2
8
0 1955
8
2
8
0 119
8
2
8
0 197
8
2
8
...

result:

points 0.97426666670 points  0.97426666670

Test #64:

score: 71.88
Acceptable Answer
time: 73ms
memory: 3904kb

input:

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

output:

8
0 1225
8
2
8
0 256
8
2
8
0 1861
8
2
8
0 437
8
2
8
0 1970
8
2
8
0 1042
8
2
8
0 1078
8
2
8
0 985
8
2
8
0 558
8
2
8
0 1475
8
2
8
0 1847
8
2
8
0 1208
8
2
8
0 419
8
2
8
0 1870
8
2
8
0 425
8
2
8
0 45
8
2
8
0 887
8
2
8
0 1103
8
2
8
0 1707
8
2
8
0 1398
8
2
8
0 1549
8
2
8
0 1126
8
2
8
0 1818
8
2
8
0 1512
8...

result:

points 0.95840 points  0.95840

Test #65:

score: 75
Accepted
time: 47ms
memory: 3708kb

input:

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

output:

8
0 1967
8
2
8
0 1317
8
2
8
0 1674
8
2
8
0 132
8
2
8
0 1287
8
2
8
0 980
8
2
8
0 1235
8
2
8
0 1487
8
2
8
0 1634
8
2
8
0 1475
8
2
8
0 1413
8
2
8
0 393
8
2
8
0 48
8
2
8
0 584
8
2
8
0 1907
8
2
8
0 192
8
2
8
0 448
8
2
8
0 350
8
2
8
0 1253
8
2
8
0 602
8
2
8
0 1150
8
2
8
0 1457
8
2
8
0 1163
8
2
8
1 1163
8
...

result:

ok 

Test #66:

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

input:

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

output:

8
0 321
8
2
8
0 662
8
2
8
0 1290
8
2
8
0 179
8
2
8
0 594
8
2
8
0 838
8
2
8
0 1073
8
2
8
0 1486
8
2
8
0 1161
8
2
8
0 245
8
2
8
0 1412
8
2
8
0 715
8
2
8
1 715
8
0 1361
8
2
8
0 1635
8
2
8
0 1337
8
2
8
0 213
8
2
8
0 503
8
2
8
0 1791
8
2
8
0 749
8
2
8
0 1356
8
2
8
0 396
8
2
8
0 592
8
2
8
0 757
8
2
8
0 18...

result:

ok 

Test #67:

score: 75
Accepted
time: 12ms
memory: 3844kb

input:

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

output:

8
0 1967
8
2
8
0 1317
8
2
8
0 1674
8
2
8
0 132
8
2
8
0 1287
8
2
8
0 980
8
2
8
0 1235
8
2
8
0 1487
8
2
8
0 1634
8
2
8
0 1475
8
2
8
0 1413
8
2
8
0 393
8
2
8
0 48
8
2
8
0 584
8
2
8
0 1907
8
2
8
0 192
8
2
8
0 448
8
2
8
0 350
8
2
8
0 1253
8
2
8
0 602
8
2
8
0 1150
8
2
8
0 1457
8
2
8
0 1163
8
2
8
0 51
8
2
...

result:

ok 

Test #68:

score: 74.76
Acceptable Answer
time: 86ms
memory: 3916kb

input:

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

output:

8
0 582
8
2
8
0 107
8
2
8
0 1550
8
2
8
0 94
8
2
8
0 8
8
2
8
0 1117
8
2
8
0 1110
8
2
8
1 1110
8
0 1868
8
2
8
0 1240
8
2
8
0 1672
8
2
8
0 1748
8
2
8
0 526
8
2
8
0 1213
8
2
8
0 686
8
2
8
1 686
8
0 977
8
2
8
1 977
8
0 1933
8
2
8
0 895
8
2
8
0 1041
8
2
8
0 1858
8
2
8
0 1417
8
2
8
1 1417
8
0 640
8
2
8
0 7...

result:

points 0.99680 points  0.99680

Test #69:

score: 74.76
Acceptable Answer
time: 47ms
memory: 3944kb

input:

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

output:

8
0 582
8
2
8
0 107
8
2
8
0 1550
8
2
8
0 94
8
2
8
0 8
8
2
8
0 1117
8
2
8
0 1110
8
2
8
1 1110
8
0 1868
8
2
8
0 1240
8
2
8
0 1672
8
2
8
0 1748
8
2
8
0 526
8
2
8
0 1213
8
2
8
0 686
8
2
8
1 686
8
0 977
8
2
8
1 977
8
0 1933
8
2
8
0 895
8
2
8
0 1041
8
2
8
0 1858
8
2
8
0 1417
8
2
8
1 1417
8
0 640
8
2
8
0 7...

result:

points 0.99680 points  0.99680

Test #70:

score: 74.89
Acceptable Answer
time: 47ms
memory: 3952kb

input:

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

output:

8
0 582
8
2
8
0 107
8
2
8
0 1550
8
2
8
0 94
8
2
8
0 8
8
2
8
0 1117
8
2
8
0 1110
8
2
8
0 1868
8
2
8
0 1240
8
2
8
0 1672
8
2
8
0 1748
8
2
8
1 1748
8
0 526
8
2
8
0 1213
8
2
8
0 686
8
2
8
1 686
8
0 977
8
2
8
1 977
8
0 1933
8
2
8
1 1933
8
0 895
8
2
8
0 1041
8
2
8
0 1858
8
2
8
1 1858
8
0 1417
8
2
8
1 1417...

result:

points 0.99853333330 points  0.99853333330

Test #71:

score: 74.89
Acceptable Answer
time: 48ms
memory: 3868kb

input:

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

output:

8
0 582
8
2
8
0 107
8
2
8
0 1550
8
2
8
0 94
8
2
8
0 8
8
2
8
0 1117
8
2
8
0 1110
8
2
8
1 1110
8
0 1868
8
2
8
0 1240
8
2
8
0 1672
8
2
8
0 1748
8
2
8
1 1748
8
0 526
8
2
8
0 1213
8
2
8
0 686
8
2
8
1 686
8
0 977
8
2
8
1 977
8
0 1933
8
2
8
0 895
8
2
8
0 1041
8
2
8
0 1858
8
2
8
1 1858
8
0 1417
8
2
8
1 1417...

result:

points 0.99853333330 points  0.99853333330

Test #72:

score: 70.81
Acceptable Answer
time: 86ms
memory: 3912kb

input:

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

output:

8
0 1097
8
2
8
0 1042
8
2
8
0 566
8
2
8
1 566
8
0 697
8
2
8
0 1500
8
2
8
0 174
8
2
8
0 710
8
2
8
0 720
8
2
8
0 1735
8
2
8
0 37
8
2
8
0 1319
8
2
8
0 1358
8
2
8
0 439
8
2
8
0 128
8
2
8
0 790
8
2
8
0 506
8
2
8
0 1439
8
2
8
1 1439
8
0 229
8
2
8
0 274
8
2
8
0 1653
8
2
8
1 1653
8
0 41
8
2
8
0 1726
8
2
8
0...

result:

points 0.94413333330 points  0.94413333330

Test #73:

score: 70.81
Acceptable Answer
time: 100ms
memory: 3820kb

input:

1981
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
2
1
1
1
1
2
1
1
1
1
1
1
2
2
1
1
2
1
2
2
1
2
2
2
1
2
1
2
2
2
1
2
1
2
2
2
2
2
2
2
1
1
2
2
2
1
2
1
2
1
2
2
2
2
2
1
2
2
2
2
1
1
2
1
2
2
2
2
2
2
2
2
1
2
1
2
2
2
2
1
2
2
1
1
1
2
1
2
2
2
1
2
2
2
2
2
1
2
2
2
2
2
2
1
2
2
2
2
2
2
1
2
2
2
2
2
2
2
1
1
2
2
2
2
2
2
2
2
2
2...

output:

8
0 1097
8
2
8
0 1042
8
2
8
0 566
8
2
8
0 697
8
2
8
0 1500
8
2
8
0 174
8
2
8
0 710
8
2
8
0 720
8
2
8
0 1735
8
2
8
0 37
8
2
8
1 37
8
0 1319
8
2
8
0 1358
8
2
8
0 439
8
2
8
0 128
8
2
8
0 790
8
2
8
0 506
8
2
8
0 1439
8
2
8
0 229
8
2
8
0 274
8
2
8
1 274
8
0 1653
8
2
8
0 41
8
2
8
0 1726
8
2
8
0 1249
8
2
8...

result:

points 0.94413333330 points  0.94413333330

Test #74:

score: 66.24
Acceptable Answer
time: 66ms
memory: 3932kb

input:

1989
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
1
2
1
1
2
1
1
1
1
1
2
1
2
2
1
2
1
1
1
2
2
1
1
2
2
1
2
2
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
2
1
1
1
2
1
1
1
2
1
1
2
1
2
1
2
1
2
2
2
1
2
2
1
2
1
2
2
2
2
1
1
1
1
2
1
1
1
2
2
2
2
1
2
2
2
2
1
2
2
1
1
1
2
1
1
2
1
2
2
2
2
2
2
2
2
1
2
2
1
2
2
1
2
2
2
2
2
1
2
2...

output:

8
0 275
8
2
8
0 803
8
2
8
0 841
8
2
8
0 1410
8
2
8
0 390
8
2
8
0 416
8
2
8
0 1747
8
2
8
0 1665
8
2
8
0 1334
8
2
8
0 1952
8
2
8
0 1311
8
2
8
0 1957
8
2
8
0 1713
8
2
8
0 47
8
2
8
0 842
8
2
8
0 758
8
2
8
0 1967
8
2
8
0 701
8
2
8
0 1959
8
2
8
0 1766
8
2
8
0 839
8
2
8
0 1175
8
2
8
0 227
8
2
8
1 227
8
0 2...

result:

points 0.88320 points  0.88320

Test #75:

score: 66.24
Acceptable Answer
time: 98ms
memory: 3820kb

input:

1989
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
1
2
1
1
2
1
1
1
1
1
2
1
2
2
1
2
1
1
1
2
2
1
1
2
2
1
2
2
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
2
1
1
1
2
1
1
1
2
1
1
2
1
2
1
2
1
2
2
2
1
2
2
1
2
1
2
2
2
2
1
1
1
1
2
1
1
1
2
2
2
2
1
2
2
2
2
1
2
2
1
1
1
2
1
1
2
1
2
2
2
2
2
2
2
2
1
2
2
1
2
2
1
2
2
2
2
2
1
2
2...

output:

8
0 275
8
2
8
0 803
8
2
8
0 841
8
2
8
0 1410
8
2
8
0 390
8
2
8
0 416
8
2
8
0 1747
8
2
8
0 1665
8
2
8
0 1334
8
2
8
0 1952
8
2
8
0 1311
8
2
8
0 1957
8
2
8
0 1713
8
2
8
0 47
8
2
8
0 842
8
2
8
0 758
8
2
8
0 1967
8
2
8
0 701
8
2
8
0 1959
8
2
8
0 1766
8
2
8
0 839
8
2
8
0 1175
8
2
8
0 227
8
2
8
1 227
8
0 2...

result:

points 0.88320 points  0.88320

Test #76:

score: 74.9
Acceptable Answer
time: 61ms
memory: 3808kb

input:

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

output:

8
0 324
8
2
8
0 1920
8
2
8
1 1920
8
0 223
8
2
8
0 1227
8
2
8
0 1634
8
2
8
0 1432
8
2
8
0 1429
8
2
8
0 168
8
2
8
0 256
8
2
8
0 1665
8
2
8
0 1426
8
2
8
0 193
8
2
8
0 1772
8
2
8
0 1808
8
2
8
0 1001
8
2
8
0 859
8
2
8
1 859
8
0 337
8
2
8
1 337
8
0 1464
8
2
8
1 1464
8
0 155
8
2
8
1 155
8
0 1287
8
2
8
0 79...

result:

points 0.99866666670 points  0.99866666670

Test #77:

score: 74.9
Acceptable Answer
time: 53ms
memory: 3872kb

input:

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

output:

8
0 324
8
2
8
0 1920
8
2
8
0 223
8
2
8
0 1227
8
2
8
0 1634
8
2
8
0 1432
8
2
8
0 1429
8
2
8
0 168
8
2
8
0 256
8
2
8
0 1665
8
2
8
0 1426
8
2
8
0 193
8
2
8
0 1772
8
2
8
0 1808
8
2
8
0 1001
8
2
8
1 1001
8
0 859
8
2
8
0 337
8
2
8
0 1464
8
2
8
0 155
8
2
8
1 155
8
0 1287
8
2
8
1 1287
8
0 790
8
2
8
0 96
8
2...

result:

points 0.99866666670 points  0.99866666670

Test #78:

score: 70.81
Acceptable Answer
time: 137ms
memory: 3924kb

input:

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

output:

8
0 1464
8
2
8
0 280
8
2
8
0 759
8
2
8
0 911
8
2
8
0 427
8
2
8
0 132
8
2
8
1 132
8
0 1077
8
2
8
0 1512
8
2
8
0 227
8
2
8
0 1358
8
2
8
0 1162
8
2
8
0 1578
8
2
8
1 1578
8
0 1275
8
2
8
0 1639
8
2
8
0 1692
8
2
8
0 1051
8
2
8
1 1051
8
0 1438
8
2
8
0 456
8
2
8
0 584
8
2
8
0 1472
8
2
8
0 153
8
2
8
0 35
8
2...

result:

points 0.94413333330 points  0.94413333330

Test #79:

score: 70.81
Acceptable Answer
time: 70ms
memory: 3956kb

input:

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

output:

8
0 1464
8
2
8
0 280
8
2
8
0 759
8
2
8
0 911
8
2
8
0 427
8
2
8
0 132
8
2
8
1 132
8
0 1077
8
2
8
0 1512
8
2
8
0 227
8
2
8
0 1358
8
2
8
0 1162
8
2
8
0 1578
8
2
8
1 1578
8
0 1275
8
2
8
0 1639
8
2
8
0 1692
8
2
8
0 1051
8
2
8
1 1051
8
0 1438
8
2
8
0 456
8
2
8
0 584
8
2
8
0 1472
8
2
8
0 153
8
2
8
0 35
8
2...

result:

points 0.94413333330 points  0.94413333330

Test #80:

score: 74.8
Acceptable Answer
time: 95ms
memory: 3916kb

input:

2000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
1
1
2
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
2
1
1
2
1
2
1
1
1
2
1
1
1
1
2
2
2
1
1
1
2
1
1
2
1
1
2
1
2
1
2
2
2
1
2
2
2
1
1
1
2
2
1
2
2
2
2
1
1
1
1
2
2
2
1
1
2
2
1
2
1
2
2
1
1
2
2
1
2
2
2
2
1
1
1
2
1
2
1
2
2
2
2
1
1
2
2
2
1
2
1
2
2
2
2
1...

output:

8
0 1243
8
2
8
0 560
8
2
8
0 1830
8
2
8
0 1431
8
2
8
0 665
8
2
8
0 690
8
2
8
0 289
8
2
8
0 266
8
2
8
0 1674
8
2
8
0 278
8
2
8
0 726
8
2
8
0 1636
8
2
8
0 1980
8
2
8
0 1529
8
2
8
0 545
8
2
8
0 1256
8
2
8
0 527
8
2
8
0 765
8
2
8
0 845
8
2
8
0 1955
8
2
8
0 119
8
2
8
0 197
8
2
8
1 197
8
0 1112
8
2
8
1 11...

result:

points 0.99733333330 points  0.99733333330

Test #81:

score: 74.8
Acceptable Answer
time: 86ms
memory: 3988kb

input:

2000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
1
1
2
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
2
1
1
2
1
2
1
1
1
2
1
1
1
1
2
2
2
1
1
1
2
1
1
2
1
1
2
1
2
1
2
2
2
1
2
2
2
1
1
1
2
2
1
2
2
2
2
1
1
1
1
2
2
2
1
1
2
2
1
2
1
2
2
1
1
2
2
1
2
2
2
2
1
1
1
2
1
2
1
2
2
2
2
1
1
2
2
2
1
2
1
2
2
2
2
1...

output:

8
0 1243
8
2
8
0 560
8
2
8
0 1830
8
2
8
0 1431
8
2
8
0 665
8
2
8
0 690
8
2
8
0 289
8
2
8
0 266
8
2
8
0 1674
8
2
8
0 278
8
2
8
0 726
8
2
8
0 1636
8
2
8
0 1980
8
2
8
0 1529
8
2
8
0 545
8
2
8
0 1256
8
2
8
0 527
8
2
8
0 765
8
2
8
0 845
8
2
8
0 1955
8
2
8
0 119
8
2
8
0 197
8
2
8
1 197
8
0 1112
8
2
8
1 11...

result:

points 0.99733333330 points  0.99733333330

Test #82:

score: 74.93
Acceptable Answer
time: 61ms
memory: 3956kb

input:

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

output:

8
0 1243
8
2
8
0 560
8
2
8
0 1830
8
2
8
0 1431
8
2
8
0 665
8
2
8
0 690
8
2
8
0 289
8
2
8
0 266
8
2
8
0 1674
8
2
8
0 278
8
2
8
0 726
8
2
8
0 1636
8
2
8
0 1980
8
2
8
0 1529
8
2
8
0 545
8
2
8
1 545
8
0 1256
8
2
8
0 527
8
2
8
0 765
8
2
8
0 845
8
2
8
0 1955
8
2
8
1 1955
8
0 119
8
2
8
0 197
8
2
8
0 1112
8...

result:

points 0.99906666670 points  0.99906666670

Test #83:

score: 74.93
Acceptable Answer
time: 35ms
memory: 3952kb

input:

2000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
2
1
2
1
1
1
2
1
2
2
1
2
1
1
2
1
1
1
1
1
2
1
2
1
2
2
2
2
2
1
1
2
1
2
2
2
1
1
1
2
2
1
1
2
2
2
2
1
2
1
2
2
2
2
2
2
2
2
2
1
2
1
2
2
2
1
2
2
2
2
2
1
2
2
2
2
2
1
2
2
2
1
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
1
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1...

output:

8
0 1243
8
2
8
0 560
8
2
8
0 1830
8
2
8
0 1431
8
2
8
0 665
8
2
8
0 690
8
2
8
0 289
8
2
8
0 266
8
2
8
0 1674
8
2
8
0 278
8
2
8
0 726
8
2
8
0 1636
8
2
8
0 1980
8
2
8
0 1529
8
2
8
0 545
8
2
8
0 1256
8
2
8
1 1256
8
0 527
8
2
8
0 765
8
2
8
0 845
8
2
8
0 1955
8
2
8
0 119
8
2
8
0 197
8
2
8
1 197
8
0 1112
8...

result:

points 0.99906666670 points  0.99906666670

Test #84:

score: 45.61
Acceptable Answer
time: 39ms
memory: 3776kb

input:

540
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
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

8
0 104
8
2
8
0 128
8
2
8
0 414
8
2
8
1 414
8
0 374
8
2
8
1 374
8
0 427
8
2
8
1 427
8
0 224
8
2
8
1 224
8
0 278
8
2
8
1 278
8
0 65
8
2
8
1 65
8
0 44
8
2
8
1 44
8
0 125
8
2
8
1 125
8
0 322
8
2
8
0 489
8
2
8
1 489
8
0 486
8
2
8
1 486
8
0 384
8
2
8
1 384
8
0 133
8
2
8
1 133
8
0 411
8
2
8
1 411
8
0 304
...

result:

points 0.60813333330 points  0.60813333330

Test #85:

score: 32.28
Acceptable Answer
time: 105ms
memory: 3796kb

input:

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

output:

8
0 329
8
2
8
0 1235
8
2
8
1 1235
8
0 1676
8
2
8
1 1676
8
0 818
8
2
8
1 818
8
0 722
8
2
8
1 722
8
0 1675
8
2
8
1 1675
8
0 649
8
2
8
1 649
8
0 549
8
2
8
0 1043
8
2
8
1 1043
8
0 1538
8
2
8
1 1538
8
0 1795
8
2
8
1 1795
8
0 879
8
2
8
1 879
8
0 156
8
2
8
1 156
8
0 1640
8
2
8
1 1640
8
0 1516
8
2
8
1 1516
...

result:

points 0.43040 points  0.43040

Test #86:

score: 75
Accepted
time: 48ms
memory: 3812kb

input:

2000
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 1243
8
2
8
0 560
8
2
8
0 1830
8
2
8
1 1830
8
0 1431
8
2
8
1 1431
8
0 665
8
2
8
1 665
8
0 690
8
2
8
1 690
8
0 289
8
2
8
1 289
8
0 266
8
2
8
1 266
8
0 1674
8
2
8
1 1674
8
0 278
8
2
8
1 278
8
0 726
8
2
8
1 726
8
0 1636
8
2
8
1 1636
8
0 1980
8
2
8
1 1980
8
0 1529
8
2
8
1 1529
8
0 545
8
2
8
1 545
8
0...

result:

ok 

Test #87:

score: 75
Accepted
time: 32ms
memory: 3820kb

input:

2000
1
1
1
1
2
2
2
2
1
2
2
1
1
1
2
1
2
2
2
1
2
2
1
2
2
2
1
2
1
2
1
2
1
1
1
2
1
1
2
2
2
1
2
2
2
1
1
2
2
1
2
1
1
1
1
1
2
1
2
1
2
1
2
1
1
2
2
2
2
1
1
2
1
1
1
2
2
2
2
2
2
2
1
1
1
1
2
1
1
2
2
2
2
2
2
2
1
2
1
1
1
1
1
1
2
2
2
2
2
1
1
1
1
2
1
1
2
2
2
1
1
2
1
1
1
2
1
2
1
1
1
1
2
1
2
2
2
1
1
2
1
2
2
1
1
1
2
1...

output:

8
0 1243
8
2
8
0 560
8
2
8
0 1830
8
2
8
0 1431
8
2
8
0 665
8
2
8
1 665
8
0 690
8
2
8
1 690
8
0 289
8
2
8
1 289
8
0 266
8
2
8
1 266
8
0 1674
8
2
8
0 278
8
2
8
1 278
8
0 726
8
2
8
1 726
8
0 1636
8
2
8
0 1980
8
2
8
0 1529
8
2
8
0 545
8
2
8
1 545
8
0 1256
8
2
8
0 527
8
2
8
1 527
8
0 765
8
2
8
1 765
8
0 ...

result:

ok 

Test #88:

score: 75
Accepted
time: 13ms
memory: 3764kb

input:

2000
1
1
2
2
1
1
1
1
2
1
1
2
2
2
1
2
1
1
1
2
1
1
2
1
1
1
2
1
2
1
2
1
2
2
2
1
2
2
1
1
1
2
1
1
1
2
2
1
1
2
1
2
2
2
2
2
1
2
1
2
1
2
1
2
2
1
1
1
1
2
2
1
2
2
2
1
1
1
1
1
1
1
2
2
2
2
1
2
2
1
1
1
1
1
1
1
2
1
2
2
2
2
2
2
1
1
1
1
1
2
2
2
2
1
2
2
1
1
1
2
2
1
2
2
2
1
2
1
2
2
2
2
1
2
1
1
1
2
2
1
2
1
1
2
2
2
1
2...

output:

8
0 1243
8
2
8
0 560
8
2
8
0 1830
8
2
8
1 1830
8
0 1431
8
2
8
1 1431
8
0 665
8
2
8
0 690
8
2
8
0 289
8
2
8
0 266
8
2
8
0 1674
8
2
8
1 1674
8
0 278
8
2
8
0 726
8
2
8
0 1636
8
2
8
1 1636
8
0 1980
8
2
8
1 1980
8
0 1529
8
2
8
1 1529
8
0 545
8
2
8
0 1256
8
2
8
1 1256
8
0 527
8
2
8
0 765
8
2
8
0 845
8
2
8...

result:

ok 

Test #89:

score: 75
Accepted
time: 27ms
memory: 3912kb

input:

2000
1
1
1
1
1
1
2
2
2
2
1
2
2
2
1
1
1
1
1
2
2
2
1
1
2
1
2
1
2
2
1
2
2
2
1
1
1
2
2
1
2
2
1
2
2
2
1
1
2
1
1
2
1
1
2
1
2
1
1
1
2
2
2
1
2
1
2
1
1
1
2
2
1
2
2
1
2
2
1
2
2
1
2
2
2
2
1
1
1
2
1
1
1
1
2
1
2
1
1
1
2
1
1
2
1
1
1
1
1
2
1
2
1
2
1
2
1
2
1
1
2
1
2
1
2
1
2
1
2
2
2
2
2
2
2
1
2
1
1
1
1
2
1
2
2
2
2
2...

output:

8
0 1243
8
2
8
0 560
8
2
8
0 1830
8
2
8
0 1431
8
2
8
0 665
8
2
8
0 690
8
2
8
0 289
8
2
8
1 289
8
0 266
8
2
8
1 266
8
0 1674
8
2
8
1 1674
8
0 278
8
2
8
1 278
8
0 726
8
2
8
0 1636
8
2
8
1 1636
8
0 1980
8
2
8
1 1980
8
0 1529
8
2
8
1 1529
8
0 545
8
2
8
0 1256
8
2
8
0 527
8
2
8
0 765
8
2
8
0 845
8
2
8
0 ...

result:

ok