QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#44467#1390. Królewski bal [B]SuffixTree5 1381ms83100kbC++174.2kb2022-08-17 19:04:222022-08-17 19:04:25

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 1
Accepted

Test #3:

score: 1
Accepted
time: 5ms
memory: 17916kb

input:

1 0 0

output:

0

result:

ok single line: '0'

Test #4:

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

input:

1 1 0
1 1 1 1

output:

0

result:

ok single line: '0'

Test #5:

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

input:

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

output:

48

result:

ok single line: '48'

Test #6:

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

input:

50 9998 0
13 1 43 21
31 3 41 40
12 12 20 36
24 12 46 32
7 2 27 28
2 44 19 45
35 32 41 36
33 4 42 45
6 17 21 39
5 16 37 28
31 10 37 21
38 33 47 37
2 38 5 46
3 3 24 20
16 33 25 43
3 35 42 50
13 38 25 44
37 1 41 38
4 37 48 45
2 24 45 45
21 26 49 31
1 34 28 42
14 7 24 23
13 21 39 33
24 12 39 35
15 2 49 ...

output:

1230

result:

ok single line: '1230'

Test #7:

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

input:

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

output:

1243

result:

ok single line: '1243'

Test #8:

score: 0
Accepted
time: 19ms
memory: 18364kb

input:

50 9998 0
12 22 50 37
42 13 43 50
1 4 33 42
7 1 49 46
19 1 49 50
2 25 35 42
9 7 43 34
4 19 50 33
10 36 26 38
18 26 46 47
18 6 47 46
1 4 38 45
2 18 49 47
41 2 47 42
6 19 32 31
1 1 46 30
6 6 41 31
4 19 46 37
1 1 39 23
20 16 49 24
31 16 49 36
6 12 38 50
31 5 39 18
5 29 49 42
40 11 44 42
9 3 48 12
4 4 1...

output:

1243

result:

ok single line: '1243'

Test #9:

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

input:

50 9998 0
32 16 48 38
25 16 49 36
35 6 38 21
2 13 37 14
39 10 48 37
4 5 34 50
1 11 40 45
5 3 44 48
3 7 48 39
27 39 45 40
18 6 22 31
15 6 48 36
27 18 30 34
3 10 22 43
25 2 50 50
31 3 40 33
14 2 22 25
28 4 47 32
3 3 43 33
7 20 38 42
14 17 42 40
2 30 31 50
14 12 40 50
6 1 11 40
15 1 49 50
25 13 49 47
3...

output:

1247

result:

ok single line: '1247'

Test #10:

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

input:

50 10000 0
25 32 50 41
39 14 46 19
2 7 11 30
7 28 37 36
19 9 29 18
11 30 39 46
27 3 48 39
3 11 39 49
6 9 30 36
3 2 25 28
18 23 40 25
10 25 31 43
2 27 30 42
4 5 36 39
16 20 30 36
11 5 42 41
7 10 37 26
19 3 43 37
1 22 13 38
22 10 42 37
35 13 46 14
19 6 43 25
10 23 44 25
5 16 30 34
15 7 34 49
4 16 31 4...

output:

455

result:

ok single line: '455'

Test #11:

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

input:

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

output:

741

result:

ok single line: '741'

Test #12:

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

input:

50 10000 0
15 24 38 45
7 1 48 10
28 4 35 28
29 22 37 49
17 16 34 30
10 35 13 36
39 3 48 45
13 27 42 30
15 26 45 48
19 6 35 8
5 16 14 29
5 12 38 45
14 15 39 40
23 2 39 35
19 7 32 31
26 4 38 13
1 2 46 48
1 8 37 17
11 15 13 43
7 1 37 31
11 7 16 34
21 41 44 48
3 11 33 38
6 35 47 46
11 2 21 23
22 29 44 5...

output:

453

result:

ok single line: '453'

Test #13:

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

input:

50 10000 0
36 20 37 21
23 26 24 27
48 3 48 3
19 26 20 27
29 25 30 26
30 36 31 37
47 5 47 5
7 28 7 28
5 45 6 45
13 22 13 23
22 19 23 19
4 47 4 48
42 9 43 9
26 42 27 43
30 20 31 21
17 31 18 31
30 48 30 48
45 9 46 9
26 32 26 33
27 7 28 7
48 42 48 43
2 23 3 24
3 25 4 25
3 7 4 8
47 11 48 12
16 7 16 7
27 ...

output:

1210

result:

ok single line: '1210'

Test #14:

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

input:

50 10000 0
33 40 34 40
47 10 48 11
35 7 35 8
17 28 18 29
10 31 11 31
16 27 17 28
28 24 28 24
45 4 45 4
14 8 14 9
14 28 14 28
33 7 34 7
21 14 21 14
5 18 5 19
15 23 16 23
16 13 16 13
33 22 34 22
30 24 30 25
12 29 13 30
21 37 22 37
48 34 49 35
4 46 4 47
41 46 42 47
37 30 37 31
21 35 21 36
39 34 39 34
3...

output:

1243

result:

ok single line: '1243'

Test #15:

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

input:

50 9999 0
8 7 8 8
2 31 3 32
8 33 8 34
14 5 14 5
18 46 19 46
49 46 49 47
30 13 31 14
15 45 16 45
17 24 18 25
21 17 22 18
24 34 25 35
10 37 10 38
21 38 22 39
12 47 13 47
44 47 44 47
46 26 46 26
3 8 4 9
30 21 31 22
47 1 48 1
10 17 10 18
31 18 32 19
27 21 27 21
33 43 33 43
3 25 4 25
35 45 36 46
31 21 31...

output:

1247

result:

ok single line: '1247'

Test #16:

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

input:

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

output:

1236

result:

ok single line: '1236'

Test #17:

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

input:

50 50 0
50 15 50 34
19 12 19 38
1 15 1 34
9 21 9 26
3 20 3 28
41 22 41 26
31 23 31 24
49 23 49 24
36 19 36 31
33 23 33 25
12 23 12 25
32 23 32 23
40 23 40 23
2 22 2 25
46 23 46 24
42 23 42 25
35 22 35 25
47 15 47 34
39 23 39 25
11 22 11 25
18 21 18 27
45 15 45 36
6 18 6 33
26 23 26 24
21 23 21 25
38...

output:

493

result:

ok single line: '493'

Test #18:

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

input:

50 50 0
36 29 36 34
3 29 3 35
10 29 10 33
2 28 2 36
32 14 32 50
13 1 13 50
18 28 18 37
22 25 22 43
14 22 14 45
27 29 27 33
4 30 4 30
20 41 23 42
42 21 42 47
5 1 5 50
34 29 34 32
17 29 17 32
46 29 46 33
24 1 24 50
8 29 8 32
39 25 39 42
29 30 29 32
49 30 49 31
11 7 11 50
12 29 12 35
35 29 35 34
19 28 ...

output:

647

result:

ok single line: '647'

Subtask #2:

score: 1
Accepted

Test #19:

score: 1
Accepted
time: 92ms
memory: 21696kb

input:

200 99999 10
25 12 33 165
21 46 190 51
44 22 47 130
57 12 69 31
40 54 151 176
55 173 113 175
141 153 192 192
24 47 128 141
7 119 58 133
79 25 181 36
58 1 66 66
61 93 178 104
98 14 129 163
14 3 164 63
113 39 173 132
49 3 171 38
82 43 144 153
166 75 191 135
19 39 99 121
92 52 170 155
118 24 199 112
1 ...

output:

19976
19977
19978
19977
19978
19979
19978
19977
19978
19977
19976

result:

ok 11 lines

Test #20:

score: 0
Accepted
time: 79ms
memory: 21500kb

input:

199 100000 10
66 75 161 177
38 20 189 35
69 134 128 179
35 62 83 72
72 130 77 152
47 38 182 92
17 18 156 193
25 42 132 77
21 36 44 185
17 28 122 44
38 3 168 65
174 29 192 110
29 39 51 127
12 156 188 191
18 9 167 63
74 40 87 71
33 30 163 126
90 72 116 98
39 22 63 35
12 64 121 75
28 51 139 92
5 3 20 3...

output:

19717
19718
19717
19716
19715
19714
19713
19712
19711
19712
19711

result:

ok 11 lines

Test #21:

score: 0
Accepted
time: 90ms
memory: 21740kb

input:

200 100000 10
70 20 119 132
33 34 197 69
11 88 167 172
18 11 193 195
2 10 148 186
17 142 131 184
56 44 169 51
123 93 185 176
4 58 111 96
2 75 197 78
143 16 195 108
7 48 199 90
25 85 154 172
119 31 199 137
44 38 199 193
3 49 192 111
140 35 182 114
86 1 131 179
79 55 167 137
77 26 174 138
35 2 167 172...

output:

19802
19803
19804
19803
19802
19803
19802
19803
19804
19805
19806

result:

ok 11 lines

Test #22:

score: 0
Accepted
time: 74ms
memory: 21864kb

input:

197 100000 10
36 34 184 110
53 118 194 139
48 5 174 181
133 138 178 194
156 65 169 90
5 75 164 137
95 56 163 153
67 83 77 97
29 65 114 102
119 107 124 111
38 63 164 113
48 49 122 126
146 53 165 193
9 19 179 44
74 15 109 22
103 68 186 175
31 141 35 184
79 62 195 115
126 106 147 132
133 98 195 166
119...

output:

8223
8224
8224
8225
8226
8226
8226
8226
8227
8227
8228

result:

ok 11 lines

Test #23:

score: 0
Accepted
time: 85ms
memory: 21896kb

input:

199 100000 10
54 81 191 178
1 52 139 166
119 130 144 194
12 49 144 115
61 70 192 132
15 7 123 186
42 20 118 73
132 7 139 159
177 29 191 194
25 102 29 123
44 48 131 192
127 96 166 158
1 100 25 143
17 94 99 179
83 27 130 137
21 57 192 157
94 20 154 145
16 28 46 151
38 105 113 183
111 37 191 193
66 76 ...

output:

10285
10286
10287
10288
10289
10290
10291
10292
10292
10293
10293

result:

ok 11 lines

Test #24:

score: 0
Accepted
time: 58ms
memory: 22140kb

input:

196 99998 10
183 77 184 78
181 92 182 93
157 112 158 113
165 39 166 40
79 147 79 148
11 15 11 15
140 8 141 9
125 107 126 108
27 154 28 155
177 113 177 113
109 70 110 70
114 64 114 64
146 1 146 1
82 15 82 16
116 30 116 31
135 49 136 49
49 133 49 134
81 34 82 34
185 59 186 59
128 5 128 6
33 159 33 160...

output:

19032
19033
19032
19033
19032
19031
19030
19031
19032
19031
19032

result:

ok 11 lines

Test #25:

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

input:

200 99999 10
80 19 81 19
51 196 51 196
149 34 149 34
6 57 6 58
43 195 44 196
145 119 146 120
25 82 25 83
169 164 170 165
3 86 3 86
83 141 84 142
51 68 52 68
17 143 18 144
63 47 63 48
195 185 195 185
150 120 150 120
27 137 27 138
7 35 7 35
197 131 197 132
125 159 125 159
191 65 191 66
158 118 159 118...

output:

19789
19790
19791
19790
19791
19790
19789
19788
19789
19790
19791

result:

ok 11 lines

Test #26:

score: 0
Accepted
time: 58ms
memory: 22024kb

input:

199 100000 10
191 5 194 5
137 61 141 64
91 46 94 50
50 47 54 49
62 61 65 62
175 12 175 13
52 44 55 44
150 38 150 39
176 44 176 46
90 118 91 120
112 142 114 146
155 164 158 165
111 178 113 182
66 81 67 84
114 2 116 4
88 179 88 180
61 166 62 167
106 65 107 67
149 50 151 52
45 135 47 138
48 126 52 130
...

output:

19798
19797
19798
19799
19800
19800
19800
19799
19800
19799
19798

result:

ok 11 lines

Test #27:

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

input:

200 200 10
134 164 183 164
146 106 159 106
149 148 156 148
146 185 160 185
135 86 180 86
142 184 167 184
148 190 156 190
142 80 163 80
148 155 156 155
148 54 156 54
146 60 159 60
148 7 157 7
144 192 161 192
149 178 156 178
10 85 200 85
137 195 174 195
142 10 162 10
138 16 173 16
135 145 179 145
148 ...

output:

7086
7087
7086
7087
7088
7089
7090
7091
7092
7091
7092

result:

ok 11 lines

Subtask #3:

score: 1
Accepted

Test #28:

score: 1
Accepted
time: 90ms
memory: 21896kb

input:

198 100000 10
61 12 104 104
33 77 82 181
27 26 120 122
46 6 100 127
172 90 190 144
152 73 156 79
6 140 162 196
38 10 64 80
66 112 97 114
38 55 96 160
121 91 192 189
26 160 124 160
41 34 97 131
17 79 170 133
118 75 146 122
168 24 173 53
65 72 72 182
56 64 69 78
172 17 198 97
67 103 163 115
24 84 71 1...

output:

19572
19571
19570
19571
19572
19571
19572
19571
19572
19573
19574

result:

ok 11 lines

Test #29:

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

input:

200 100000 10
16 86 117 173
118 6 133 188
7 116 177 199
10 59 179 199
2 120 145 128
32 63 150 185
46 31 160 147
124 3 172 182
13 20 132 163
18 10 171 182
104 17 179 199
14 83 198 112
117 125 180 150
43 124 148 177
147 6 189 187
33 15 192 77
11 44 168 191
68 91 75 145
29 3 195 117
4 5 127 181
109 12 ...

output:

19893
19892
19893
19892
19891
19892
19893
19894
19895
19894
19895

result:

ok 11 lines

Test #30:

score: 0
Accepted
time: 80ms
memory: 21604kb

input:

195 99997 10
46 43 69 150
163 5 188 143
15 40 111 186
5 10 150 193
83 127 156 137
86 90 109 190
6 63 175 133
8 66 188 189
143 68 178 183
79 82 138 111
42 83 177 91
11 12 80 194
34 12 61 172
37 54 166 188
10 26 168 136
78 11 82 186
129 20 142 121
105 7 192 83
13 12 195 186
46 11 184 138
104 38 170 16...

output:

18794
18793
18794
18793
18792
18793
18792
18791
18792
18793
18794

result:

ok 11 lines

Test #31:

score: 0
Accepted
time: 72ms
memory: 21676kb

input:

200 100000 10
31 105 195 145
93 127 182 144
28 133 144 163
17 140 84 171
38 29 185 136
19 46 55 126
68 7 91 133
83 98 171 184
35 94 183 161
175 50 199 129
44 78 151 133
110 71 167 172
111 49 180 169
50 84 161 100
87 63 195 73
57 64 91 156
11 99 105 180
36 88 94 187
93 116 137 169
6 174 134 174
42 15...

output:

13845
13846
13846
13847
13848
13848
13848
13848
13848
13849
13849

result:

ok 11 lines

Test #32:

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

input:

198 99996 10
48 45 128 86
17 61 141 145
92 50 140 151
124 21 167 157
102 13 182 172
81 69 173 130
62 93 146 197
28 25 39 150
22 73 118 147
15 13 125 44
21 50 82 180
26 69 53 119
21 22 114 59
57 63 82 172
115 51 193 172
40 26 190 95
106 112 172 189
3 48 120 120
134 16 172 132
18 5 191 89
77 11 142 65...

output:

8964
8964
8964
8965
8966
8967
8968
8969
8970
8971
8971

result:

ok 11 lines

Test #33:

score: 0
Accepted
time: 52ms
memory: 21772kb

input:

199 99996 10
153 175 153 175
142 47 142 47
3 89 3 89
151 88 151 88
100 195 100 195
179 14 180 14
22 77 23 77
121 148 121 149
28 71 29 71
132 53 133 54
14 28 14 29
52 113 52 114
117 60 118 61
174 146 174 146
54 168 54 168
72 40 72 41
138 45 138 45
101 68 101 68
26 120 27 120
109 137 109 137
30 69 31 ...

output:

19773
19774
19773
19774
19775
19776
19777
19778
19779
19780
19781

result:

ok 11 lines

Test #34:

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

input:

200 99998 10
184 24 184 24
96 2 97 3
99 176 100 177
80 79 80 80
78 24 79 24
77 158 78 158
85 90 86 91
112 69 113 69
50 107 51 107
6 29 7 29
170 65 170 65
17 164 18 164
129 77 129 77
188 197 189 197
83 91 84 91
180 14 180 15
171 55 171 55
47 5 47 5
122 59 122 60
9 33 9 33
175 145 176 145
185 83 186 8...

output:

19866
19867
19866
19867
19868
19867
19868
19867
19866
19865
19866

result:

ok 11 lines

Test #35:

score: 0
Accepted
time: 61ms
memory: 21944kb

input:

200 100000 10
175 91 177 95
177 88 181 91
34 45 35 49
76 161 80 164
142 195 145 197
174 55 178 59
76 44 80 46
88 165 89 165
140 178 143 182
82 110 86 111
83 161 85 163
79 153 82 154
12 44 13 45
101 77 101 81
177 194 179 198
7 25 8 25
66 98 69 101
41 96 44 98
40 124 43 125
42 120 43 121
113 100 116 1...

output:

19820
19819
19818
19817
19816
19817
19818
19819
19818
19819
19820

result:

ok 11 lines

Test #36:

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

input:

197 200 10
126 48 126 53
9 49 9 52
156 30 156 71
124 41 124 57
148 40 148 60
195 48 195 52
29 1 29 106
85 38 85 64
49 47 49 53
121 25 121 76
145 1 145 102
151 49 151 52
96 40 96 62
20 41 20 57
40 27 40 73
131 40 131 63
109 31 109 71
13 48 13 53
1 38 1 67
122 32 122 70
37 41 37 56
118 1 118 197
117 4...

output:

7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966

result:

ok 11 lines

Subtask #4:

score: 1
Accepted

Test #37:

score: 1
Accepted
time: 130ms
memory: 22020kb

input:

1998 100000 4996
775 369 991 1761
1602 537 1960 1167
361 1256 1522 1569
261 322 1165 1934
39 286 1996 1996
260 994 1739 1651
600 1043 1368 1593
679 1167 1481 1338
149 21 959 1234
1096 348 1965 1246
1827 933 1834 1443
418 341 490 637
76 518 1974 1492
385 1501 390 1608
153 353 1689 459
1451 402 1549 1...

output:

1995864
1995863
1995862
1995863
1995864
1995863
1995864
1995863
1995862
1995863
1995864
1995865
1995864
1995865
1995866
1995865
1995864
1995863
1995864
1995863
1995862
1995863
1995864
1995863
1995862
1995863
1995862
1995863
1995862
1995861
1995860
1995861
1995860
1995859
1995858
1995857
1995856
1995...

result:

ok 4997 lines

Test #38:

score: 0
Accepted
time: 115ms
memory: 22008kb

input:

2000 100000 4998
16 682 230 1431
491 196 1355 1519
511 285 730 1688
1193 693 1970 898
217 24 772 488
151 1004 1357 1329
586 674 1426 1141
420 743 1072 1747
144 732 479 965
676 24 1803 930
65 578 1966 774
91 1537 1768 1804
693 1060 1675 1291
775 257 1775 1479
255 234 763 866
1 1269 758 1805
194 236 2...

output:

1999850
1999849
1999850
1999851
1999852
1999853
1999852
1999851
1999852
1999853
1999852
1999851
1999852
1999853
1999854
1999855
1999854
1999853
1999852
1999853
1999854
1999855
1999854
1999855
1999854
1999853
1999854
1999855
1999856
1999855
1999854
1999853
1999852
1999851
1999852
1999853
1999852
1999...

result:

ok 4999 lines

Test #39:

score: 0
Accepted
time: 119ms
memory: 21980kb

input:

2000 100000 5000
71 166 788 503
1461 1031 1521 1851
17 17 1977 148
122 1521 806 1700
583 1438 1133 1504
1127 478 1190 849
371 894 549 1967
7 135 693 1086
155 478 1123 798
203 1451 1433 1948
32 924 619 1767
119 496 535 1777
47 506 366 1714
781 637 1338 1878
309 444 1300 1974
147 755 1788 1976
1245 55...

output:

1999300
1999301
1999302
1999301
1999300
1999301
1999300
1999299
1999298
1999297
1999298
1999297
1999296
1999295
1999294
1999295
1999294
1999293
1999294
1999295
1999296
1999295
1999294
1999295
1999294
1999293
1999292
1999291
1999290
1999289
1999288
1999287
1999286
1999287
1999286
1999287
1999286
1999...

result:

ok 5001 lines

Test #40:

score: 0
Accepted
time: 130ms
memory: 22500kb

input:

2000 100000 5000
471 898 1154 1562
165 1275 1527 1492
454 566 1978 1692
30 502 1703 1918
374 380 1617 562
265 989 1758 1529
806 261 1943 1252
256 79 360 1717
178 126 1987 1854
548 175 1981 1946
455 401 1157 1762
262 105 1460 514
854 667 1053 1783
227 421 746 1361
613 118 1314 1399
303 202 1995 379
7...

output:

1999203
1999204
1999203
1999202
1999201
1999200
1999201
1999202
1999201
1999200
1999201
1999202
1999203
1999204
1999205
1999206
1999207
1999208
1999209
1999208
1999209
1999210
1999211
1999212
1999211
1999212
1999213
1999212
1999211
1999212
1999211
1999212
1999211
1999210
1999209
1999210
1999211
1999...

result:

ok 5001 lines

Test #41:

score: 0
Accepted
time: 121ms
memory: 22472kb

input:

2000 100000 5000
1156 723 1376 1366
46 522 1943 1861
1059 733 1878 1569
129 1141 1908 1978
590 146 1744 984
16 584 1338 1506
466 257 1066 760
402 896 470 1910
769 1119 1418 1955
53 675 1585 1974
520 1411 1749 1792
847 124 1787 1817
193 658 1402 1429
79 496 1531 996
1798 104 1935 1636
95 1418 1989 18...

output:

1999333
1999332
1999333
1999334
1999335
1999336
1999337
1999338
1999339
1999338
1999337
1999336
1999337
1999338
1999339
1999338
1999339
1999338
1999337
1999336
1999335
1999334
1999333
1999334
1999335
1999336
1999335
1999336
1999337
1999336
1999337
1999338
1999337
1999336
1999335
1999336
1999337
1999...

result:

ok 5001 lines

Test #42:

score: 0
Accepted
time: 123ms
memory: 22480kb

input:

1998 100000 5000
118 51 1704 1117
209 129 1922 1898
483 357 1982 1769
5 136 1545 1701
227 954 1851 1713
36 332 1782 1631
43 1360 1816 1486
519 388 1597 1214
817 257 881 1150
11 56 1835 1181
136 142 1753 1417
1075 577 1893 1974
38 5 1839 1715
25 996 489 1326
95 888 1132 1647
25 1439 1987 1782
1062 39...

output:

1995146
1995145
1995144
1995143
1995142
1995141
1995142
1995143
1995144
1995145
1995146
1995147
1995148
1995149
1995148
1995147
1995146
1995147
1995146
1995147
1995148
1995147
1995148
1995147
1995148
1995149
1995148
1995147
1995148
1995147
1995148
1995149
1995148
1995149
1995148
1995147
1995146
1995...

result:

ok 5001 lines

Test #43:

score: 0
Accepted
time: 126ms
memory: 22260kb

input:

1998 100000 4997
1379 880 1630 1549
119 731 1645 1876
1272 414 1858 1877
998 17 1449 1519
406 1567 1822 1801
512 1122 1025 1795
640 262 1758 1676
1651 246 1889 1603
672 300 1235 505
307 191 1866 1050
156 80 1131 1574
1116 1789 1703 1820
582 363 660 1522
336 882 1676 1973
860 653 1804 701
194 270 751...

output:

1363868
1363869
1363870
1363870
1363871
1363872
1363873
1363874
1363875
1363876
1363877
1363878
1363878
1363878
1363878
1363878
1363878
1363879
1363880
1363881
1363881
1363882
1363882
1363883
1363883
1363884
1363885
1363886
1363887
1363887
1363888
1363889
1363889
1363889
1363889
1363890
1363891
1363...

result:

ok 4998 lines

Test #44:

score: 0
Accepted
time: 120ms
memory: 22388kb

input:

1997 100000 5000
706 991 1623 1395
684 834 1194 1819
564 283 1038 977
483 888 1472 1562
239 604 630 805
882 136 1954 1129
278 357 1770 882
470 1575 1365 1833
235 164 1657 1660
610 1357 1759 1870
1074 1010 1335 1792
6 1634 1772 1658
667 1465 1458 1729
1539 1611 1872 1639
57 1141 1053 1976
32 524 328 ...

output:

1243234
1243235
1243236
1243236
1243237
1243237
1243238
1243239
1243239
1243240
1243241
1243241
1243242
1243243
1243243
1243244
1243244
1243245
1243246
1243246
1243246
1243246
1243247
1243247
1243248
1243248
1243249
1243250
1243251
1243252
1243253
1243254
1243255
1243256
1243257
1243258
1243259
1243...

result:

ok 5001 lines

Test #45:

score: 0
Accepted
time: 144ms
memory: 22484kb

input:

1996 100000 5000
663 1036 1106 1416
335 968 1442 1649
794 189 1126 1835
254 169 488 616
233 536 1046 1804
453 139 1805 293
592 371 977 1714
1474 499 1533 1666
1055 109 1358 695
156 1349 1329 1699
166 151 1728 565
275 1858 836 1969
536 257 1414 662
53 1217 1597 1848
430 605 1441 1762
34 1472 1988 180...

output:

1034408
1034409
1034410
1034411
1034411
1034412
1034412
1034413
1034414
1034415
1034416
1034417
1034418
1034419
1034420
1034421
1034422
1034423
1034424
1034424
1034425
1034426
1034426
1034427
1034427
1034428
1034429
1034430
1034431
1034431
1034432
1034432
1034433
1034434
1034435
1034436
1034437
1034...

result:

ok 5001 lines

Test #46:

score: 0
Accepted
time: 112ms
memory: 22400kb

input:

1996 99997 5000
397 1167 590 1351
736 594 1713 1103
62 1679 450 1690
838 90 1790 1249
452 1871 1205 1955
330 2 651 476
343 313 1719 1292
1529 77 1716 535
109 163 308 1836
379 348 1663 954
1059 85 1124 1589
140 591 1388 1863
1032 677 1877 1471
1324 282 1554 1598
251 441 1672 1514
741 133 825 1605
832...

output:

818387
818388
818388
818389
818389
818390
818391
818392
818393
818394
818394
818394
818395
818395
818396
818396
818397
818398
818399
818399
818400
818401
818402
818403
818404
818405
818406
818407
818408
818409
818410
818411
818412
818412
818413
818414
818415
818416
818416
818417
818418
818419
818420...

result:

ok 5001 lines

Test #47:

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

input:

1996 700 5000
42 681 225 857
1817 1217 1818 1217
1342 1920 1343 1921
42 1 1305 1995
38 6 39 7
35 679 1772 759
35 681 1772 857
796 120 1119 1852
41 1180 799 1358
1107 1835 1108 1835
772 1297 773 1297
225 218 368 1433
132 753 820 1853
41 1798 799 1865
9 216 9 217
225 159 368 643
66 749 1134 755
792 12...

output:

229558
229559
229560
229561
229562
229563
229564
229565
229566
229567
229568
229569
229570
229571
229572
229573
229574
229575
229576
229577
229578
229579
229580
229581
229582
229583
229584
229585
229586
229587
229588
229589
229590
229591
229592
229593
229594
229595
229596
229597
229598
229599
229600...

result:

ok 5001 lines

Test #48:

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

input:

1996 697 5000
291 520 292 521
1100 494 1101 495
210 625 1118 1801
238 1817 404 1821
1913 1098 1914 1098
199 262 199 262
639 344 639 344
609 377 1610 896
237 1018 1117 1386
1582 998 1582 999
89 650 604 1564
730 161 731 162
1207 1194 1208 1194
94 1195 957 1256
875 1906 876 1907
94 377 957 896
926 1838...

output:

217225
217226
217227
217228
217228
217229
217230
217231
217232
217233
217234
217235
217236
217237
217238
217239
217240
217241
217242
217243
217244
217245
217246
217247
217248
217249
217250
217251
217252
217253
217254
217255
217255
217256
217257
217258
217259
217260
217261
217262
217263
217264
217265...

result:

ok 5001 lines

Test #49:

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

input:

2000 97 5000
183 488 183 489
344 599 345 600
929 1521 930 1521
742 1588 742 1589
1046 1323 1047 1324
1359 586 1360 586
359 411 360 412
933 1096 934 1096
1503 1388 1503 1389
1992 96 1992 97
535 1406 536 1406
1606 632 1606 632
1526 1940 1527 1941
1660 1798 1661 1798
1607 186 1608 186
1638 275 1639 275...

output:

119192
119193
119194
119195
119196
119197
119198
119199
119200
119201
119202
119203
119204
119205
119206
119207
119208
119209
119210
119211
119212
119213
119214
119215
119216
119217
119218
119219
119220
119221
119222
119223
119222
119223
119224
119225
119226
119227
119226
119227
119228
119229
119230...

result:

ok 5001 lines

Test #50:

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

input:

1996 100 5000
1375 1591 1375 1591
1487 1804 1487 1805
232 2 1036 1996
766 347 766 348
1174 520 1175 521
1966 1389 1967 1390
1151 326 1151 326
911 617 911 617
552 611 553 611
871 1413 871 1413
991 1711 992 1711
661 1651 662 1652
62 1638 63 1639
1243 121 1243 122
1011 1380 1012 1380
1634 1139 1635 113...

output:

120870
120871
120872
120873
120874
120875
120876
120877
120878
120879
120880
120881
120882
120883
120884
120885
120886
120887
120888
120889
120890
120891
120892
120893
120894
120895
120896
120897
120898
120899
120900
120901
120900
120901
120902
120903
120904
120905
120906
120907
120908
120909
120910...

result:

ok 5001 lines

Test #51:

score: 0
Accepted
time: 76ms
memory: 22076kb

input:

2000 100000 5000
9 1029 10 1032
184 803 187 803
1844 844 1847 845
105 1415 107 1416
1343 637 1346 637
108 1674 111 1675
1525 1383 1526 1387
690 1498 693 1499
1555 261 1559 264
1494 693 1495 695
104 1108 105 1112
516 1862 517 1862
673 1814 674 1814
1358 240 1360 243
124 1984 125 1988
130 279 134 283
...

output:

1819251
1819252
1819253
1819254
1819253
1819254
1819253
1819254
1819255
1819254
1819253
1819252
1819251
1819250
1819249
1819248
1819247
1819246
1819245
1819244
1819245
1819246
1819245
1819246
1819247
1819246
1819247
1819248
1819247
1819248
1819249
1819250
1819249
1819248
1819249
1819250
1819251
1819...

result:

ok 5001 lines

Test #52:

score: 0
Accepted
time: 76ms
memory: 22044kb

input:

1998 100000 5000
680 443 683 447
714 120 718 121
346 928 346 931
58 1256 61 1260
276 1717 279 1717
908 1118 912 1122
902 436 902 436
1385 147 1386 148
317 1488 319 1491
1729 1247 1730 1250
1023 1466 1027 1469
1183 1706 1186 1710
184 848 188 851
1041 33 1044 37
590 423 591 425
927 655 929 656
1790 17...

output:

1786815
1786816
1786817
1786818
1786817
1786816
1786815
1786816
1786815
1786816
1786815
1786814
1786815
1786814
1786815
1786816
1786817
1786816
1786815
1786816
1786817
1786818
1786817
1786818
1786819
1786820
1786819
1786820
1786819
1786818
1786817
1786818
1786819
1786820
1786819
1786820
1786821
1786...

result:

ok 5001 lines

Test #53:

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

input:

2000 2000 5000
135 327 153 327
136 1780 152 1780
85 1377 209 1377
135 1886 153 1886
137 429 150 429
136 1831 152 1831
127 995 170 995
136 1975 152 1975
128 571 170 571
137 1615 149 1615
135 193 152 193
134 772 157 772
127 1734 170 1734
135 515 154 515
122 1006 173 1006
2 1707 273 1707
136 783 152 78...

output:

231628
231629
231630
231631
231632
231633
231633
231634
231635
231634
231635
231636
231637
231638
231637
231638
231639
231640
231641
231642
231643
231644
231645
231646
231647
231648
231649
231650
231651
231652
231653
231654
231655
231656
231657
231658
231659
231660
231661
231661
231662
231663
231664...

result:

ok 5001 lines

Test #54:

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

input:

2000 2000 5000
346 1778 435 1778
342 1353 439 1353
387 1793 399 1793
387 1029 398 1029
368 138 415 138
344 277 435 277
387 971 400 971
373 558 409 558
387 1906 397 1906
385 684 400 684
374 1527 407 1527
371 485 414 485
281 1859 502 1859
375 1409 404 1409
372 1579 411 1579
387 713 400 713
341 1909 44...

output:

202881
202882
202883
202884
202885
202886
202886
202887
202888
202889
202890
202891
202892
202893
202894
202895
202896
202897
202898
202899
202900
202901
202902
202903
202904
202905
202906
202907
202908
202909
202910
202910
202911
202912
202913
202914
202915
202916
202917
202918
202919
202920
202921...

result:

ok 5001 lines

Subtask #5:

score: 0
Wrong Answer

Test #55:

score: 1
Accepted
time: 974ms
memory: 65372kb

input:

300000 300000 0
111286 8433 181522 208880
103975 18048 166307 265794
219191 206072 231168 244635
39203 31482 254123 175874
210327 170835 224455 174259
23607 115325 298465 184339
164969 165055 165512 245381
63858 179069 225059 289296
80109 35085 187602 236259
110496 211546 115434 226722
195501 118136...

output:

44999578196

result:

ok single line: '44999578196'

Test #56:

score: -1
Wrong Answer
time: 970ms
memory: 65368kb

input:

299998 299998 0
102929 141474 262240 275854
7086 16380 260617 159145
43899 146614 296374 286631
122612 67308 181921 136141
87968 47582 144236 87625
28575 135320 128152 151313
111824 42986 177512 291594
271524 63659 278281 80217
198670 28482 245550 209186
82312 15280 217306 25682
51535 169379 257124 ...

output:

45000216006

result:

wrong answer 1st lines differ - expected: '44998583998', found: '45000216006'

Subtask #6:

score: 0
Wrong Answer

Test #64:

score: 0
Wrong Answer
time: 982ms
memory: 65260kb

input:

299999 300000 0
84800 82432 177603 104711
157235 89546 257890 161794
78116 55592 83881 150522
35148 135687 129164 232070
28820 57482 225080 63117
29409 141975 167249 224302
198440 188133 240740 202788
20552 50405 137348 159766
167048 132287 297967 138665
72493 89918 294575 99642
166385 51782 260778 ...

output:

45000133912

result:

wrong answer 1st lines differ - expected: '44999266089', found: '45000133912'

Subtask #7:

score: 0
Wrong Answer

Test #73:

score: 1
Accepted
time: 71ms
memory: 22952kb

input:

6 100000 100000
1 1 6 2
3 1 5 5
2 3 2 5
1 3 6 3
1 6 3 6
2 4 4 4
3 2 5 2
1 3 2 4
2 2 2 4
3 2 5 6
1 2 2 5
3 3 4 5
5 2 5 6
5 1 6 5
1 1 4 2
1 5 6 6
5 1 6 6
2 5 3 5
6 1 6 2
4 5 5 5
1 1 5 3
1 1 6 2
1 1 3 3
1 2 6 4
1 5 4 6
5 1 6 2
2 1 3 6
1 2 3 6
1 2 2 3
1 2 6 4
1 3 5 6
1 1 6 2
2 4 5 5
1 3 5 4
2 1 3 1
2 1 ...

output:

16
17
18
17
18
17
18
17
16
15
14
15
16
17
16
17
18
17
18
17
18
17
18
17
18
17
16
15
14
15
16
17
18
17
18
17
16
17
16
15
16
15
14
15
14
15
16
15
16
17
18
17
18
17
18
17
16
17
16
15
16
15
14
13
14
13
14
15
14
15
16
15
14
15
16
17
16
17
18
17
18
17
16
15
16
15
16
15
14
15
16
15
14
15
16
15
16
17
16
15
...

result:

ok 100001 lines

Test #74:

score: 0
Accepted
time: 74ms
memory: 22704kb

input:

8 100000 99999
2 1 7 2
2 4 5 7
3 3 6 6
2 3 4 5
5 1 8 6
2 1 7 2
5 1 6 1
2 2 7 4
3 3 7 4
3 2 8 6
6 2 6 5
3 4 5 8
5 4 8 5
4 5 8 6
4 2 6 4
4 6 7 8
1 2 4 4
2 5 5 8
8 1 8 8
7 4 7 7
4 4 5 7
4 3 6 6
6 4 6 5
6 3 6 3
1 8 3 8
2 2 5 3
3 5 7 5
5 1 8 2
3 1 6 3
2 3 4 6
2 4 7 7
4 5 8 6
6 5 7 8
7 3 8 6
4 3 7 7
3 3 6...

output:

31
30
31
30
29
30
31
30
31
30
29
30
31
32
31
32
31
30
29
28
27
26
27
28
29
28
27
28
29
30
31
32
31
32
31
32
31
32
31
32
31
32
31
32
31
30
29
30
29
30
31
30
29
28
29
28
29
30
31
30
31
32
31
32
31
32
31
32
31
32
31
30
29
28
29
28
29
28
27
26
25
26
27
28
29
28
27
26
25
26
25
24
25
26
27
28
29
28
29
30
...

result:

ok 100000 lines

Test #75:

score: -1
Wrong Answer
time: 340ms
memory: 37228kb

input:

100000 99995 100000
28548 88222 50513 99778
10767 52833 72182 65632
41874 21183 77539 52474
35315 11585 63585 70632
22040 61978 98576 79712
24029 11410 60547 54197
42535 3014 51034 96911
14178 35071 16032 57621
6503 17763 85601 50948
23854 40696 55517 91138
22111 34809 48872 51336
14650 33202 21826 ...

output:

5000515328
5000515327
5000515328
5000515329
5000515328
5000515327
5000515326
5000515325
5000515324
5000515325
5000515324
5000515325
5000515326
5000515327
5000515326
5000515325
5000515326
5000515325
5000515324
5000515325
5000515326
5000515327
5000515328
5000515329
5000515330
5000515329
5000515330
500...

result:

wrong answer 1st lines differ - expected: '4999484672', found: '5000515328'

Subtask #8:

score: 1
Accepted

Subtask #9:

score: 0
Wrong Answer

Test #20:

score: 1
Accepted
time: 71ms
memory: 21428kb

input:

199 100000 10
66 75 161 177
38 20 189 35
69 134 128 179
35 62 83 72
72 130 77 152
47 38 182 92
17 18 156 193
25 42 132 77
21 36 44 185
17 28 122 44
38 3 168 65
174 29 192 110
29 39 51 127
12 156 188 191
18 9 167 63
74 40 87 71
33 30 163 126
90 72 116 98
39 22 63 35
12 64 121 75
28 51 139 92
5 3 20 3...

output:

19717
19718
19717
19716
19715
19714
19713
19712
19711
19712
19711

result:

ok 11 lines

Test #21:

score: 0
Accepted
time: 85ms
memory: 21676kb

input:

200 100000 10
70 20 119 132
33 34 197 69
11 88 167 172
18 11 193 195
2 10 148 186
17 142 131 184
56 44 169 51
123 93 185 176
4 58 111 96
2 75 197 78
143 16 195 108
7 48 199 90
25 85 154 172
119 31 199 137
44 38 199 193
3 49 192 111
140 35 182 114
86 1 131 179
79 55 167 137
77 26 174 138
35 2 167 172...

output:

19802
19803
19804
19803
19802
19803
19802
19803
19804
19805
19806

result:

ok 11 lines

Test #22:

score: 0
Accepted
time: 78ms
memory: 21728kb

input:

197 100000 10
36 34 184 110
53 118 194 139
48 5 174 181
133 138 178 194
156 65 169 90
5 75 164 137
95 56 163 153
67 83 77 97
29 65 114 102
119 107 124 111
38 63 164 113
48 49 122 126
146 53 165 193
9 19 179 44
74 15 109 22
103 68 186 175
31 141 35 184
79 62 195 115
126 106 147 132
133 98 195 166
119...

output:

8223
8224
8224
8225
8226
8226
8226
8226
8227
8227
8228

result:

ok 11 lines

Test #23:

score: 0
Accepted
time: 84ms
memory: 21696kb

input:

199 100000 10
54 81 191 178
1 52 139 166
119 130 144 194
12 49 144 115
61 70 192 132
15 7 123 186
42 20 118 73
132 7 139 159
177 29 191 194
25 102 29 123
44 48 131 192
127 96 166 158
1 100 25 143
17 94 99 179
83 27 130 137
21 57 192 157
94 20 154 145
16 28 46 151
38 105 113 183
111 37 191 193
66 76 ...

output:

10285
10286
10287
10288
10289
10290
10291
10292
10292
10293
10293

result:

ok 11 lines

Test #24:

score: 0
Accepted
time: 47ms
memory: 22188kb

input:

196 99998 10
183 77 184 78
181 92 182 93
157 112 158 113
165 39 166 40
79 147 79 148
11 15 11 15
140 8 141 9
125 107 126 108
27 154 28 155
177 113 177 113
109 70 110 70
114 64 114 64
146 1 146 1
82 15 82 16
116 30 116 31
135 49 136 49
49 133 49 134
81 34 82 34
185 59 186 59
128 5 128 6
33 159 33 160...

output:

19032
19033
19032
19033
19032
19031
19030
19031
19032
19031
19032

result:

ok 11 lines

Test #25:

score: 0
Accepted
time: 54ms
memory: 21688kb

input:

200 99999 10
80 19 81 19
51 196 51 196
149 34 149 34
6 57 6 58
43 195 44 196
145 119 146 120
25 82 25 83
169 164 170 165
3 86 3 86
83 141 84 142
51 68 52 68
17 143 18 144
63 47 63 48
195 185 195 185
150 120 150 120
27 137 27 138
7 35 7 35
197 131 197 132
125 159 125 159
191 65 191 66
158 118 159 118...

output:

19789
19790
19791
19790
19791
19790
19789
19788
19789
19790
19791

result:

ok 11 lines

Test #26:

score: 0
Accepted
time: 63ms
memory: 21992kb

input:

199 100000 10
191 5 194 5
137 61 141 64
91 46 94 50
50 47 54 49
62 61 65 62
175 12 175 13
52 44 55 44
150 38 150 39
176 44 176 46
90 118 91 120
112 142 114 146
155 164 158 165
111 178 113 182
66 81 67 84
114 2 116 4
88 179 88 180
61 166 62 167
106 65 107 67
149 50 151 52
45 135 47 138
48 126 52 130
...

output:

19798
19797
19798
19799
19800
19800
19800
19799
19800
19799
19798

result:

ok 11 lines

Test #27:

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

input:

200 200 10
134 164 183 164
146 106 159 106
149 148 156 148
146 185 160 185
135 86 180 86
142 184 167 184
148 190 156 190
142 80 163 80
148 155 156 155
148 54 156 54
146 60 159 60
148 7 157 7
144 192 161 192
149 178 156 178
10 85 200 85
137 195 174 195
142 10 162 10
138 16 173 16
135 145 179 145
148 ...

output:

7086
7087
7086
7087
7088
7089
7090
7091
7092
7091
7092

result:

ok 11 lines

Test #28:

score: 0
Accepted
time: 82ms
memory: 21852kb

input:

198 100000 10
61 12 104 104
33 77 82 181
27 26 120 122
46 6 100 127
172 90 190 144
152 73 156 79
6 140 162 196
38 10 64 80
66 112 97 114
38 55 96 160
121 91 192 189
26 160 124 160
41 34 97 131
17 79 170 133
118 75 146 122
168 24 173 53
65 72 72 182
56 64 69 78
172 17 198 97
67 103 163 115
24 84 71 1...

output:

19572
19571
19570
19571
19572
19571
19572
19571
19572
19573
19574

result:

ok 11 lines

Test #29:

score: 0
Accepted
time: 66ms
memory: 21752kb

input:

200 100000 10
16 86 117 173
118 6 133 188
7 116 177 199
10 59 179 199
2 120 145 128
32 63 150 185
46 31 160 147
124 3 172 182
13 20 132 163
18 10 171 182
104 17 179 199
14 83 198 112
117 125 180 150
43 124 148 177
147 6 189 187
33 15 192 77
11 44 168 191
68 91 75 145
29 3 195 117
4 5 127 181
109 12 ...

output:

19893
19892
19893
19892
19891
19892
19893
19894
19895
19894
19895

result:

ok 11 lines

Test #30:

score: 0
Accepted
time: 83ms
memory: 21556kb

input:

195 99997 10
46 43 69 150
163 5 188 143
15 40 111 186
5 10 150 193
83 127 156 137
86 90 109 190
6 63 175 133
8 66 188 189
143 68 178 183
79 82 138 111
42 83 177 91
11 12 80 194
34 12 61 172
37 54 166 188
10 26 168 136
78 11 82 186
129 20 142 121
105 7 192 83
13 12 195 186
46 11 184 138
104 38 170 16...

output:

18794
18793
18794
18793
18792
18793
18792
18791
18792
18793
18794

result:

ok 11 lines

Test #31:

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

input:

200 100000 10
31 105 195 145
93 127 182 144
28 133 144 163
17 140 84 171
38 29 185 136
19 46 55 126
68 7 91 133
83 98 171 184
35 94 183 161
175 50 199 129
44 78 151 133
110 71 167 172
111 49 180 169
50 84 161 100
87 63 195 73
57 64 91 156
11 99 105 180
36 88 94 187
93 116 137 169
6 174 134 174
42 15...

output:

13845
13846
13846
13847
13848
13848
13848
13848
13848
13849
13849

result:

ok 11 lines

Test #32:

score: 0
Accepted
time: 87ms
memory: 21832kb

input:

198 99996 10
48 45 128 86
17 61 141 145
92 50 140 151
124 21 167 157
102 13 182 172
81 69 173 130
62 93 146 197
28 25 39 150
22 73 118 147
15 13 125 44
21 50 82 180
26 69 53 119
21 22 114 59
57 63 82 172
115 51 193 172
40 26 190 95
106 112 172 189
3 48 120 120
134 16 172 132
18 5 191 89
77 11 142 65...

output:

8964
8964
8964
8965
8966
8967
8968
8969
8970
8971
8971

result:

ok 11 lines

Test #33:

score: 0
Accepted
time: 46ms
memory: 21912kb

input:

199 99996 10
153 175 153 175
142 47 142 47
3 89 3 89
151 88 151 88
100 195 100 195
179 14 180 14
22 77 23 77
121 148 121 149
28 71 29 71
132 53 133 54
14 28 14 29
52 113 52 114
117 60 118 61
174 146 174 146
54 168 54 168
72 40 72 41
138 45 138 45
101 68 101 68
26 120 27 120
109 137 109 137
30 69 31 ...

output:

19773
19774
19773
19774
19775
19776
19777
19778
19779
19780
19781

result:

ok 11 lines

Test #34:

score: 0
Accepted
time: 57ms
memory: 21572kb

input:

200 99998 10
184 24 184 24
96 2 97 3
99 176 100 177
80 79 80 80
78 24 79 24
77 158 78 158
85 90 86 91
112 69 113 69
50 107 51 107
6 29 7 29
170 65 170 65
17 164 18 164
129 77 129 77
188 197 189 197
83 91 84 91
180 14 180 15
171 55 171 55
47 5 47 5
122 59 122 60
9 33 9 33
175 145 176 145
185 83 186 8...

output:

19866
19867
19866
19867
19868
19867
19868
19867
19866
19865
19866

result:

ok 11 lines

Test #35:

score: 0
Accepted
time: 52ms
memory: 21944kb

input:

200 100000 10
175 91 177 95
177 88 181 91
34 45 35 49
76 161 80 164
142 195 145 197
174 55 178 59
76 44 80 46
88 165 89 165
140 178 143 182
82 110 86 111
83 161 85 163
79 153 82 154
12 44 13 45
101 77 101 81
177 194 179 198
7 25 8 25
66 98 69 101
41 96 44 98
40 124 43 125
42 120 43 121
113 100 116 1...

output:

19820
19819
19818
19817
19816
19817
19818
19819
19818
19819
19820

result:

ok 11 lines

Test #36:

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

input:

197 200 10
126 48 126 53
9 49 9 52
156 30 156 71
124 41 124 57
148 40 148 60
195 48 195 52
29 1 29 106
85 38 85 64
49 47 49 53
121 25 121 76
145 1 145 102
151 49 151 52
96 40 96 62
20 41 20 57
40 27 40 73
131 40 131 63
109 31 109 71
13 48 13 53
1 38 1 67
122 32 122 70
37 41 37 56
118 1 118 197
117 4...

output:

7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966

result:

ok 11 lines

Test #37:

score: 0
Accepted
time: 117ms
memory: 22060kb

input:

1998 100000 4996
775 369 991 1761
1602 537 1960 1167
361 1256 1522 1569
261 322 1165 1934
39 286 1996 1996
260 994 1739 1651
600 1043 1368 1593
679 1167 1481 1338
149 21 959 1234
1096 348 1965 1246
1827 933 1834 1443
418 341 490 637
76 518 1974 1492
385 1501 390 1608
153 353 1689 459
1451 402 1549 1...

output:

1995864
1995863
1995862
1995863
1995864
1995863
1995864
1995863
1995862
1995863
1995864
1995865
1995864
1995865
1995866
1995865
1995864
1995863
1995864
1995863
1995862
1995863
1995864
1995863
1995862
1995863
1995862
1995863
1995862
1995861
1995860
1995861
1995860
1995859
1995858
1995857
1995856
1995...

result:

ok 4997 lines

Test #38:

score: 0
Accepted
time: 122ms
memory: 22024kb

input:

2000 100000 4998
16 682 230 1431
491 196 1355 1519
511 285 730 1688
1193 693 1970 898
217 24 772 488
151 1004 1357 1329
586 674 1426 1141
420 743 1072 1747
144 732 479 965
676 24 1803 930
65 578 1966 774
91 1537 1768 1804
693 1060 1675 1291
775 257 1775 1479
255 234 763 866
1 1269 758 1805
194 236 2...

output:

1999850
1999849
1999850
1999851
1999852
1999853
1999852
1999851
1999852
1999853
1999852
1999851
1999852
1999853
1999854
1999855
1999854
1999853
1999852
1999853
1999854
1999855
1999854
1999855
1999854
1999853
1999854
1999855
1999856
1999855
1999854
1999853
1999852
1999851
1999852
1999853
1999852
1999...

result:

ok 4999 lines

Test #39:

score: 0
Accepted
time: 112ms
memory: 21956kb

input:

2000 100000 5000
71 166 788 503
1461 1031 1521 1851
17 17 1977 148
122 1521 806 1700
583 1438 1133 1504
1127 478 1190 849
371 894 549 1967
7 135 693 1086
155 478 1123 798
203 1451 1433 1948
32 924 619 1767
119 496 535 1777
47 506 366 1714
781 637 1338 1878
309 444 1300 1974
147 755 1788 1976
1245 55...

output:

1999300
1999301
1999302
1999301
1999300
1999301
1999300
1999299
1999298
1999297
1999298
1999297
1999296
1999295
1999294
1999295
1999294
1999293
1999294
1999295
1999296
1999295
1999294
1999295
1999294
1999293
1999292
1999291
1999290
1999289
1999288
1999287
1999286
1999287
1999286
1999287
1999286
1999...

result:

ok 5001 lines

Test #40:

score: 0
Accepted
time: 120ms
memory: 22476kb

input:

2000 100000 5000
471 898 1154 1562
165 1275 1527 1492
454 566 1978 1692
30 502 1703 1918
374 380 1617 562
265 989 1758 1529
806 261 1943 1252
256 79 360 1717
178 126 1987 1854
548 175 1981 1946
455 401 1157 1762
262 105 1460 514
854 667 1053 1783
227 421 746 1361
613 118 1314 1399
303 202 1995 379
7...

output:

1999203
1999204
1999203
1999202
1999201
1999200
1999201
1999202
1999201
1999200
1999201
1999202
1999203
1999204
1999205
1999206
1999207
1999208
1999209
1999208
1999209
1999210
1999211
1999212
1999211
1999212
1999213
1999212
1999211
1999212
1999211
1999212
1999211
1999210
1999209
1999210
1999211
1999...

result:

ok 5001 lines

Test #41:

score: 0
Accepted
time: 148ms
memory: 22460kb

input:

2000 100000 5000
1156 723 1376 1366
46 522 1943 1861
1059 733 1878 1569
129 1141 1908 1978
590 146 1744 984
16 584 1338 1506
466 257 1066 760
402 896 470 1910
769 1119 1418 1955
53 675 1585 1974
520 1411 1749 1792
847 124 1787 1817
193 658 1402 1429
79 496 1531 996
1798 104 1935 1636
95 1418 1989 18...

output:

1999333
1999332
1999333
1999334
1999335
1999336
1999337
1999338
1999339
1999338
1999337
1999336
1999337
1999338
1999339
1999338
1999339
1999338
1999337
1999336
1999335
1999334
1999333
1999334
1999335
1999336
1999335
1999336
1999337
1999336
1999337
1999338
1999337
1999336
1999335
1999336
1999337
1999...

result:

ok 5001 lines

Test #42:

score: 0
Accepted
time: 134ms
memory: 22336kb

input:

1998 100000 5000
118 51 1704 1117
209 129 1922 1898
483 357 1982 1769
5 136 1545 1701
227 954 1851 1713
36 332 1782 1631
43 1360 1816 1486
519 388 1597 1214
817 257 881 1150
11 56 1835 1181
136 142 1753 1417
1075 577 1893 1974
38 5 1839 1715
25 996 489 1326
95 888 1132 1647
25 1439 1987 1782
1062 39...

output:

1995146
1995145
1995144
1995143
1995142
1995141
1995142
1995143
1995144
1995145
1995146
1995147
1995148
1995149
1995148
1995147
1995146
1995147
1995146
1995147
1995148
1995147
1995148
1995147
1995148
1995149
1995148
1995147
1995148
1995147
1995148
1995149
1995148
1995149
1995148
1995147
1995146
1995...

result:

ok 5001 lines

Test #43:

score: 0
Accepted
time: 103ms
memory: 22408kb

input:

1998 100000 4997
1379 880 1630 1549
119 731 1645 1876
1272 414 1858 1877
998 17 1449 1519
406 1567 1822 1801
512 1122 1025 1795
640 262 1758 1676
1651 246 1889 1603
672 300 1235 505
307 191 1866 1050
156 80 1131 1574
1116 1789 1703 1820
582 363 660 1522
336 882 1676 1973
860 653 1804 701
194 270 751...

output:

1363868
1363869
1363870
1363870
1363871
1363872
1363873
1363874
1363875
1363876
1363877
1363878
1363878
1363878
1363878
1363878
1363878
1363879
1363880
1363881
1363881
1363882
1363882
1363883
1363883
1363884
1363885
1363886
1363887
1363887
1363888
1363889
1363889
1363889
1363889
1363890
1363891
1363...

result:

ok 4998 lines

Test #44:

score: 0
Accepted
time: 113ms
memory: 22348kb

input:

1997 100000 5000
706 991 1623 1395
684 834 1194 1819
564 283 1038 977
483 888 1472 1562
239 604 630 805
882 136 1954 1129
278 357 1770 882
470 1575 1365 1833
235 164 1657 1660
610 1357 1759 1870
1074 1010 1335 1792
6 1634 1772 1658
667 1465 1458 1729
1539 1611 1872 1639
57 1141 1053 1976
32 524 328 ...

output:

1243234
1243235
1243236
1243236
1243237
1243237
1243238
1243239
1243239
1243240
1243241
1243241
1243242
1243243
1243243
1243244
1243244
1243245
1243246
1243246
1243246
1243246
1243247
1243247
1243248
1243248
1243249
1243250
1243251
1243252
1243253
1243254
1243255
1243256
1243257
1243258
1243259
1243...

result:

ok 5001 lines

Test #45:

score: 0
Accepted
time: 112ms
memory: 22276kb

input:

1996 100000 5000
663 1036 1106 1416
335 968 1442 1649
794 189 1126 1835
254 169 488 616
233 536 1046 1804
453 139 1805 293
592 371 977 1714
1474 499 1533 1666
1055 109 1358 695
156 1349 1329 1699
166 151 1728 565
275 1858 836 1969
536 257 1414 662
53 1217 1597 1848
430 605 1441 1762
34 1472 1988 180...

output:

1034408
1034409
1034410
1034411
1034411
1034412
1034412
1034413
1034414
1034415
1034416
1034417
1034418
1034419
1034420
1034421
1034422
1034423
1034424
1034424
1034425
1034426
1034426
1034427
1034427
1034428
1034429
1034430
1034431
1034431
1034432
1034432
1034433
1034434
1034435
1034436
1034437
1034...

result:

ok 5001 lines

Test #46:

score: 0
Accepted
time: 112ms
memory: 22268kb

input:

1996 99997 5000
397 1167 590 1351
736 594 1713 1103
62 1679 450 1690
838 90 1790 1249
452 1871 1205 1955
330 2 651 476
343 313 1719 1292
1529 77 1716 535
109 163 308 1836
379 348 1663 954
1059 85 1124 1589
140 591 1388 1863
1032 677 1877 1471
1324 282 1554 1598
251 441 1672 1514
741 133 825 1605
832...

output:

818387
818388
818388
818389
818389
818390
818391
818392
818393
818394
818394
818394
818395
818395
818396
818396
818397
818398
818399
818399
818400
818401
818402
818403
818404
818405
818406
818407
818408
818409
818410
818411
818412
818412
818413
818414
818415
818416
818416
818417
818418
818419
818420...

result:

ok 5001 lines

Test #47:

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

input:

1996 700 5000
42 681 225 857
1817 1217 1818 1217
1342 1920 1343 1921
42 1 1305 1995
38 6 39 7
35 679 1772 759
35 681 1772 857
796 120 1119 1852
41 1180 799 1358
1107 1835 1108 1835
772 1297 773 1297
225 218 368 1433
132 753 820 1853
41 1798 799 1865
9 216 9 217
225 159 368 643
66 749 1134 755
792 12...

output:

229558
229559
229560
229561
229562
229563
229564
229565
229566
229567
229568
229569
229570
229571
229572
229573
229574
229575
229576
229577
229578
229579
229580
229581
229582
229583
229584
229585
229586
229587
229588
229589
229590
229591
229592
229593
229594
229595
229596
229597
229598
229599
229600...

result:

ok 5001 lines

Test #48:

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

input:

1996 697 5000
291 520 292 521
1100 494 1101 495
210 625 1118 1801
238 1817 404 1821
1913 1098 1914 1098
199 262 199 262
639 344 639 344
609 377 1610 896
237 1018 1117 1386
1582 998 1582 999
89 650 604 1564
730 161 731 162
1207 1194 1208 1194
94 1195 957 1256
875 1906 876 1907
94 377 957 896
926 1838...

output:

217225
217226
217227
217228
217228
217229
217230
217231
217232
217233
217234
217235
217236
217237
217238
217239
217240
217241
217242
217243
217244
217245
217246
217247
217248
217249
217250
217251
217252
217253
217254
217255
217255
217256
217257
217258
217259
217260
217261
217262
217263
217264
217265...

result:

ok 5001 lines

Test #49:

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

input:

2000 97 5000
183 488 183 489
344 599 345 600
929 1521 930 1521
742 1588 742 1589
1046 1323 1047 1324
1359 586 1360 586
359 411 360 412
933 1096 934 1096
1503 1388 1503 1389
1992 96 1992 97
535 1406 536 1406
1606 632 1606 632
1526 1940 1527 1941
1660 1798 1661 1798
1607 186 1608 186
1638 275 1639 275...

output:

119192
119193
119194
119195
119196
119197
119198
119199
119200
119201
119202
119203
119204
119205
119206
119207
119208
119209
119210
119211
119212
119213
119214
119215
119216
119217
119218
119219
119220
119221
119222
119223
119222
119223
119224
119225
119226
119227
119226
119227
119228
119229
119230...

result:

ok 5001 lines

Test #50:

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

input:

1996 100 5000
1375 1591 1375 1591
1487 1804 1487 1805
232 2 1036 1996
766 347 766 348
1174 520 1175 521
1966 1389 1967 1390
1151 326 1151 326
911 617 911 617
552 611 553 611
871 1413 871 1413
991 1711 992 1711
661 1651 662 1652
62 1638 63 1639
1243 121 1243 122
1011 1380 1012 1380
1634 1139 1635 113...

output:

120870
120871
120872
120873
120874
120875
120876
120877
120878
120879
120880
120881
120882
120883
120884
120885
120886
120887
120888
120889
120890
120891
120892
120893
120894
120895
120896
120897
120898
120899
120900
120901
120900
120901
120902
120903
120904
120905
120906
120907
120908
120909
120910...

result:

ok 5001 lines

Test #51:

score: 0
Accepted
time: 81ms
memory: 22048kb

input:

2000 100000 5000
9 1029 10 1032
184 803 187 803
1844 844 1847 845
105 1415 107 1416
1343 637 1346 637
108 1674 111 1675
1525 1383 1526 1387
690 1498 693 1499
1555 261 1559 264
1494 693 1495 695
104 1108 105 1112
516 1862 517 1862
673 1814 674 1814
1358 240 1360 243
124 1984 125 1988
130 279 134 283
...

output:

1819251
1819252
1819253
1819254
1819253
1819254
1819253
1819254
1819255
1819254
1819253
1819252
1819251
1819250
1819249
1819248
1819247
1819246
1819245
1819244
1819245
1819246
1819245
1819246
1819247
1819246
1819247
1819248
1819247
1819248
1819249
1819250
1819249
1819248
1819249
1819250
1819251
1819...

result:

ok 5001 lines

Test #52:

score: 0
Accepted
time: 83ms
memory: 22116kb

input:

1998 100000 5000
680 443 683 447
714 120 718 121
346 928 346 931
58 1256 61 1260
276 1717 279 1717
908 1118 912 1122
902 436 902 436
1385 147 1386 148
317 1488 319 1491
1729 1247 1730 1250
1023 1466 1027 1469
1183 1706 1186 1710
184 848 188 851
1041 33 1044 37
590 423 591 425
927 655 929 656
1790 17...

output:

1786815
1786816
1786817
1786818
1786817
1786816
1786815
1786816
1786815
1786816
1786815
1786814
1786815
1786814
1786815
1786816
1786817
1786816
1786815
1786816
1786817
1786818
1786817
1786818
1786819
1786820
1786819
1786820
1786819
1786818
1786817
1786818
1786819
1786820
1786819
1786820
1786821
1786...

result:

ok 5001 lines

Test #53:

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

input:

2000 2000 5000
135 327 153 327
136 1780 152 1780
85 1377 209 1377
135 1886 153 1886
137 429 150 429
136 1831 152 1831
127 995 170 995
136 1975 152 1975
128 571 170 571
137 1615 149 1615
135 193 152 193
134 772 157 772
127 1734 170 1734
135 515 154 515
122 1006 173 1006
2 1707 273 1707
136 783 152 78...

output:

231628
231629
231630
231631
231632
231633
231633
231634
231635
231634
231635
231636
231637
231638
231637
231638
231639
231640
231641
231642
231643
231644
231645
231646
231647
231648
231649
231650
231651
231652
231653
231654
231655
231656
231657
231658
231659
231660
231661
231661
231662
231663
231664...

result:

ok 5001 lines

Test #54:

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

input:

2000 2000 5000
346 1778 435 1778
342 1353 439 1353
387 1793 399 1793
387 1029 398 1029
368 138 415 138
344 277 435 277
387 971 400 971
373 558 409 558
387 1906 397 1906
385 684 400 684
374 1527 407 1527
371 485 414 485
281 1859 502 1859
375 1409 404 1409
372 1579 411 1579
387 713 400 713
341 1909 44...

output:

202881
202882
202883
202884
202885
202886
202886
202887
202888
202889
202890
202891
202892
202893
202894
202895
202896
202897
202898
202899
202900
202901
202902
202903
202904
202905
202906
202907
202908
202909
202910
202910
202911
202912
202913
202914
202915
202916
202917
202918
202919
202920
202921...

result:

ok 5001 lines

Test #55:

score: 0
Accepted
time: 954ms
memory: 65304kb

input:

300000 300000 0
111286 8433 181522 208880
103975 18048 166307 265794
219191 206072 231168 244635
39203 31482 254123 175874
210327 170835 224455 174259
23607 115325 298465 184339
164969 165055 165512 245381
63858 179069 225059 289296
80109 35085 187602 236259
110496 211546 115434 226722
195501 118136...

output:

44999578196

result:

ok single line: '44999578196'

Test #56:

score: -1
Wrong Answer
time: 923ms
memory: 65300kb

input:

299998 299998 0
102929 141474 262240 275854
7086 16380 260617 159145
43899 146614 296374 286631
122612 67308 181921 136141
87968 47582 144236 87625
28575 135320 128152 151313
111824 42986 177512 291594
271524 63659 278281 80217
198670 28482 245550 209186
82312 15280 217306 25682
51535 169379 257124 ...

output:

45000216006

result:

wrong answer 1st lines differ - expected: '44998583998', found: '45000216006'

Subtask #10:

score: 0
Wrong Answer

Test #129:

score: 1
Accepted
time: 220ms
memory: 32392kb

input:

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

output:

50
49
48
47
48
49
50
49
50
49
48
49
48
49
50
49
48
47
48
49
50
49
50
49
48
49
50
49
50
49
50
49
50
49
48
47
48
47
48
49
50
49
48
49
50
49
48
49
48
47
48
47
48
49
48
47
48
47
46
47
48
47
46
47
48
49
50
49
50
49
48
47
48
49
50
49
50
49
48
47
46
45
44
45
46
47
48
49
50
49
50
49
50
49
50
49
48
49
48
47
...

result:

ok 300001 lines

Test #130:

score: 0
Accepted
time: 1381ms
memory: 82928kb

input:

300000 299996 300000
65484 66615 161428 292998
145384 62573 247732 95643
59372 226897 225901 295683
35261 79744 83642 163383
25226 197470 213808 246241
187233 93275 260770 249652
19598 30641 137882 143252
12354 25402 217331 32646
130422 10096 286238 69277
159070 5442 248329 259882
51548 56843 289380...

output:

44999828986
44999828985
44999828984
44999828985
44999828984
44999828985
44999828986
44999828985
44999828984
44999828983
44999828984
44999828983
44999828982
44999828983
44999828982
44999828983
44999828984
44999828985
44999828984
44999828985
44999828984
44999828985
44999828984
44999828985
44999828984
...

result:

ok 300001 lines

Test #131:

score: 0
Accepted
time: 1335ms
memory: 83100kb

input:

299995 300000 300000
113628 184742 250596 198266
188300 17571 205361 124223
116512 130965 242678 149910
148458 35858 265364 139647
18191 114958 29084 174945
92017 5462 289027 169781
103407 187249 211200 215044
25761 11306 215649 100089
79236 95835 200596 96891
91565 244328 130879 276247
80953 79092 ...

output:

44997817243
44997817244
44997817245
44997817246
44997817245
44997817246
44997817245
44997817244
44997817245
44997817244
44997817245
44997817246
44997817245
44997817244
44997817243
44997817242
44997817243
44997817244
44997817243
44997817244
44997817245
44997817246
44997817247
44997817248
44997817249
...

result:

ok 300001 lines

Test #132:

score: 0
Accepted
time: 1369ms
memory: 82576kb

input:

299998 300000 299999
143542 75250 171239 127017
81151 44435 251116 178019
14105 49942 298384 272461
145945 53299 290320 244838
6268 173671 142310 196876
97082 7132 229501 280106
134191 71561 292526 288074
14973 28239 216607 299266
79337 38874 91790 287607
92265 10609 278565 295007
5032 25323 289408 ...

output:

44999190253
44999190254
44999190255
44999190254
44999190253
44999190254
44999190253
44999190254
44999190255
44999190254
44999190255
44999190256
44999190255
44999190256
44999190257
44999190256
44999190255
44999190256
44999190257
44999190258
44999190257
44999190256
44999190257
44999190256
44999190257
...

result:

ok 300000 lines

Test #133:

score: -1
Wrong Answer
time: 1110ms
memory: 79740kb

input:

299998 299998 300000
104379 84398 185158 169340
201752 34577 211062 175936
54080 127978 266776 247622
132074 16679 283450 151380
120571 55509 228930 241508
221012 67086 261044 81267
26247 62870 31750 187333
260150 68395 269469 226560
12584 64014 171167 201011
19591 23294 189588 186503
74641 189781 1...

output:

65312150393
65312150392
65312150393
65312150392
65312150391
65312150392
65312150393
65312150392
65312150391
65312150392
65312150391
65312150390
65312150391
65312150392
65312150391
65312150390
65312150389
65312150390
65312150389
65312150388
65312150387
65312150386
65312150385
65312150384
65312150383
...

result:

wrong answer 1st lines differ - expected: '22854076011', found: '65312150393'