QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#330012#6537. One, Two, ThreeLittle09AC ✓116ms28924kbC++173.0kb2024-02-17 10:41:492024-02-17 10:41:50

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 15980kb

input:

6
3 1 2 2 3 1

output:

2
1 2 4
0 3 5

result:

ok count=2

Test #2:

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

input:

6
2 1 3 1 3 2

output:

0

result:

ok count=0

Test #3:

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

input:

3000
1 1 1 1 1 3 1 1 3 3 1 3 1 1 2 3 1 1 2 1 2 1 3 3 3 1 1 2 1 2 2 3 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 3 3 1 1 2 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 2 3 1 1 1 1 3 3 2 1 3 1 1 2 3 1 2 3 1 1 1 2 1 1 1 1 2 3 2 1 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 3 1 3 3 1 1 1 1 3 1 1 2 1 1 1 3 3 1 1 1 1 2 1 1 1 1 1 2 3 3 1...

output:

499
5 14 2313
8 18 2314
9 20 2318
11 27 2320
15 29 2321
22 30 2323
23 39 2324
24 46 2325
31 51 2326
47 54 2327
48 60 2328
72 79 2329
77 84 2330
78 87 2331
81 92 2332
85 97 2333
88 99 2334
98 105 2335
117 128 2336
119 138 2337
120 144 2338
125 148 2339
132 162 2341
133 167 2347
145 168 2348
146 176 2...

result:

ok count=499

Test #4:

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

input:

3000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

1
0 1374 2901

result:

ok count=1

Test #5:

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

input:

3000
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 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:

1
1755 1756 2819

result:

ok count=1

Test #6:

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

input:

1500
1 1 1 2 1 1 1 2 2 2 2 2 1 1 3 1 2 2 3 1 2 2 2 2 1 2 1 2 1 1 3 1 2 2 2 2 1 1 3 1 1 2 2 3 2 1 3 1 1 2 2 2 1 2 2 2 2 2 1 2 3 2 3 2 3 2 1 3 2 1 2 3 2 2 3 2 3 1 1 3 1 3 1 3 3 3 1 3 3 3 1 1 3 1 3 1 3 1 1 1 3 1 3 1 3 3 1 1 1 3 1 1 3 1 1 1 1 1 3 3 3 3 1 3 1 1 1 1 3 3 3 3 3 3 1 3 1 1 1 3 1 3 1 1 1 1 3 1...

output:

500
0 3 530
1 7 532
2 8 533
4 9 534
5 10 536
6 11 537
12 16 542
13 17 544
15 20 545
19 21 547
24 25 550
14 22 552
18 23 553
26 27 554
30 32 555
38 41 556
28 33 557
29 34 558
31 35 559
43 44 560
46 49 561
60 61 562
36 42 563
37 50 564
62 63 565
39 51 566
64 65 567
67 68 568
71 72 569
40 53 570
74 75 ...

result:

ok count=500

Test #7:

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

input:

3000
3 1 1 1 1 3 3 2 1 1 1 2 3 1 3 3 3 3 1 1 3 1 3 3 1 1 1 1 1 3 3 1 1 1 1 3 1 3 1 1 3 3 3 3 1 3 1 3 1 3 1 3 1 1 1 3 3 1 3 1 1 1 3 1 3 3 3 3 1 1 1 1 3 1 1 1 3 3 1 2 3 3 1 3 3 3 3 3 3 3 1 1 1 1 3 1 3 1 3 3 3 3 1 3 1 1 3 3 1 1 1 3 3 1 3 3 1 3 1 3 1 3 2 3 1 3 1 1 3 1 1 1 3 3 1 1 3 3 2 2 2 2 2 2 2 2 2 2...

output:

1000
0 7 1887
1 11 1888
5 79 1889
2 122 1890
6 138 1891
3 139 1892
4 140 1893
8 141 1894
9 142 1895
12 143 1896
10 144 1897
14 145 1899
13 146 1900
18 147 1901
19 148 1902
21 149 1903
15 150 1904
16 151 1905
24 152 1906
25 153 1907
17 154 1908
20 155 1909
22 156 1910
26 157 1911
23 158 1912
27 159 1...

result:

ok count=1000

Test #8:

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

input:

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

output:

1000
1 31 1598
4 32 1600
9 41 1606
12 51 1609
16 52 1610
17 53 1611
18 54 1617
19 55 1619
20 56 1621
23 57 1622
26 58 1623
28 59 1624
29 60 1627
33 61 1630
0 62 1632
2 63 1633
3 64 1634
5 65 1635
35 66 1636
6 67 1637
36 68 1638
37 69 1639
39 70 1640
7 71 1641
40 72 1642
42 73 1643
45 74 1644
46 75 1...

result:

ok count=1000

Test #9:

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

input:

2997
3 1 2 2 1 1 1 1 1 1 3 1 3 3 1 3 3 3 1 3 1 2 1 1 3 1 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 3 3 1 1 3 1 3 1 1 3 3 1 3 1 3 3 3 1 1 1 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 1 3 1 1 1 1 1 3 3 3 1 3 1 1 3 3 3 1 3 3 1 1 1 3 1 1 3 1 1 3 2 3 3 3 2 3 2 3 1 2 1 1 3 1 1 3 2 2 2 2...

output:

999
0 2 1213
10 21 1215
12 26 1216
13 27 1217
15 30 1218
16 31 1220
1 3 1221
17 32 1222
4 33 1223
5 34 1224
6 35 1225
19 36 1226
7 37 1227
24 38 1228
8 39 1229
9 40 1230
11 41 1231
51 73 1232
52 74 1233
14 42 1234
18 43 1235
20 44 1236
22 45 1237
55 75 1238
57 76 1239
60 77 1240
61 78 1241
23 46 124...

result:

ok count=999

Test #10:

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

input:

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

output:

998
0 2 1925
8 18 1926
1 4 1927
3 6 1928
5 7 1929
9 31 1930
14 39 1931
16 49 1932
17 51 1933
10 59 1934
11 61 1935
21 62 1936
26 63 1937
12 64 1938
27 65 1939
13 66 1940
28 67 1941
15 68 1942
19 69 1943
33 70 1944
35 71 1945
20 72 1946
22 73 1947
23 74 1948
38 75 1949
41 76 1950
24 77 1951
45 78 195...

result:

ok count=998

Test #11:

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

input:

3000
1 1 1 3 2 3 2 3 1 1 1 1 2 3 1 2 1 2 1 3 3 2 2 3 3 2 3 2 2 3 3 3 3 3 1 3 2 1 2 3 2 3 3 3 2 1 3 3 3 2 1 1 1 1 2 1 3 1 3 2 2 2 1 2 3 3 3 2 1 3 1 3 2 3 1 3 2 3 3 1 2 1 2 2 3 1 3 2 2 1 1 2 3 1 1 3 1 3 2 2 3 2 2 1 3 2 2 2 3 3 2 3 1 2 2 1 1 1 2 3 2 1 3 2 1 1 1 3 3 1 3 1 3 2 2 1 1 1 1 2 1 2 3 1 2 1 2 2...

output:

1000
3 4 125
5 6 126
7 12 129
13 15 131
19 21 135
20 22 136
23 25 137
24 27 138
26 28 140
29 36 143
30 38 145
31 40 148
32 44 152
33 49 153
35 54 155
39 59 157
41 60 162
42 61 163
43 63 164
46 67 167
47 72 172
48 76 175
56 80 176
58 82 177
64 83 180
65 87 184
66 88 187
69 91 188
71 98 191
73 99 207
...

result:

ok count=1000

Test #12:

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

input:

3000
2 2 1 3 2 2 2 3 2 2 2 2 2 1 2 2 2 2 2 1 3 2 2 2 2 3 2 2 2 2 2 2 1 3 2 2 2 2 2 2 2 2 2 2 1 3 2 2 2 1 2 3 2 3 1 2 2 3 2 3 2 2 2 1 2 2 2 2 2 2 2 2 2 1 2 2 3 2 2 1 2 3 2 1 3 3 2 3 2 2 2 3 1 2 2 2 2 1 2 3 3 1 2 1 1 2 2 2 1 2 2 2 2 2 2 1 2 3 1 2 1 2 2 3 2 2 2 2 2 2 2 2 2 3 1 2 2 2 2 3 2 3 3 1 2 2 1 2...

output:

673
2 4 1662
13 14 1668
19 21 1669
32 34 1670
44 46 1671
49 50 1672
54 55 1674
63 64 1675
73 74 1677
79 80 1678
83 86 1679
92 93 1683
3 5 1684
7 8 1685
20 22 1686
25 26 1687
33 35 1688
45 47 1689
97 98 1690
101 102 1691
103 105 1692
104 106 1693
108 109 1694
115 116 1695
51 52 1696
53 56 1697
118 11...

result:

ok count=673

Test #13:

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

input:

2999
2 2 3 3 2 1 2 1 1 2 2 3 2 3 2 3 2 2 2 1 2 3 2 2 2 2 1 3 2 3 3 2 1 2 3 2 2 2 2 1 2 2 2 2 2 3 2 2 3 1 2 2 2 3 2 2 2 3 3 2 2 2 3 3 3 2 1 1 2 2 2 1 2 2 1 1 2 2 2 2 2 1 2 2 2 3 2 2 3 3 3 1 1 2 2 3 2 2 2 1 2 2 2 2 2 2 2 2 1 2 2 2 1 2 3 3 1 1 2 2 2 2 1 1 2 2 3 2 3 2 3 2 2 2 3 2 2 2 1 2 1 3 2 3 2 2 2 1...

output:

683
2 4 1641
3 6 1642
11 12 1643
13 14 1645
15 16 1648
21 22 1649
5 9 1650
7 10 1651
8 17 1652
19 20 1653
26 28 1654
27 31 1655
32 33 1656
29 35 1657
39 40 1658
49 50 1659
66 68 1660
30 36 1661
67 69 1662
71 72 1663
74 76 1664
34 37 1665
45 46 1666
75 77 1667
81 82 1668
91 93 1669
92 94 1670
99 100 ...

result:

ok count=683

Test #14:

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

input:

2998
2 1 2 1 3 2 2 2 2 2 2 2 1 2 2 2 2 3 3 2 1 2 1 2 2 3 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 1 3 1 3 2 2 1 2 2 2 3 2 2 2 2 1 2 2 1 2 2 2 2 2 2 2 2 3 2 1 2 3 2 2 3 3 2 2 2 2 1 2 1 2 2 2 2 3 2 3 3 3 1 2 2 2 2 2 3 2 2 2 1 2 2 2 2 2 2 2 3 2 2 3 3 2 1 1 2 2 3 3 2 1 2 2 2 2 2 2 2 2 3 2 1 2 1 2 2 3 1 2 3 2 2 2 2...

output:

629
1 2 1652
3 5 1655
12 13 1656
20 21 1657
22 23 1658
34 35 1659
41 45 1661
43 46 1663
47 48 1665
56 57 1667
59 60 1668
70 71 1669
81 82 1670
83 84 1671
93 94 1672
103 104 1673
117 119 1683
118 120 1686
124 125 1688
135 136 1690
137 138 1695
141 142 1696
149 150 1697
154 155 1702
158 159 1703
162 1...

result:

ok count=629

Test #15:

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

input:

2997
1 1 3 2 3 3 2 2 1 2 2 2 2 2 2 1 3 3 2 2 2 3 2 2 2 2 3 2 1 3 2 3 2 3 2 3 3 2 2 2 2 2 2 2 1 1 2 2 3 3 2 1 2 2 3 3 2 2 1 1 1 2 1 2 1 2 2 1 2 1 3 1 3 3 1 2 2 2 2 2 2 1 2 2 2 3 2 2 3 2 2 1 2 2 3 2 1 2 2 2 3 2 2 1 3 1 2 2 2 1 3 2 2 1 2 3 2 3 1 3 2 2 3 2 2 2 2 1 2 2 2 1 1 2 3 2 2 2 3 2 3 1 2 2 3 2 2 2...

output:

712
0 3 1635
1 6 1637
8 9 1639
15 18 1641
28 30 1643
44 46 1644
45 47 1645
51 52 1648
2 7 1649
4 10 1650
5 11 1651
58 61 1652
59 63 1653
16 19 1654
60 65 1655
17 20 1656
21 22 1657
62 66 1658
64 68 1659
67 75 1660
69 76 1661
71 77 1662
26 27 1663
74 78 1664
81 82 1665
29 32 1666
91 92 1667
96 97 166...

result:

ok count=712

Test #16:

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

input:

3000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

1000
0 1000 2000
1 1001 2001
2 1002 2002
3 1003 2003
4 1004 2004
5 1005 2005
6 1006 2006
7 1007 2007
8 1008 2008
9 1009 2009
10 1010 2010
11 1011 2011
12 1012 2012
13 1013 2013
14 1014 2014
15 1015 2015
16 1016 2016
17 1017 2017
18 1018 2018
19 1019 2019
20 1020 2020
21 1021 2021
22 1022 2022
23 102...

result:

ok count=1000

Test #17:

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

input:

3000
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:

1
0 2 2999

result:

ok count=1

Test #18:

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

input:

15
2 3 3 2 1 3 2 1 1 1 3 2 3 1 2

output:

3
1 3 8
2 6 9
5 11 13

result:

ok count=3

Test #19:

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

input:

18
3 3 3 1 1 3 2 2 1 2 1 2 3 2 2 1 3 1

output:

6
0 6 8
1 7 10
3 9 12
2 11 15
4 13 16
5 14 17

result:

ok count=6

Test #20:

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

input:

16
1 3 3 2 1 3 1 2 2 2 3 1 3 2 1 2

output:

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

result:

ok count=5

Test #21:

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

input:

15
1 3 1 2 3 2 3 3 2 1 2 2 1 1 3

output:

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

result:

ok count=5

Test #22:

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

input:

18
1 3 1 3 2 1 1 3 2 2 2 3 2 3 2 1 1 3

output:

6
1 4 6
0 8 11
2 9 13
3 10 15
7 12 16
5 14 17

result:

ok count=6

Test #23:

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

input:

18
1 3 3 2 1 1 1 2 3 2 1 1 2 3 2 3 2 3

output:

6
1 3 6
2 7 10
8 9 11
0 12 13
4 14 15
5 16 17

result:

ok count=6

Test #24:

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

input:

18
1 2 1 2 3 2 3 3 2 2 3 1 1 3 3 1 2 1

output:

6
4 5 11
6 8 12
0 1 13
2 3 14
7 9 15
10 16 17

result:

ok count=6

Test #25:

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

input:

15
1 2 1 2 3 3 1 1 1 2 3 2 3 2 3

output:

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

result:

ok count=5

Test #26:

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

input:

18
3 2 1 2 1 3 3 1 1 3 2 1 2 3 2 1 2 3

output:

6
0 1 8
2 3 9
5 10 11
4 12 13
6 14 15
7 16 17

result:

ok count=6

Test #27:

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

input:

15
1 2 3 2 3 3 3 1 3 2 1 2 1 2 1

output:

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

result:

ok count=5

Test #28:

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

input:

18
2 1 2 2 2 2 1 3 1 3 3 3 2 2 2 2 3 2

output:

2
1 2 11
6 12 16

result:

ok count=2

Test #29:

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

input:

17
1 2 2 2 2 1 1 1 1 3 2 2 1 2 1 2 2

output:

1
9 10 14

result:

ok count=1

Test #30:

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

input:

16
1 2 2 2 2 3 3 1 3 3 2 2 2 2 3 2

output:

2
0 1 9
7 10 14

result:

ok count=2

Test #31:

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

input:

18
1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3

output:

5
0 5 13
1 6 14
2 7 15
3 8 16
4 9 17

result:

ok count=5

Test #32:

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

input:

6
1 2 3 2 3 1

output:

2
0 1 4
2 3 5

result:

ok count=2

Test #33:

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

input:

6
2 1 3 3 1 2

output:

0

result:

ok count=0

Test #34:

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

input:

6
3 1 2 2 3 1

output:

2
1 2 4
0 3 5

result:

ok count=2

Test #35:

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

input:

15000
2 1 3 1 1 2 3 1 3 1 1 1 3 2 2 2 1 3 2 3 3 3 3 2 1 1 2 2 1 1 1 1 1 1 3 3 3 3 3 1 3 1 2 1 1 1 1 1 2 1 2 1 2 1 3 3 3 3 3 2 2 1 1 2 3 3 3 2 3 2 1 2 1 1 1 1 1 3 2 3 2 1 1 2 1 1 1 1 3 2 1 2 1 1 2 1 2 1 2 1 3 3 2 3 2 3 1 2 1 3 3 1 2 2 3 1 2 3 2 3 3 1 1 1 3 3 2 2 2 2 2 1 3 3 3 2 2 1 2 1 3 3 3 3 2 2 1 ...

output:

4997
1 5 489
3 13 498
4 14 504
7 15 506
9 18 510
10 23 512
11 26 513
16 27 516
24 42 518
25 48 520
28 50 521
29 52 525
30 59 527
31 60 528
32 63 529
33 67 531
39 69 537
41 71 539
43 78 541
44 80 543
45 83 546
46 89 549
47 91 550
49 94 551
51 96 553
53 98 557
61 102 558
62 104 562
70 107 569
72 112 5...

result:

ok count=4997

Test #36:

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

input:

15000
3 1 3 3 2 1 1 3 1 2 2 3 1 2 1 2 1 2 1 1 2 2 1 2 3 2 3 2 3 3 1 1 2 1 2 2 3 3 3 2 3 2 1 1 3 2 2 3 1 2 1 3 1 3 1 3 2 1 1 1 3 3 2 2 3 3 1 2 3 2 3 2 2 2 1 2 3 2 2 1 1 3 3 2 1 3 3 3 2 2 1 1 3 1 3 2 2 3 3 1 2 2 2 3 1 1 2 1 1 1 1 1 2 2 1 2 1 3 3 3 3 3 2 3 1 1 1 1 1 1 2 1 1 2 3 2 1 3 3 3 2 1 1 3 2 1 1 ...

output:

4999
1 4 182
5 9 184
6 10 185
8 13 187
12 15 192
14 17 194
16 20 196
18 21 199
19 23 204
22 25 206
30 32 209
31 34 211
33 35 217
42 45 219
43 46 223
48 49 228
50 56 233
52 62 236
54 63 248
57 67 250
58 69 253
59 71 254
66 72 255
74 75 261
79 83 264
80 88 266
84 89 273
90 95 275
91 96 276
93 100 277
...

result:

ok count=4999

Test #37:

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

input:

15000
1 2 1 3 2 3 2 3 2 3 3 1 3 3 1 1 3 1 2 3 1 1 3 2 1 2 1 2 1 1 2 1 1 1 3 3 1 2 3 3 3 1 3 3 2 1 3 3 3 3 1 3 2 3 3 1 3 2 3 1 3 3 1 2 2 2 1 3 3 2 3 2 3 3 2 3 2 1 1 3 2 3 3 1 1 1 3 1 3 1 2 1 3 2 2 1 2 1 2 3 3 1 1 2 1 1 3 3 3 3 1 1 2 2 3 1 2 1 3 1 1 3 2 3 1 2 1 3 1 1 3 3 3 1 3 3 3 1 2 2 2 1 2 1 3 2 3 ...

output:

4998
0 1 218
2 4 223
11 18 224
14 23 227
15 25 232
17 27 233
20 30 234
21 37 236
24 44 240
26 52 245
28 57 247
29 63 248
31 64 256
32 65 258
33 69 259
36 71 261
41 74 262
45 76 265
50 80 270
55 90 273
59 93 274
62 94 278
66 96 280
77 98 281
78 103 286
83 112 288
84 113 299
85 116 305
87 122 308
89 1...

result:

ok count=4998

Test #38:

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

input:

15000
1 2 1 1 1 2 3 1 2 3 3 3 2 2 1 2 1 3 3 2 3 2 1 1 2 3 3 1 1 2 1 3 2 3 1 1 2 2 2 1 3 1 2 3 3 2 2 1 2 3 3 2 2 2 2 3 3 3 2 3 3 2 1 2 3 3 1 3 3 1 1 3 3 3 2 3 2 1 3 1 1 2 1 3 1 2 1 1 2 1 2 3 2 2 3 3 2 2 1 3 3 2 3 1 2 2 3 3 2 3 1 3 1 1 3 1 3 3 1 3 1 2 2 2 1 3 1 3 2 2 2 2 3 2 1 2 2 3 3 1 2 3 1 1 3 1 2 ...

output:

5000
0 1 264
2 5 268
3 8 278
4 12 279
7 13 280
14 15 283
16 19 284
22 24 285
23 29 286
27 32 289
28 36 290
30 37 291
34 38 293
35 42 295
39 45 296
41 46 300
47 48 301
62 63 312
66 74 314
69 76 315
70 81 316
77 85 317
79 88 319
80 90 324
82 92 328
84 93 332
86 96 335
87 97 336
89 101 337
98 104 339
1...

result:

ok count=5000

Test #39:

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

input:

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

output:

5000
0 24 5295
1 41 5296
6 42 5299
7 43 5302
8 44 5303
9 46 5306
10 47 5308
12 48 5309
14 49 5310
17 50 5311
19 51 5314
2 52 5315
20 53 5316
3 54 5317
4 55 5318
21 56 5319
22 57 5320
5 58 5321
11 59 5322
25 60 5323
26 61 5324
13 62 5325
27 63 5326
28 64 5327
15 65 5328
16 66 5329
18 67 5330
23 68 53...

result:

ok count=5000

Test #40:

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

input:

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

output:

5000
1 30 6127
3 42 6128
6 43 6129
7 45 6130
8 46 6133
9 47 6135
16 48 6136
17 49 6137
19 50 6139
20 51 6140
32 52 6147
39 53 6148
41 54 6151
84 96 6153
86 97 6155
87 98 6156
88 99 6157
90 101 6158
91 102 6159
93 103 6162
94 104 6165
110 132 6169
111 134 6170
112 200 6174
114 205 6175
115 211 6176
1...

result:

ok count=5000

Test #41:

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

input:

15000
3 3 1 1 1 1 3 3 3 1 3 1 3 1 3 1 3 3 3 3 1 3 3 1 1 1 3 1 1 1 1 3 1 1 3 3 1 1 1 3 1 3 1 3 3 1 1 1 3 1 3 3 3 3 3 3 3 1 3 3 3 1 3 1 3 3 3 3 3 3 3 3 3 1 1 1 1 3 3 1 3 3 3 1 3 3 1 3 3 1 3 3 3 3 1 1 1 1 3 3 1 3 1 3 3 1 3 1 1 3 1 3 1 3 3 3 1 1 1 1 3 3 3 3 1 3 1 3 1 1 3 1 1 1 3 1 1 1 3 2 3 3 3 3 1 1 1 ...

output:

5000
0 139 6955
1 444 6958
6 472 6960
7 474 6961
2 475 6962
3 476 6963
8 477 6964
4 478 6965
10 479 6966
5 480 6967
12 481 6968
14 482 6969
9 483 6970
16 484 6971
17 485 6972
11 486 6973
13 487 6974
18 488 6975
19 489 6976
15 490 6977
21 491 6978
20 492 6979
23 493 6980
24 494 6981
25 495 6982
22 49...

result:

ok count=5000

Test #42:

score: 0
Accepted
time: 29ms
memory: 16120kb

input:

6000
1 3 1 1 3 3 3 1 1 1 1 1 3 1 1 1 3 1 3 3 3 1 3 1 1 1 3 3 3 3 1 1 3 1 3 1 3 3 3 3 3 3 3 3 3 3 1 3 1 3 1 1 1 1 3 3 3 1 1 1 1 3 1 3 1 3 1 3 1 1 1 1 3 3 1 3 3 3 1 3 3 3 1 3 3 3 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...

output:

2000
1 89 2507
4 90 2508
5 91 2509
6 92 2510
12 93 2511
16 94 2512
18 95 2513
19 96 2514
20 97 2516
22 98 2525
26 99 2526
27 100 2529
28 101 2533
29 102 2537
32 103 2542
34 104 2543
36 105 2544
37 106 2545
38 107 2546
39 108 2547
40 109 2551
41 110 2553
42 111 2555
43 112 2556
44 113 2558
45 114 256...

result:

ok count=2000

Test #43:

score: 0
Accepted
time: 64ms
memory: 16128kb

input:

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

output:

3000
9 13 4174
28 32 4175
31 39 4176
34 41 4181
35 43 4183
37 44 4186
38 45 4187
40 46 4190
42 47 4192
52 66 4193
53 84 4194
54 85 4197
55 86 4200
57 87 4205
58 88 4206
60 89 4208
62 90 4210
65 91 4214
67 92 4223
68 93 4226
0 14 4227
70 94 4228
75 95 4229
1 16 4230
76 96 4231
2 17 4232
80 97 4233
3 ...

result:

ok count=3000

Test #44:

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

input:

12000
3 3 3 3 3 1 3 1 3 1 1 3 1 1 3 1 3 3 3 1 1 1 3 1 1 1 1 3 3 3 2 1 1 1 3 3 3 3 1 3 1 3 1 1 1 1 1 3 3 1 1 3 3 1 1 1 2 1 3 3 1 1 1 1 1 1 1 3 1 3 3 1 3 1 3 3 1 1 1 3 3 3 1 1 1 3 3 1 3 3 1 3 3 3 1 1 3 1 1 1 3 1 1 3 3 1 1 1 1 1 3 3 1 3 1 3 3 1 1 3 1 3 1 3 3 3 3 3 3 1 1 1 1 1 3 1 1 1 3 1 3 1 3 3 3 3 1 ...

output:

4000
5 30 6531
7 56 6535
9 233 6538
10 270 6539
12 309 6540
13 334 6541
15 335 6542
19 339 6543
20 342 6547
21 343 6550
0 344 6553
23 345 6554
1 346 6555
2 347 6556
3 348 6557
24 349 6558
4 350 6559
25 351 6560
26 352 6561
31 353 6562
6 354 6563
8 355 6564
11 356 6565
32 357 6566
14 358 6567
33 359 ...

result:

ok count=4000

Test #45:

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

input:

15000
3 3 1 3 3 2 3 2 1 1 2 1 3 1 1 3 1 2 2 2 2 1 2 2 2 2 2 2 2 2 1 1 2 3 2 2 1 1 1 1 1 1 1 3 3 3 1 1 3 1 3 1 1 3 3 3 1 3 1 3 1 1 1 3 3 1 3 1 3 1 2 1 3 1 3 1 1 1 1 3 3 3 3 3 3 1 3 1 3 3 1 3 3 1 1 1 1 1 1 3 1 1 1 1 3 3 3 3 2 3 3 3 1 3 1 3 3 3 2 2 2 2 2 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:

5000
2 5 5410
8 10 5412
9 17 5417
11 18 5420
13 19 5422
14 20 5423
16 22 5425
21 23 5426
30 32 5427
31 34 5429
36 70 5430
37 108 5432
38 118 5438
39 119 5440
40 120 5442
41 121 5443
42 122 5445
46 123 5447
47 124 5450
49 125 5451
0 7 5452
51 126 5453
52 127 5454
56 128 5455
1 24 5456
58 129 5457
60 ...

result:

ok count=5000

Test #46:

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

input:

15000
3 3 3 3 1 1 1 3 1 1 1 3 1 1 1 3 1 3 3 3 3 3 1 1 3 1 1 3 3 3 1 1 1 3 1 1 3 1 1 1 1 1 1 1 1 3 3 3 1 3 3 2 3 1 1 3 3 3 3 3 1 1 1 3 3 2 3 1 1 3 3 3 3 1 3 3 3 1 1 1 1 3 3 3 1 3 3 1 1 2 3 1 1 1 3 3 1 1 3 3 3 3 1 3 3 1 1 3 1 3 3 1 1 1 3 3 1 1 1 3 1 2 1 1 2 1 1 1 2 3 3 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

5000
4 51 6947
5 65 6948
6 89 6949
8 121 6952
9 124 6954
10 128 6955
12 132 6956
0 133 6957
1 134 6958
2 135 6959
13 136 6960
14 137 6961
3 138 6962
16 139 6963
22 140 6964
23 141 6965
7 142 6966
25 143 6967
26 144 6968
11 145 6969
15 146 6970
17 147 6971
18 148 6972
19 149 6973
20 150 6974
30 151 6...

result:

ok count=5000

Test #47:

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

input:

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

output:

5000
2 7 6104
5 33 6106
6 34 6107
8 36 6109
9 39 6112
11 40 6113
12 41 6115
14 42 6118
16 43 6119
17 44 6120
18 45 6121
21 46 6124
24 47 6128
26 48 6135
27 49 6138
28 50 6139
29 51 6142
35 52 6144
38 53 6148
70 389 6154
71 410 6156
72 435 6157
73 436 6160
75 437 6163
80 438 6165
81 439 6171
85 440 6...

result:

ok count=5000

Test #48:

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

input:

15000
1 2 2 1 2 2 3 2 2 2 2 1 2 1 3 2 2 2 2 3 2 2 2 2 1 2 2 1 2 2 2 2 3 2 2 2 2 3 2 2 2 2 1 1 2 2 2 1 1 3 2 2 2 2 3 2 2 1 2 2 2 1 3 2 1 2 2 2 2 2 2 3 2 2 3 2 2 3 2 1 2 2 2 2 2 3 2 2 2 2 2 3 3 1 2 1 2 2 2 2 3 2 1 1 2 2 2 2 2 1 2 2 2 2 2 3 2 2 1 2 3 3 2 2 2 1 2 2 2 2 3 2 2 2 2 2 3 3 3 2 1 2 1 2 1 2 3 ...

output:

3267
0 1 8346
3 4 8348
11 12 8349
13 15 8350
24 25 8355
6 7 8357
14 16 8358
19 20 8359
27 28 8360
32 33 8361
37 38 8362
42 44 8363
49 50 8364
54 55 8365
62 63 8366
43 45 8367
71 72 8368
74 75 8369
47 51 8370
77 78 8371
85 86 8372
91 94 8373
48 52 8374
57 58 8375
61 65 8376
92 96 8377
100 101 8378
11...

result:

ok count=3267

Test #49:

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

input:

15000
1 2 2 2 1 2 2 2 2 2 1 2 2 2 1 3 2 1 1 2 2 1 2 2 2 2 2 2 2 2 2 1 3 2 1 1 2 3 3 1 2 1 1 1 3 2 2 1 2 2 2 2 2 2 2 2 3 2 1 2 2 3 1 2 2 1 1 3 2 2 3 2 2 3 3 2 3 2 2 1 2 2 3 2 2 2 2 2 3 1 2 2 1 2 2 2 1 2 2 2 2 2 2 2 2 2 3 2 3 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 2 3 2 1 2 2 2 2 3 2 1 2 2 1 2 2 ...

output:

3340
15 16 8300
32 33 8301
37 40 8306
38 45 8307
44 46 8308
56 57 8312
61 63 8313
67 68 8317
70 71 8319
73 75 8320
74 77 8322
76 78 8323
82 83 8326
88 90 8327
106 107 8329
108 109 8337
111 112 8340
129 130 8343
132 133 8354
139 140 8355
152 153 8358
159 161 8359
160 165 8360
162 166 8365
167 168 836...

result:

ok count=3340

Test #50:

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

input:

14000
1 2 1 2 1 2 2 3 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 3 2 2 2 2 2 3 2 2 2 3 1 3 1 1 2 2 2 2 1 3 2 2 1 2 2 2 1 2 3 2 2 1 2 2 2 2 2 1 2 2 2 2 2 1 2 2 2 2 2 3 2 2 3 1 2 2 2 2 1 2 2 2 1 2 2 2 2 2 2 2 2 3 3 1 1 2 2 2 1 2 2 3 1 2 2 2 2 2 2 2 3 2 2 2 1 2 1 3 2 3 2 2 3 2 2 2 1 1 3 2 2 2 1 2 2 2 2 2 1 2 1 ...

output:

3042
0 1 7684
2 3 7685
4 5 7686
10 11 7687
24 26 7691
36 40 7692
38 41 7696
39 42 7697
44 46 7698
48 49 7699
52 53 7700
57 58 7702
63 64 7706
69 70 7708
79 80 7709
84 85 7710
88 89 7711
99 101 7712
100 102 7713
104 105 7717
108 109 7720
120 121 7722
122 124 7723
132 135 7724
133 136 7725
138 139 772...

result:

ok count=3042

Test #51:

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

input:

13000
2 2 3 3 2 2 2 1 2 3 2 1 2 1 2 3 1 3 3 1 2 1 2 1 2 3 2 2 2 2 2 2 1 2 2 1 3 3 3 1 2 2 3 2 3 2 1 2 2 2 2 1 2 1 2 2 2 2 1 2 2 2 2 3 3 2 2 2 2 1 2 3 2 2 3 2 2 1 2 1 2 2 2 1 2 2 1 1 2 3 1 2 2 1 2 1 2 2 2 2 1 3 2 2 2 2 2 2 2 1 1 2 3 2 2 2 2 2 2 2 1 2 1 2 2 3 1 2 2 3 1 2 2 2 1 2 3 3 2 2 1 1 1 2 3 1 2 ...

output:

2941
7 8 7145
11 12 7149
13 14 7154
16 20 7155
19 22 7159
21 24 7161
23 26 7164
32 33 7166
35 40 7167
39 41 7172
46 47 7173
51 52 7174
53 54 7177
58 59 7178
69 70 7182
77 78 7183
79 80 7186
83 84 7187
86 88 7191
87 91 7192
90 92 7193
93 94 7195
95 96 7196
100 102 7201
109 111 7202
110 113 7203
120 1...

result:

ok count=2941

Test #52:

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

input:

11000
2 2 2 3 2 2 2 2 2 2 2 1 2 1 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 3 2 2 2 2 1 2 1 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 1 3 2 1 1 2 2 2 2 1 2 2 3 2 2 1 2 2 2 2 2 1 2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 2 2 2 3 2 2 3 2 1 3 2 2 2 2 1 2 2 3 2 2 3 2 2 2 2 2 2 2 3 2 1 2 2 3 1 2 2 3 2 2 3 2 3 2 2 2 ...

output:

2460
11 12 6042
13 14 6044
18 19 6045
29 30 6046
42 43 6047
44 46 6049
64 66 6051
67 69 6052
68 70 6054
73 74 6056
79 80 6058
85 86 6062
93 95 6063
94 96 6072
109 111 6073
115 116 6075
131 132 6079
135 136 6081
147 150 6082
151 155 6083
153 156 6084
157 159 6087
158 161 6089
164 166 6090
165 167 609...

result:

ok count=2460

Test #53:

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

input:

11000
2 2 3 1 2 1 2 2 2 3 2 2 2 2 2 3 2 1 2 2 1 2 3 2 1 2 3 2 2 1 2 2 2 2 2 2 3 3 2 2 2 2 2 1 2 1 2 2 1 1 2 1 1 2 2 3 2 2 2 2 2 2 2 1 2 2 3 1 1 2 2 1 3 2 1 2 3 2 3 1 2 2 2 1 2 2 2 2 3 2 2 2 3 1 2 1 2 2 2 2 3 2 1 2 2 1 3 2 3 3 2 2 2 1 2 2 2 2 2 3 1 2 2 1 2 2 3 2 2 3 2 2 2 2 1 3 2 2 2 2 2 1 2 2 3 2 2 ...

output:

2423
2 4 5989
9 10 5993
15 16 5995
22 23 5998
26 27 6000
36 38 6003
37 39 6004
55 56 6005
66 69 6006
72 73 6007
76 77 6009
78 80 6011
88 89 6012
92 94 6013
100 101 6014
106 107 6015
108 110 6017
109 111 6018
119 121 6019
126 127 6020
129 130 6022
135 136 6023
144 145 6028
154 155 6029
157 158 6032
1...

result:

ok count=2423

Test #54:

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

input:

11000
2 1 1 3 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 3 2 2 2 3 2 1 2 1 2 1 2 2 2 2 3 2 2 2 2 2 2 3 2 1 2 3 1 3 2 2 3 2 2 3 2 1 3 1 3 2 2 2 2 2 2 1 3 2 2 2 2 1 2 2 2 2 3 2 2 3 3 1 2 2 2 2 2 2 2 2 2 2 3 2 2 3 2 2 2 2 3 2 2 1 1 2 3 3 2 3 1 1 3 1 2 2 2 3 2 1 2 2 2 3 3 3 2 1 2 2 2 3 2 2 ...

output:

2372
1 4 6168
2 5 6170
25 26 6171
38 39 6172
40 41 6173
3 6 6174
9 10 6175
32 33 6176
36 37 6177
47 48 6178
54 55 6179
42 43 6180
56 57 6181
58 61 6182
60 62 6183
59 64 6184
68 72 6185
70 73 6186
78 80 6187
63 65 6188
84 85 6189
66 67 6190
69 74 6191
71 75 6192
94 95 6193
79 81 6194
89 90 6195
116 1...

result:

ok count=2372

Test #55:

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

input:

11000
2 2 1 2 3 2 2 1 2 2 2 3 1 2 2 2 2 2 2 2 3 2 2 1 2 2 2 2 2 3 2 2 1 1 2 3 2 3 2 2 2 2 2 2 2 2 1 3 2 3 3 2 2 2 3 2 2 2 1 2 2 1 3 3 2 2 2 3 2 2 2 2 3 2 1 1 2 2 2 2 2 2 2 2 2 2 2 1 2 3 2 2 2 2 2 1 2 2 2 2 2 2 2 1 3 1 1 2 3 3 2 2 2 2 2 1 2 2 2 2 1 2 2 1 2 3 2 2 2 2 2 1 1 3 2 2 1 2 3 2 2 2 1 1 2 2 2 ...

output:

2490
2 3 6084
7 8 6085
12 13 6087
23 24 6088
32 34 6089
33 36 6090
46 48 6091
58 59 6092
61 64 6097
74 76 6099
75 77 6100
87 88 6103
95 96 6104
4 5 6106
103 107 6107
105 110 6108
106 111 6109
11 14 6110
115 116 6111
120 121 6112
123 124 6113
131 134 6114
132 135 6115
20 21 6116
136 137 6117
142 144 ...

result:

ok count=2490

Test #56:

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

input:

15000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

1
7734 8258 14999

result:

ok count=1

Test #57:

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

input:

15000
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 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:

1
5343 5344 8595

result:

ok count=1

Test #58:

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

input:

15000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

5000
0 5000 10000
1 5001 10001
2 5002 10002
3 5003 10003
4 5004 10004
5 5005 10005
6 5006 10006
7 5007 10007
8 5008 10008
9 5009 10009
10 5010 10010
11 5011 10011
12 5012 10012
13 5013 10013
14 5014 10014
15 5015 10015
16 5016 10016
17 5017 10017
18 5018 10018
19 5019 10019
20 5020 10020
21 5021 100...

result:

ok count=5000

Test #59:

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

input:

15000
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:

1
0 1 14999

result:

ok count=1

Test #60:

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

input:

15000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

3000
0 6000 12000
1 6001 12001
2 6002 12002
3 6003 12003
4 6004 12004
5 6005 12005
6 6006 12006
7 6007 12007
8 6008 12008
9 6009 12009
10 6010 12010
11 6011 12011
12 6012 12012
13 6013 12013
14 6014 12014
15 6015 12015
16 6016 12016
17 6017 12017
18 6018 12018
19 6019 12019
20 6020 12020
21 6021 120...

result:

ok count=3000

Test #61:

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

input:

14997
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

4977
0 4977 10020
1 4978 10021
2 4979 10022
3 4980 10023
4 4981 10024
5 4982 10025
6 4983 10026
7 4984 10027
8 4985 10028
9 4986 10029
10 4987 10030
11 4988 10031
12 4989 10032
13 4990 10033
14 4991 10034
15 4992 10035
16 4993 10036
17 4994 10037
18 4995 10038
19 4996 10039
20 4997 10040
21 4998 100...

result:

ok count=4977

Test #62:

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

input:

91
2 1 2 2 1 3 1 2 1 2 2 1 2 3 3 1 2 2 2 1 3 1 3 1 1 3 1 2 1 2 1 3 1 1 3 2 3 1 2 3 2 2 2 2 1 2 1 1 3 2 2 2 1 1 2 3 3 2 3 3 3 3 1 1 3 2 3 3 1 3 3 3 3 3 2 1 2 2 2 3 2 3 2 1 3 1 3 1 3 1 1

output:

29
5 7 28
13 16 30
14 17 32
20 27 33
22 29 37
25 35 44
31 38 46
34 40 47
36 41 52
39 42 53
48 49 62
55 57 63
56 65 68
1 2 69
4 9 70
6 10 71
8 12 72
11 18 73
58 74 75
15 43 79
19 45 81
59 76 83
21 50 84
60 77 85
23 51 86
61 78 87
24 54 88
64 80 89
66 82 90

result:

ok count=29

Test #63:

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

input:

92
3 1 3 3 3 3 3 1 3 2 1 3 3 3 1 1 1 2 2 1 2 1 2 2 2 3 2 1 3 3 2 3 3 2 3 3 2 3 3 2 2 1 2 2 3 3 2 2 2 3 2 1 3 2 1 2 1 1 1 1 1 3 1 3 1 2 1 1 2 2 2 2 3 1 1 3 2 1 1 1 1 1 1 3 1 2 2 3 3 2 2 2

output:

29
0 9 16
2 17 19
3 18 21
4 20 27
5 22 41
6 23 51
8 24 54
11 26 56
12 30 57
13 33 58
25 36 59
28 39 60
29 40 62
31 42 64
32 43 66
34 46 67
35 47 73
37 48 74
1 50 75
38 53 77
44 55 78
45 65 79
49 68 80
52 69 81
61 70 82
7 71 83
63 76 84
10 85 87
14 86 88

result:

ok count=29

Test #64:

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

input:

93
1 1 3 1 1 3 1 1 2 3 1 1 1 2 3 3 2 1 1 3 1 3 3 2 3 3 1 3 2 2 3 3 1 3 1 1 1 2 2 3 1 2 3 1 3 3 2 3 2 3 2 3 2 3 2 3 3 2 1 3 2 2 1 1 1 2 1 1 2 2 2 1 1 2 3 1 2 2 3 3 2 1 2 2 1 2 2 2 2 3 3 2 2

output:

28
2 8 20
5 13 26
9 16 32
14 23 34
15 28 35
19 29 36
21 37 40
22 38 43
0 41 53
1 46 55
3 48 56
24 50 58
4 52 59
25 54 62
27 57 63
30 60 64
31 61 66
33 65 67
39 68 71
42 69 72
6 70 74
44 73 75
7 76 78
10 77 79
45 80 81
47 82 84
11 83 89
12 85 90

result:

ok count=28

Test #65:

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

input:

94
3 3 1 1 3 2 1 3 2 1 2 1 1 2 2 2 2 3 2 2 1 1 3 1 2 1 2 3 3 3 2 2 1 3 2 1 2 2 1 2 3 1 2 1 2 1 3 1 3 1 3 3 2 2 2 1 1 3 2 2 3 3 3 2 2 3 3 3 2 3 2 1 2 2 1 1 2 1 1 1 3 2 2 1 3 3 1 3 1 3 3 3 2 1

output:

30
0 5 21
1 8 23
4 10 25
7 13 32
17 18 35
22 24 38
27 30 41
28 31 43
29 34 45
33 36 47
40 42 49
46 52 55
48 53 56
50 54 71
51 58 74
57 59 75
60 63 77
61 64 78
62 68 79
2 14 80
65 70 83
3 15 84
6 16 85
66 72 86
9 19 87
67 73 88
11 26 89
12 37 90
20 39 91
69 76 93

result:

ok count=30

Test #66:

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

input:

94
3 2 3 2 1 2 1 3 3 2 1 3 2 3 1 3 2 1 2 2 2 3 3 1 3 3 1 2 1 1 1 2 3 2 1 2 2 2 2 2 3 1 3 3 2 3 3 3 1 1 1 2 1 1 1 3 3 3 1 1 3 1 3 1 2 3 3 2 1 1 2 3 2 1 2 2 3 1 3 3 1 1 1 3 2 3 1 2 2 2 2 3 1 1

output:

29
0 1 30
2 3 34
7 9 41
8 12 48
11 16 49
13 18 50
15 19 52
21 27 53
22 31 54
24 33 58
25 35 59
32 36 61
40 44 63
42 51 68
43 64 69
45 67 73
4 5 76
46 70 77
6 20 78
10 37 79
47 72 80
55 74 81
56 75 82
14 38 83
17 39 85
57 84 86
23 87 91
60 88 92
62 89 93

result:

ok count=29

Test #67:

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

input:

96
2 3 2 1 1 1 1 3 3 2 2 1 2 1 3 3 3 2 3 2 1 3 2 1 2 3 2 2 3 2 1 2 2 1 1 3 1 2 3 3 3 3 3 1 1 2 1 1 2 2 2 1 3 3 1 1 3 2 3 1 1 3 2 1 1 1 2 1 3 2 2 3 3 2 2 3 3 1 1 1 3 1 3 3 3 3 1 3 3 2 2 2 1 1 1 2

output:

28
1 2 30
7 9 33
8 10 34
14 17 36
15 19 43
16 22 44
18 24 46
21 26 47
25 27 51
28 29 54
35 37 55
38 45 59
39 48 60
40 49 63
41 50 64
42 57 65
52 62 67
53 66 77
56 69 78
58 70 79
61 73 81
3 12 85
68 74 86
4 31 87
5 32 88
71 89 92
72 90 93
75 91 94

result:

ok count=28

Test #68:

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

input:

98
2 3 2 1 2 2 1 3 3 3 2 1 3 1 1 2 2 2 2 1 1 2 2 1 2 1 3 2 1 3 3 1 2 1 2 1 1 3 2 1 2 3 1 2 3 3 3 3 2 2 3 1 3 2 1 1 1 3 3 1 3 2 2 1 3 1 3 3 3 1 1 2 1 1 2 3 2 3 2 1 3 1 1 2 3 1 3 3 2 3 3 1 3 1 3 1 3 2

output:

27
1 2 36
7 10 39
8 15 42
9 16 51
12 17 54
26 27 55
29 32 56
30 34 59
37 38 63
41 43 65
44 48 69
45 49 70
46 53 72
47 61 73
50 62 79
52 71 81
57 74 82
58 76 85
3 4 87
6 18 89
11 21 90
60 78 91
13 22 92
64 83 93
14 24 94
66 88 95
19 40 96

result:

ok count=27

Test #69:

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

input:

100
1 3 1 3 1 1 2 3 1 2 2 2 1 3 3 3 3 1 2 3 1 1 3 2 2 2 3 3 2 1 1 3 1 3 2 2 1 1 1 3 1 3 2 3 2 2 2 1 3 3 1 1 1 1 1 3 2 2 2 3 3 2 1 3 2 3 3 1 1 1 2 2 2 2 2 1 1 3 2 3 2 3 1 3 1 1 3 3 2 1 2 2 3 3 3 3 1 1 3 1

output:

30
1 6 21
3 9 29
7 10 30
13 18 32
14 23 36
15 24 37
16 25 38
19 28 40
22 34 47
26 35 50
27 42 51
31 44 52
33 45 53
39 46 54
41 56 62
43 57 67
48 58 68
49 61 69
55 64 75
59 70 76
60 71 82
63 72 84
65 73 85
66 74 89
0 11 94
2 78 95
77 80 96
79 88 97
4 90 98
81 91 99

result:

ok count=30

Test #70:

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

input:

100
1 1 1 1 1 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 2 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

1
0 29 58

result:

ok count=1

Test #71:

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

input:

100
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 1 2 2 2 2 2 2

output:

1
29 30 93

result:

ok count=1

Test #72:

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

input:

99
1 1 3 3 2 1 2 2 2 2 1 2 1 3 1 3 3 1 3 3 2 2 2 1 2 2 2 2 2 2 1 2 1 2 3 2 3 2 1 2 1 3 1 2 2 1 2 3 2 2 1 3 2 1 2 3 2 2 1 2 3 1 1 3 3 3 3 3 3 1 1 3 1 3 1 1 1 3 1 1 3 1 3 3 1 3 3 3 2 1 1 3 3 2 3 3 1 2 1

output:

33
2 4 61
3 6 62
0 7 65
1 8 66
5 9 67
10 11 68
13 20 69
15 21 70
12 22 71
16 24 72
14 25 73
18 26 74
19 27 75
34 35 76
17 28 77
36 37 78
41 43 79
23 29 80
47 48 81
30 31 82
32 33 83
51 52 84
38 39 85
40 44 86
42 46 87
55 56 89
60 88 90
45 49 91
50 54 92
53 57 94
58 59 95
63 93 96
64 97 98

result:

ok count=33

Test #73:

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

input:

96
3 2 1 2 3 1 2 1 2 1 2 2 1 1 2 2 3 2 1 3 2 2 1 2 3 2 1 2 3 3 3 3 1 2 2 2 2 2 1 1 1 1 3 1 2 1 1 3 3 1 3 3 1 3 3 1 1 1 3 3 3 1 3 1 1 3 3 1 3 3 3 3 2 1 2 3 2 3 2 3 2 1 2 1 2 3 2 3 2 1 2 3 2 1 2 1

output:

32
0 1 46
4 6 49
16 17 52
19 20 55
24 25 56
28 33 57
2 3 58
5 8 59
7 10 60
29 34 61
9 11 62
30 35 63
31 36 64
12 14 65
13 15 66
42 44 67
18 21 68
22 23 69
26 27 70
32 37 71
47 72 73
38 74 75
39 76 77
40 78 79
48 80 81
50 82 83
41 84 85
43 86 87
51 88 89
45 90 91
53 92 93
54 94 95

result:

ok count=32

Test #74:

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

input:

99
3 2 1 2 1 1 1 3 2 3 1 2 1 2 3 3 3 1 3 3 3 1 1 3 3 3 3 3 1 3 1 1 1 1 1 3 1 1 1 1 1 1 3 2 3 2 3 2 2 3 1 2 2 2 2 3 2 1 1 1 3 2 3 2 2 2 3 1 3 2 1 2 3 2 2 2 2 2 2 2 1 1 3 1 1 3 3 2 3 2 2 2 3 2 2 3 1 3 1

output:

33
2 3 35
0 1 39
7 8 40
9 11 41
4 13 42
5 43 44
6 45 46
10 47 49
14 48 50
12 51 55
15 52 57
16 53 58
18 54 59
17 56 60
21 61 62
22 63 66
19 64 67
28 65 68
20 69 70
30 71 72
23 73 80
24 74 81
31 75 82
25 76 83
26 77 84
32 78 85
33 79 86
34 87 88
36 89 92
37 90 95
27 91 96
38 93 97
29 94 98

result:

ok count=33

Test #75:

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

input:

93
3 2 3 2 3 2 1 2 3 2 3 2 3 2 3 1 3 1 3 1 1 1 3 3 1 3 3 3 1 1 3 1 1 1 3 3 1 3 3 1 2 2 3 1 1 2 3 2 1 3 3 1 3 2 2 2 2 2 2 2 3 2 3 3 1 1 1 3 1 2 2 3 1 2 1 2 1 2 3 2 2 1 1 2 2 2 2 2 3 1 1 1 1

output:

31
0 1 29
2 3 31
4 5 32
8 9 33
10 11 36
12 13 39
14 40 43
16 41 44
18 45 48
22 47 51
6 7 52
15 53 60
17 54 62
19 55 63
23 56 64
25 57 65
26 58 66
20 59 67
27 61 68
21 69 71
30 70 72
34 73 74
35 75 76
24 77 78
37 79 81
38 80 82
28 83 88
42 84 89
46 85 90
49 86 91
50 87 92

result:

ok count=31

Test #76:

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

input:

90
3 3 3 3 2 2 2 2 3 2 1 2 3 2 3 2 1 1 2 2 3 3 2 2 1 3 2 2 1 2 1 1 3 1 3 2 3 3 3 1 1 1 3 1 3 2 3 1 1 3 1 2 1 1 3 3 3 1 2 1 1 2 1 3 3 3 1 1 3 1 2 2 1 2 1 3 2 3 2 2 3 1 2 1 2 1 2 1 2 3

output:

30
0 4 40
1 5 41
2 6 43
3 7 47
8 9 48
12 13 50
14 15 52
20 22 53
10 11 56
21 23 57
25 26 59
32 35 60
34 45 62
16 18 63
17 19 64
24 27 65
36 51 66
37 58 67
28 29 68
38 61 69
42 70 72
44 71 74
30 73 75
31 76 77
33 78 80
46 79 81
49 82 83
54 84 85
55 86 87
39 88 89

result:

ok count=30

Test #77:

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

input:

100
2 1 2 2 2 3 2 2 1 2 1 2 2 1 2 2 2 2 1 2 2 3 2 2 2 2 2 1 2 2 2 3 3 1 1 1 1 1 1 1 3 3 3 1 1 3 1 1 1 1 3 3 3 1 3 3 3 1 1 3 1 3 1 3 3 3 2 3 2 2 1 2 2 3 2 2 2 2 2 2 3 1 2 1 1 1 1 2 2 3 2 2 3 2 2 2 2 1 2 2

output:

20
1 2 56
8 9 59
5 6 60
10 11 61
21 22 62
13 14 63
18 19 64
27 28 65
33 66 67
31 68 70
34 69 73
35 71 80
32 72 81
40 74 83
41 75 84
42 76 85
45 77 86
36 78 89
37 79 92
50 82 97

result:

ok count=20

Test #78:

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

input:

99
2 2 2 2 2 2 2 1 2 1 2 2 2 2 2 2 3 2 2 2 2 2 3 2 1 2 3 2 2 2 2 2 2 1 1 1 1 1 3 3 1 1 3 3 1 1 3 1 1 3 3 1 1 1 3 3 1 1 3 1 1 1 3 3 3 3 3 2 2 3 3 1 2 3 2 2 2 1 2 1 3 1 1 2 1 2 1 1 1 2 3 2 2 2 2 2 1 1 2

output:

18
16 17 59
22 23 60
26 27 61
7 8 70
38 67 71
9 10 73
39 68 77
42 72 79
24 25 80
43 74 81
46 75 82
49 76 84
50 78 86
54 83 87
55 85 88
33 89 90
58 91 96
62 92 97

result:

ok count=18

Test #79:

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

input:

98
3 2 2 2 2 2 2 3 3 2 2 2 1 2 1 2 2 2 2 2 2 3 1 3 1 3 2 3 2 1 2 2 1 1 1 3 3 3 3 1 3 1 1 1 3 3 1 3 3 3 1 3 1 3 3 1 3 3 1 1 3 3 3 3 2 2 2 2 2 2 2 2 2 1 3 2 2 2 3 2 2 2 2 3 2 1 2 2 2 2 2 2 2 2 2 2 2 1

output:

15
0 1 43
7 9 46
8 10 50
21 26 52
23 28 55
25 30 58
27 31 59
12 13 62
14 15 63
35 64 73
22 65 74
24 66 78
29 67 83
36 68 85
37 69 97

result:

ok count=15

Test #80:

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

input:

97
2 2 1 3 2 2 1 2 2 2 1 2 1 1 1 1 2 2 3 2 3 1 2 2 2 3 2 3 3 2 2 2 1 3 1 1 1 1 1 1 1 1 3 3 3 1 3 1 1 1 1 3 1 1 1 3 1 3 1 3 1 1 3 1 2 2 1 2 1 2 2 2 2 2 1 3 2 2 1 3 1 2 3 1 2 2 1 2 2 2 2 3 3 2 2 1 1

output:

21
3 4 54
18 19 56
20 22 58
25 26 60
27 29 61
2 5 62
28 30 63
33 64 66
42 65 68
43 67 74
6 7 75
44 69 78
10 11 79
46 70 80
12 16 82
51 71 83
55 72 86
13 17 91
14 23 92
57 73 95
59 76 96

result:

ok count=21

Test #81:

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

input:

99
1 1 1 1 1 1 1 1 1 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 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3

output:

33
0 33 66
1 34 67
2 35 68
3 36 69
4 37 70
5 38 71
6 39 72
7 40 73
8 41 74
9 42 75
10 43 76
11 44 77
12 45 78
13 46 79
14 47 80
15 48 81
16 49 82
17 50 83
18 51 84
19 52 85
20 53 86
21 54 87
22 55 88
23 56 89
24 57 90
25 58 91
26 59 92
27 60 93
28 61 94
29 62 95
30 63 96
31 64 97
32 65 98

result:

ok count=33

Test #82:

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

input:

99
3 2 3 3 1 2 1 1 1 1 2 2 3 1 3 1 3 3 2 3 3 2 3 3 1 2 3 3 1 1 1 2 1 1 1 1 3 1 1 2 1 2 1 2 3 3 2 3 1 2 2 1 2 3 3 3 1 3 2 2 2 2 2 2 2 2 3 3 1 2 2 2 1 3 3 1 3 2 2 3 2 2 3 2 1 2 1 3 1 3 3 1 2 1 1 3 1 3 1

output:

33
0 1 30
2 5 32
3 10 33
12 18 34
14 21 35
16 25 37
17 31 38
19 39 40
20 41 42
22 43 48
23 46 51
26 49 56
27 50 68
36 52 72
4 11 73
6 58 74
44 59 75
7 60 76
8 61 79
9 62 82
45 63 84
47 64 86
13 65 87
53 69 88
15 70 89
24 71 90
54 77 91
55 78 93
57 80 94
28 81 95
66 83 96
29 85 97
67 92 98

result:

ok count=33

Test #83:

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

input:

96
3 3 3 2 2 1 2 3 1 3 3 1 3 2 1 2 1 3 2 1 2 1 2 1 2 2 2 1 1 1 3 2 3 3 3 3 1 2 3 3 1 1 3 2 3 1 3 1 2 3 1 3 2 2 2 1 1 1 2 2 1 1 2 3 3 2 1 2 2 1 2 2 2 3 3 3 1 3 3 2 2 3 1 3 2 1 2 3 1 1 2 3 1 1 1 3

output:

32
0 3 19
1 4 21
2 6 23
7 13 27
9 15 28
10 18 29
12 20 36
17 22 40
30 31 41
32 37 45
33 43 47
34 48 50
35 52 55
38 53 56
39 54 57
42 58 60
44 59 61
46 62 66
49 65 69
51 67 76
5 24 81
63 68 82
8 25 83
64 70 85
11 26 87
73 79 88
74 80 89
14 71 91
75 84 92
77 86 93
78 90 94
16 72 95

result:

ok count=32

Test #84:

score: 0
Accepted
time: 31ms
memory: 16076kb

input:

3000
2 3 2 3 3 1 2 3 1 3 2 1 1 2 3 2 2 2 3 1 2 1 3 2 3 2 1 2 3 3 2 1 3 3 3 3 3 3 2 1 1 2 2 1 1 2 3 1 1 2 2 3 3 1 2 2 3 2 1 1 1 3 1 2 2 3 3 1 1 1 3 2 1 2 1 3 2 2 1 1 2 3 3 3 3 2 3 1 2 2 3 2 3 1 3 3 3 3 1 3 2 2 2 2 1 3 2 2 2 1 2 2 3 2 2 1 1 1 1 1 2 3 2 1 2 3 3 3 2 3 3 3 3 2 3 2 2 2 2 1 3 3 1 1 1 1 2 3...

output:

999
1 2 159
3 6 164
4 10 165
7 13 169
9 15 172
14 16 173
18 20 174
22 23 177
24 25 178
28 30 182
29 38 187
32 41 189
33 42 191
34 45 192
35 49 197
36 50 198
37 54 200
46 55 201
51 57 202
52 63 204
56 64 205
61 71 206
65 73 208
66 76 216
70 77 218
75 80 220
81 85 221
82 88 225
83 89 226
84 91 227
86 ...

result:

ok count=999

Test #85:

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

input:

2997
1 3 1 3 2 1 3 3 2 2 2 1 1 2 3 3 3 1 3 2 3 3 2 1 2 3 1 2 2 2 2 1 3 3 2 1 2 2 3 2 2 2 2 1 3 1 3 3 3 3 1 3 3 1 3 1 3 2 3 1 2 3 1 2 2 3 3 1 3 3 3 3 3 3 1 1 1 3 3 1 3 3 1 1 1 3 2 3 3 2 3 3 3 1 3 3 2 1 1 1 2 1 1 1 1 3 3 3 3 2 3 1 3 3 2 1 3 1 3 1 1 3 2 1 2 3 1 2 2 2 3 1 3 2 2 3 2 3 3 3 1 2 3 2 1 1 3 1...

output:

995
1 4 111
3 8 115
6 9 117
7 10 119
14 19 120
15 22 123
16 24 126
18 27 131
20 28 140
21 29 144
25 30 145
32 34 147
33 36 150
38 39 151
44 57 153
46 60 159
47 63 160
48 64 161
49 86 162
51 89 165
52 96 169
54 100 172
56 109 173
58 114 181
61 122 184
65 124 188
66 127 191
68 128 194
69 129 197
70 13...

result:

ok count=995

Test #86:

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

input:

18
2 1 2 2 2 2 1 3 1 3 3 3 2 2 2 2 3 2

output:

2
1 2 11
6 12 16

result:

ok count=2

Test #87:

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

input:

17
1 2 2 2 2 1 1 1 1 3 2 2 1 2 1 2 2

output:

1
9 10 14

result:

ok count=1

Test #88:

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

input:

16
1 2 2 2 2 3 3 1 3 3 2 2 2 2 3 2

output:

2
0 1 9
7 10 14

result:

ok count=2

Test #89:

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

input:

90
3 2 3 2 2 1 1 3 2 2 1 1 1 1 1 2 2 1 2 3 3 3 3 3 1 1 3 2 3 2 3 2 3 2 2 3 3 2 1 2 2 2 2 1 3 1 3 3 1 1 1 2 3 1 1 2 3 3 2 3 3 2 2 2 1 2 1 2 1 3 2 3 3 3 1 1 2 1 1 3 1 3 1 1 2 2 1 3 1 3

output:

29
0 1 17
2 3 24
7 8 25
19 27 38
20 29 43
21 31 45
22 33 48
23 34 49
26 37 50
28 39 53
30 40 54
32 41 64
35 42 66
36 51 68
5 9 72
6 15 73
44 55 74
46 58 75
47 61 77
52 62 78
10 16 79
56 63 80
11 18 81
57 65 82
59 67 83
60 70 86
12 76 87
69 84 88
13 85 89

result:

ok count=29

Test #90:

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

input:

15
2 3 3 2 1 3 2 1 1 1 3 2 3 1 2

output:

3
1 3 8
2 6 9
5 11 13

result:

ok count=3

Test #91:

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

input:

18
3 3 3 1 1 3 2 2 1 2 1 2 3 2 2 1 3 1

output:

6
0 6 8
1 7 10
3 9 12
2 11 15
4 13 16
5 14 17

result:

ok count=6

Test #92:

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

input:

16
1 3 3 2 1 3 1 2 2 2 3 1 3 2 1 2

output:

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

result:

ok count=5

Test #93:

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

input:

15
1 3 1 2 3 2 3 3 2 1 2 2 1 1 3

output:

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

result:

ok count=5

Test #94:

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

input:

18
1 3 1 3 2 1 1 3 2 2 2 3 2 3 2 1 1 3

output:

6
1 4 6
0 8 11
2 9 13
3 10 15
7 12 16
5 14 17

result:

ok count=6

Test #95:

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

input:

18
1 3 3 2 1 1 1 2 3 2 1 1 2 3 2 3 2 3

output:

6
1 3 6
2 7 10
8 9 11
0 12 13
4 14 15
5 16 17

result:

ok count=6

Test #96:

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

input:

18
1 2 1 2 3 2 3 3 2 2 3 1 1 3 3 1 2 1

output:

6
4 5 11
6 8 12
0 1 13
2 3 14
7 9 15
10 16 17

result:

ok count=6

Test #97:

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

input:

15
1 2 1 2 3 3 1 1 1 2 3 2 3 2 3

output:

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

result:

ok count=5

Test #98:

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

input:

18
3 2 1 2 1 3 3 1 1 3 2 1 2 3 2 1 2 3

output:

6
0 1 8
2 3 9
5 10 11
4 12 13
6 14 15
7 16 17

result:

ok count=6

Test #99:

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

input:

15
1 2 3 2 3 3 3 1 3 2 1 2 1 2 1

output:

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

result:

ok count=5

Test #100:

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

input:

91
2 1 2 2 1 3 1 2 1 2 2 1 2 3 3 1 2 2 2 1 3 1 3 1 1 3 1 2 1 2 1 3 1 1 3 2 3 1 2 3 2 2 2 2 1 2 1 1 3 2 2 2 1 1 2 3 3 2 3 3 3 3 1 1 3 2 3 3 1 3 3 3 3 3 2 1 2 2 2 3 2 3 2 1 3 1 3 1 3 1 1

output:

29
5 7 28
13 16 30
14 17 32
20 27 33
22 29 37
25 35 44
31 38 46
34 40 47
36 41 52
39 42 53
48 49 62
55 57 63
56 65 68
1 2 69
4 9 70
6 10 71
8 12 72
11 18 73
58 74 75
15 43 79
19 45 81
59 76 83
21 50 84
60 77 85
23 51 86
61 78 87
24 54 88
64 80 89
66 82 90

result:

ok count=29

Test #101:

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

input:

92
3 1 3 3 3 3 3 1 3 2 1 3 3 3 1 1 1 2 2 1 2 1 2 2 2 3 2 1 3 3 2 3 3 2 3 3 2 3 3 2 2 1 2 2 3 3 2 2 2 3 2 1 3 2 1 2 1 1 1 1 1 3 1 3 1 2 1 1 2 2 2 2 3 1 1 3 2 1 1 1 1 1 1 3 1 2 2 3 3 2 2 2

output:

29
0 9 16
2 17 19
3 18 21
4 20 27
5 22 41
6 23 51
8 24 54
11 26 56
12 30 57
13 33 58
25 36 59
28 39 60
29 40 62
31 42 64
32 43 66
34 46 67
35 47 73
37 48 74
1 50 75
38 53 77
44 55 78
45 65 79
49 68 80
52 69 81
61 70 82
7 71 83
63 76 84
10 85 87
14 86 88

result:

ok count=29

Test #102:

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

input:

93
1 1 3 1 1 3 1 1 2 3 1 1 1 2 3 3 2 1 1 3 1 3 3 2 3 3 1 3 2 2 3 3 1 3 1 1 1 2 2 3 1 2 3 1 3 3 2 3 2 3 2 3 2 3 2 3 3 2 1 3 2 2 1 1 1 2 1 1 2 2 2 1 1 2 3 1 2 2 3 3 2 1 2 2 1 2 2 2 2 3 3 2 2

output:

28
2 8 20
5 13 26
9 16 32
14 23 34
15 28 35
19 29 36
21 37 40
22 38 43
0 41 53
1 46 55
3 48 56
24 50 58
4 52 59
25 54 62
27 57 63
30 60 64
31 61 66
33 65 67
39 68 71
42 69 72
6 70 74
44 73 75
7 76 78
10 77 79
45 80 81
47 82 84
11 83 89
12 85 90

result:

ok count=28

Test #103:

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

input:

94
3 3 1 1 3 2 1 3 2 1 2 1 1 2 2 2 2 3 2 2 1 1 3 1 2 1 2 3 3 3 2 2 1 3 2 1 2 2 1 2 3 1 2 1 2 1 3 1 3 1 3 3 2 2 2 1 1 3 2 2 3 3 3 2 2 3 3 3 2 3 2 1 2 2 1 1 2 1 1 1 3 2 2 1 3 3 1 3 1 3 3 3 2 1

output:

30
0 5 21
1 8 23
4 10 25
7 13 32
17 18 35
22 24 38
27 30 41
28 31 43
29 34 45
33 36 47
40 42 49
46 52 55
48 53 56
50 54 71
51 58 74
57 59 75
60 63 77
61 64 78
62 68 79
2 14 80
65 70 83
3 15 84
6 16 85
66 72 86
9 19 87
67 73 88
11 26 89
12 37 90
20 39 91
69 76 93

result:

ok count=30

Test #104:

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

input:

94
3 2 3 2 1 2 1 3 3 2 1 3 2 3 1 3 2 1 2 2 2 3 3 1 3 3 1 2 1 1 1 2 3 2 1 2 2 2 2 2 3 1 3 3 2 3 3 3 1 1 1 2 1 1 1 3 3 3 1 1 3 1 3 1 2 3 3 2 1 1 2 3 2 1 2 2 3 1 3 3 1 1 1 3 2 3 1 2 2 2 2 3 1 1

output:

29
0 1 30
2 3 34
7 9 41
8 12 48
11 16 49
13 18 50
15 19 52
21 27 53
22 31 54
24 33 58
25 35 59
32 36 61
40 44 63
42 51 68
43 64 69
45 67 73
4 5 76
46 70 77
6 20 78
10 37 79
47 72 80
55 74 81
56 75 82
14 38 83
17 39 85
57 84 86
23 87 91
60 88 92
62 89 93

result:

ok count=29

Test #105:

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

input:

96
2 3 2 1 1 1 1 3 3 2 2 1 2 1 3 3 3 2 3 2 1 3 2 1 2 3 2 2 3 2 1 2 2 1 1 3 1 2 3 3 3 3 3 1 1 2 1 1 2 2 2 1 3 3 1 1 3 2 3 1 1 3 2 1 1 1 2 1 3 2 2 3 3 2 2 3 3 1 1 1 3 1 3 3 3 3 1 3 3 2 2 2 1 1 1 2

output:

28
1 2 30
7 9 33
8 10 34
14 17 36
15 19 43
16 22 44
18 24 46
21 26 47
25 27 51
28 29 54
35 37 55
38 45 59
39 48 60
40 49 63
41 50 64
42 57 65
52 62 67
53 66 77
56 69 78
58 70 79
61 73 81
3 12 85
68 74 86
4 31 87
5 32 88
71 89 92
72 90 93
75 91 94

result:

ok count=28

Test #106:

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

input:

98
2 3 2 1 2 2 1 3 3 3 2 1 3 1 1 2 2 2 2 1 1 2 2 1 2 1 3 2 1 3 3 1 2 1 2 1 1 3 2 1 2 3 1 2 3 3 3 3 2 2 3 1 3 2 1 1 1 3 3 1 3 2 2 1 3 1 3 3 3 1 1 2 1 1 2 3 2 3 2 1 3 1 1 2 3 1 3 3 2 3 3 1 3 1 3 1 3 2

output:

27
1 2 36
7 10 39
8 15 42
9 16 51
12 17 54
26 27 55
29 32 56
30 34 59
37 38 63
41 43 65
44 48 69
45 49 70
46 53 72
47 61 73
50 62 79
52 71 81
57 74 82
58 76 85
3 4 87
6 18 89
11 21 90
60 78 91
13 22 92
64 83 93
14 24 94
66 88 95
19 40 96

result:

ok count=27

Test #107:

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

input:

100
1 3 1 3 1 1 2 3 1 2 2 2 1 3 3 3 3 1 2 3 1 1 3 2 2 2 3 3 2 1 1 3 1 3 2 2 1 1 1 3 1 3 2 3 2 2 2 1 3 3 1 1 1 1 1 3 2 2 2 3 3 2 1 3 2 3 3 1 1 1 2 2 2 2 2 1 1 3 2 3 2 3 1 3 1 1 3 3 2 1 2 2 3 3 3 3 1 1 3 1

output:

30
1 6 21
3 9 29
7 10 30
13 18 32
14 23 36
15 24 37
16 25 38
19 28 40
22 34 47
26 35 50
27 42 51
31 44 52
33 45 53
39 46 54
41 56 62
43 57 67
48 58 68
49 61 69
55 64 75
59 70 76
60 71 82
63 72 84
65 73 85
66 74 89
0 11 94
2 78 95
77 80 96
79 88 97
4 90 98
81 91 99

result:

ok count=30

Test #108:

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

input:

100
1 1 1 1 1 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 2 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

1
0 29 58

result:

ok count=1

Test #109:

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

input:

100
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 1 2 2 2 2 2 2

output:

1
29 30 93

result:

ok count=1

Test #110:

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

input:

99
1 1 3 3 2 1 2 2 2 2 1 2 1 3 1 3 3 1 3 3 2 2 2 1 2 2 2 2 2 2 1 2 1 2 3 2 3 2 1 2 1 3 1 2 2 1 2 3 2 2 1 3 2 1 2 3 2 2 1 2 3 1 1 3 3 3 3 3 3 1 1 3 1 3 1 1 1 3 1 1 3 1 3 3 1 3 3 3 2 1 1 3 3 2 3 3 1 2 1

output:

33
2 4 61
3 6 62
0 7 65
1 8 66
5 9 67
10 11 68
13 20 69
15 21 70
12 22 71
16 24 72
14 25 73
18 26 74
19 27 75
34 35 76
17 28 77
36 37 78
41 43 79
23 29 80
47 48 81
30 31 82
32 33 83
51 52 84
38 39 85
40 44 86
42 46 87
55 56 89
60 88 90
45 49 91
50 54 92
53 57 94
58 59 95
63 93 96
64 97 98

result:

ok count=33

Test #111:

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

input:

96
3 2 1 2 3 1 2 1 2 1 2 2 1 1 2 2 3 2 1 3 2 2 1 2 3 2 1 2 3 3 3 3 1 2 2 2 2 2 1 1 1 1 3 1 2 1 1 3 3 1 3 3 1 3 3 1 1 1 3 3 3 1 3 1 1 3 3 1 3 3 3 3 2 1 2 3 2 3 2 3 2 1 2 1 2 3 2 3 2 1 2 3 2 1 2 1

output:

32
0 1 46
4 6 49
16 17 52
19 20 55
24 25 56
28 33 57
2 3 58
5 8 59
7 10 60
29 34 61
9 11 62
30 35 63
31 36 64
12 14 65
13 15 66
42 44 67
18 21 68
22 23 69
26 27 70
32 37 71
47 72 73
38 74 75
39 76 77
40 78 79
48 80 81
50 82 83
41 84 85
43 86 87
51 88 89
45 90 91
53 92 93
54 94 95

result:

ok count=32

Test #112:

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

input:

99
3 2 1 2 1 1 1 3 2 3 1 2 1 2 3 3 3 1 3 3 3 1 1 3 3 3 3 3 1 3 1 1 1 1 1 3 1 1 1 1 1 1 3 2 3 2 3 2 2 3 1 2 2 2 2 3 2 1 1 1 3 2 3 2 2 2 3 1 3 2 1 2 3 2 2 2 2 2 2 2 1 1 3 1 1 3 3 2 3 2 2 2 3 2 2 3 1 3 1

output:

33
2 3 35
0 1 39
7 8 40
9 11 41
4 13 42
5 43 44
6 45 46
10 47 49
14 48 50
12 51 55
15 52 57
16 53 58
18 54 59
17 56 60
21 61 62
22 63 66
19 64 67
28 65 68
20 69 70
30 71 72
23 73 80
24 74 81
31 75 82
25 76 83
26 77 84
32 78 85
33 79 86
34 87 88
36 89 92
37 90 95
27 91 96
38 93 97
29 94 98

result:

ok count=33

Test #113:

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

input:

93
3 2 3 2 3 2 1 2 3 2 3 2 3 2 3 1 3 1 3 1 1 1 3 3 1 3 3 3 1 1 3 1 1 1 3 3 1 3 3 1 2 2 3 1 1 2 3 2 1 3 3 1 3 2 2 2 2 2 2 2 3 2 3 3 1 1 1 3 1 2 2 3 1 2 1 2 1 2 3 2 2 1 1 2 2 2 2 2 3 1 1 1 1

output:

31
0 1 29
2 3 31
4 5 32
8 9 33
10 11 36
12 13 39
14 40 43
16 41 44
18 45 48
22 47 51
6 7 52
15 53 60
17 54 62
19 55 63
23 56 64
25 57 65
26 58 66
20 59 67
27 61 68
21 69 71
30 70 72
34 73 74
35 75 76
24 77 78
37 79 81
38 80 82
28 83 88
42 84 89
46 85 90
49 86 91
50 87 92

result:

ok count=31

Test #114:

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

input:

90
3 3 3 3 2 2 2 2 3 2 1 2 3 2 3 2 1 1 2 2 3 3 2 2 1 3 2 2 1 2 1 1 3 1 3 2 3 3 3 1 1 1 3 1 3 2 3 1 1 3 1 2 1 1 3 3 3 1 2 1 1 2 1 3 3 3 1 1 3 1 2 2 1 2 1 3 2 3 2 2 3 1 2 1 2 1 2 1 2 3

output:

30
0 4 40
1 5 41
2 6 43
3 7 47
8 9 48
12 13 50
14 15 52
20 22 53
10 11 56
21 23 57
25 26 59
32 35 60
34 45 62
16 18 63
17 19 64
24 27 65
36 51 66
37 58 67
28 29 68
38 61 69
42 70 72
44 71 74
30 73 75
31 76 77
33 78 80
46 79 81
49 82 83
54 84 85
55 86 87
39 88 89

result:

ok count=30

Test #115:

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

input:

100
2 1 2 2 2 3 2 2 1 2 1 2 2 1 2 2 2 2 1 2 2 3 2 2 2 2 2 1 2 2 2 3 3 1 1 1 1 1 1 1 3 3 3 1 1 3 1 1 1 1 3 3 3 1 3 3 3 1 1 3 1 3 1 3 3 3 2 3 2 2 1 2 2 3 2 2 2 2 2 2 3 1 2 1 1 1 1 2 2 3 2 2 3 2 2 2 2 1 2 2

output:

20
1 2 56
8 9 59
5 6 60
10 11 61
21 22 62
13 14 63
18 19 64
27 28 65
33 66 67
31 68 70
34 69 73
35 71 80
32 72 81
40 74 83
41 75 84
42 76 85
45 77 86
36 78 89
37 79 92
50 82 97

result:

ok count=20

Test #116:

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

input:

99
2 2 2 2 2 2 2 1 2 1 2 2 2 2 2 2 3 2 2 2 2 2 3 2 1 2 3 2 2 2 2 2 2 1 1 1 1 1 3 3 1 1 3 3 1 1 3 1 1 3 3 1 1 1 3 3 1 1 3 1 1 1 3 3 3 3 3 2 2 3 3 1 2 3 2 2 2 1 2 1 3 1 1 2 1 2 1 1 1 2 3 2 2 2 2 2 1 1 2

output:

18
16 17 59
22 23 60
26 27 61
7 8 70
38 67 71
9 10 73
39 68 77
42 72 79
24 25 80
43 74 81
46 75 82
49 76 84
50 78 86
54 83 87
55 85 88
33 89 90
58 91 96
62 92 97

result:

ok count=18

Test #117:

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

input:

98
3 2 2 2 2 2 2 3 3 2 2 2 1 2 1 2 2 2 2 2 2 3 1 3 1 3 2 3 2 1 2 2 1 1 1 3 3 3 3 1 3 1 1 1 3 3 1 3 3 3 1 3 1 3 3 1 3 3 1 1 3 3 3 3 2 2 2 2 2 2 2 2 2 1 3 2 2 2 3 2 2 2 2 3 2 1 2 2 2 2 2 2 2 2 2 2 2 1

output:

15
0 1 43
7 9 46
8 10 50
21 26 52
23 28 55
25 30 58
27 31 59
12 13 62
14 15 63
35 64 73
22 65 74
24 66 78
29 67 83
36 68 85
37 69 97

result:

ok count=15

Test #118:

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

input:

97
2 2 1 3 2 2 1 2 2 2 1 2 1 1 1 1 2 2 3 2 3 1 2 2 2 3 2 3 3 2 2 2 1 3 1 1 1 1 1 1 1 1 3 3 3 1 3 1 1 1 1 3 1 1 1 3 1 3 1 3 1 1 3 1 2 2 1 2 1 2 2 2 2 2 1 3 2 2 1 3 1 2 3 1 2 2 1 2 2 2 2 3 3 2 2 1 1

output:

21
3 4 54
18 19 56
20 22 58
25 26 60
27 29 61
2 5 62
28 30 63
33 64 66
42 65 68
43 67 74
6 7 75
44 69 78
10 11 79
46 70 80
12 16 82
51 71 83
55 72 86
13 17 91
14 23 92
57 73 95
59 76 96

result:

ok count=21

Test #119:

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

input:

99
1 1 1 1 1 1 1 1 1 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 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3

output:

33
0 33 66
1 34 67
2 35 68
3 36 69
4 37 70
5 38 71
6 39 72
7 40 73
8 41 74
9 42 75
10 43 76
11 44 77
12 45 78
13 46 79
14 47 80
15 48 81
16 49 82
17 50 83
18 51 84
19 52 85
20 53 86
21 54 87
22 55 88
23 56 89
24 57 90
25 58 91
26 59 92
27 60 93
28 61 94
29 62 95
30 63 96
31 64 97
32 65 98

result:

ok count=33

Test #120:

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

input:

99
3 2 3 3 1 2 1 1 1 1 2 2 3 1 3 1 3 3 2 3 3 2 3 3 1 2 3 3 1 1 1 2 1 1 1 1 3 1 1 2 1 2 1 2 3 3 2 3 1 2 2 1 2 3 3 3 1 3 2 2 2 2 2 2 2 2 3 3 1 2 2 2 1 3 3 1 3 2 2 3 2 2 3 2 1 2 1 3 1 3 3 1 2 1 1 3 1 3 1

output:

33
0 1 30
2 5 32
3 10 33
12 18 34
14 21 35
16 25 37
17 31 38
19 39 40
20 41 42
22 43 48
23 46 51
26 49 56
27 50 68
36 52 72
4 11 73
6 58 74
44 59 75
7 60 76
8 61 79
9 62 82
45 63 84
47 64 86
13 65 87
53 69 88
15 70 89
24 71 90
54 77 91
55 78 93
57 80 94
28 81 95
66 83 96
29 85 97
67 92 98

result:

ok count=33

Test #121:

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

input:

96
3 3 3 2 2 1 2 3 1 3 3 1 3 2 1 2 1 3 2 1 2 1 2 1 2 2 2 1 1 1 3 2 3 3 3 3 1 2 3 3 1 1 3 2 3 1 3 1 2 3 1 3 2 2 2 1 1 1 2 2 1 1 2 3 3 2 1 2 2 1 2 2 2 3 3 3 1 3 3 2 2 3 1 3 2 1 2 3 1 1 2 3 1 1 1 3

output:

32
0 3 19
1 4 21
2 6 23
7 13 27
9 15 28
10 18 29
12 20 36
17 22 40
30 31 41
32 37 45
33 43 47
34 48 50
35 52 55
38 53 56
39 54 57
42 58 60
44 59 61
46 62 66
49 65 69
51 67 76
5 24 81
63 68 82
8 25 83
64 70 85
11 26 87
73 79 88
74 80 89
14 71 91
75 84 92
77 86 93
78 90 94
16 72 95

result:

ok count=32

Test #122:

score: 0
Accepted
time: 32ms
memory: 16076kb

input:

3000
2 3 2 3 3 1 2 3 1 3 2 1 1 2 3 2 2 2 3 1 2 1 3 2 3 2 1 2 3 3 2 1 3 3 3 3 3 3 2 1 1 2 2 1 1 2 3 1 1 2 2 3 3 1 2 2 3 2 1 1 1 3 1 2 2 3 3 1 1 1 3 2 1 2 1 3 2 2 1 1 2 3 3 3 3 2 3 1 2 2 3 2 3 1 3 3 3 3 1 3 2 2 2 2 1 3 2 2 2 1 2 2 3 2 2 1 1 1 1 1 2 3 2 1 2 3 3 3 2 3 3 3 3 2 3 2 2 2 2 1 3 3 1 1 1 1 2 3...

output:

999
1 2 159
3 6 164
4 10 165
7 13 169
9 15 172
14 16 173
18 20 174
22 23 177
24 25 178
28 30 182
29 38 187
32 41 189
33 42 191
34 45 192
35 49 197
36 50 198
37 54 200
46 55 201
51 57 202
52 63 204
56 64 205
61 71 206
65 73 208
66 76 216
70 77 218
75 80 220
81 85 221
82 88 225
83 89 226
84 91 227
86 ...

result:

ok count=999

Test #123:

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

input:

2997
1 3 1 3 2 1 3 3 2 2 2 1 1 2 3 3 3 1 3 2 3 3 2 1 2 3 1 2 2 2 2 1 3 3 2 1 2 2 3 2 2 2 2 1 3 1 3 3 3 3 1 3 3 1 3 1 3 2 3 1 2 3 1 2 2 3 3 1 3 3 3 3 3 3 1 1 1 3 3 1 3 3 1 1 1 3 2 3 3 2 3 3 3 1 3 3 2 1 1 1 2 1 1 1 1 3 3 3 3 2 3 1 3 3 2 1 3 1 3 1 1 3 2 1 2 3 1 2 2 2 3 1 3 2 2 3 2 3 3 3 1 2 3 2 1 1 3 1...

output:

995
1 4 111
3 8 115
6 9 117
7 10 119
14 19 120
15 22 123
16 24 126
18 27 131
20 28 140
21 29 144
25 30 145
32 34 147
33 36 150
38 39 151
44 57 153
46 60 159
47 63 160
48 64 161
49 86 162
51 89 165
52 96 169
54 100 172
56 109 173
58 114 181
61 122 184
65 124 188
66 127 191
68 128 194
69 129 197
70 13...

result:

ok count=995

Test #124:

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

input:

3000
1 1 1 1 1 3 1 1 3 3 1 3 1 1 2 3 1 1 2 1 2 1 3 3 3 1 1 2 1 2 2 3 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 3 3 1 1 2 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 2 3 1 1 1 1 3 3 2 1 3 1 1 2 3 1 2 3 1 1 1 2 1 1 1 1 2 3 2 1 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 3 1 3 3 1 1 1 1 3 1 1 2 1 1 1 3 3 1 1 1 1 2 1 1 1 1 1 2 3 3 1...

output:

499
5 14 2313
8 18 2314
9 20 2318
11 27 2320
15 29 2321
22 30 2323
23 39 2324
24 46 2325
31 51 2326
47 54 2327
48 60 2328
72 79 2329
77 84 2330
78 87 2331
81 92 2332
85 97 2333
88 99 2334
98 105 2335
117 128 2336
119 138 2337
120 144 2338
125 148 2339
132 162 2341
133 167 2347
145 168 2348
146 176 2...

result:

ok count=499

Test #125:

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

input:

3000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

1
0 1374 2901

result:

ok count=1

Test #126:

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

input:

3000
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 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:

1
1755 1756 2819

result:

ok count=1

Test #127:

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

input:

1500
1 1 1 2 1 1 1 2 2 2 2 2 1 1 3 1 2 2 3 1 2 2 2 2 1 2 1 2 1 1 3 1 2 2 2 2 1 1 3 1 1 2 2 3 2 1 3 1 1 2 2 2 1 2 2 2 2 2 1 2 3 2 3 2 3 2 1 3 2 1 2 3 2 2 3 2 3 1 1 3 1 3 1 3 3 3 1 3 3 3 1 1 3 1 3 1 3 1 1 1 3 1 3 1 3 3 1 1 1 3 1 1 3 1 1 1 1 1 3 3 3 3 1 3 1 1 1 1 3 3 3 3 3 3 1 3 1 1 1 3 1 3 1 1 1 1 3 1...

output:

500
0 3 530
1 7 532
2 8 533
4 9 534
5 10 536
6 11 537
12 16 542
13 17 544
15 20 545
19 21 547
24 25 550
14 22 552
18 23 553
26 27 554
30 32 555
38 41 556
28 33 557
29 34 558
31 35 559
43 44 560
46 49 561
60 61 562
36 42 563
37 50 564
62 63 565
39 51 566
64 65 567
67 68 568
71 72 569
40 53 570
74 75 ...

result:

ok count=500

Test #128:

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

input:

3000
3 1 1 1 1 3 3 2 1 1 1 2 3 1 3 3 3 3 1 1 3 1 3 3 1 1 1 1 1 3 3 1 1 1 1 3 1 3 1 1 3 3 3 3 1 3 1 3 1 3 1 3 1 1 1 3 3 1 3 1 1 1 3 1 3 3 3 3 1 1 1 1 3 1 1 1 3 3 1 2 3 3 1 3 3 3 3 3 3 3 1 1 1 1 3 1 3 1 3 3 3 3 1 3 1 1 3 3 1 1 1 3 3 1 3 3 1 3 1 3 1 3 2 3 1 3 1 1 3 1 1 1 3 3 1 1 3 3 2 2 2 2 2 2 2 2 2 2...

output:

1000
0 7 1887
1 11 1888
5 79 1889
2 122 1890
6 138 1891
3 139 1892
4 140 1893
8 141 1894
9 142 1895
12 143 1896
10 144 1897
14 145 1899
13 146 1900
18 147 1901
19 148 1902
21 149 1903
15 150 1904
16 151 1905
24 152 1906
25 153 1907
17 154 1908
20 155 1909
22 156 1910
26 157 1911
23 158 1912
27 159 1...

result:

ok count=1000

Test #129:

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

input:

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

output:

1000
1 31 1598
4 32 1600
9 41 1606
12 51 1609
16 52 1610
17 53 1611
18 54 1617
19 55 1619
20 56 1621
23 57 1622
26 58 1623
28 59 1624
29 60 1627
33 61 1630
0 62 1632
2 63 1633
3 64 1634
5 65 1635
35 66 1636
6 67 1637
36 68 1638
37 69 1639
39 70 1640
7 71 1641
40 72 1642
42 73 1643
45 74 1644
46 75 1...

result:

ok count=1000

Test #130:

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

input:

2997
3 1 2 2 1 1 1 1 1 1 3 1 3 3 1 3 3 3 1 3 1 2 1 1 3 1 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 3 3 1 1 3 1 3 1 1 3 3 1 3 1 3 3 3 1 1 1 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 1 3 1 1 1 1 1 3 3 3 1 3 1 1 3 3 3 1 3 3 1 1 1 3 1 1 3 1 1 3 2 3 3 3 2 3 2 3 1 2 1 1 3 1 1 3 2 2 2 2...

output:

999
0 2 1213
10 21 1215
12 26 1216
13 27 1217
15 30 1218
16 31 1220
1 3 1221
17 32 1222
4 33 1223
5 34 1224
6 35 1225
19 36 1226
7 37 1227
24 38 1228
8 39 1229
9 40 1230
11 41 1231
51 73 1232
52 74 1233
14 42 1234
18 43 1235
20 44 1236
22 45 1237
55 75 1238
57 76 1239
60 77 1240
61 78 1241
23 46 124...

result:

ok count=999

Test #131:

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

input:

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

output:

998
0 2 1925
8 18 1926
1 4 1927
3 6 1928
5 7 1929
9 31 1930
14 39 1931
16 49 1932
17 51 1933
10 59 1934
11 61 1935
21 62 1936
26 63 1937
12 64 1938
27 65 1939
13 66 1940
28 67 1941
15 68 1942
19 69 1943
33 70 1944
35 71 1945
20 72 1946
22 73 1947
23 74 1948
38 75 1949
41 76 1950
24 77 1951
45 78 195...

result:

ok count=998

Test #132:

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

input:

3000
1 1 1 3 2 3 2 3 1 1 1 1 2 3 1 2 1 2 1 3 3 2 2 3 3 2 3 2 2 3 3 3 3 3 1 3 2 1 2 3 2 3 3 3 2 1 3 3 3 2 1 1 1 1 2 1 3 1 3 2 2 2 1 2 3 3 3 2 1 3 1 3 2 3 1 3 2 3 3 1 2 1 2 2 3 1 3 2 2 1 1 2 3 1 1 3 1 3 2 2 3 2 2 1 3 2 2 2 3 3 2 3 1 2 2 1 1 1 2 3 2 1 3 2 1 1 1 3 3 1 3 1 3 2 2 1 1 1 1 2 1 2 3 1 2 1 2 2...

output:

1000
3 4 125
5 6 126
7 12 129
13 15 131
19 21 135
20 22 136
23 25 137
24 27 138
26 28 140
29 36 143
30 38 145
31 40 148
32 44 152
33 49 153
35 54 155
39 59 157
41 60 162
42 61 163
43 63 164
46 67 167
47 72 172
48 76 175
56 80 176
58 82 177
64 83 180
65 87 184
66 88 187
69 91 188
71 98 191
73 99 207
...

result:

ok count=1000

Test #133:

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

input:

3000
2 2 1 3 2 2 2 3 2 2 2 2 2 1 2 2 2 2 2 1 3 2 2 2 2 3 2 2 2 2 2 2 1 3 2 2 2 2 2 2 2 2 2 2 1 3 2 2 2 1 2 3 2 3 1 2 2 3 2 3 2 2 2 1 2 2 2 2 2 2 2 2 2 1 2 2 3 2 2 1 2 3 2 1 3 3 2 3 2 2 2 3 1 2 2 2 2 1 2 3 3 1 2 1 1 2 2 2 1 2 2 2 2 2 2 1 2 3 1 2 1 2 2 3 2 2 2 2 2 2 2 2 2 3 1 2 2 2 2 3 2 3 3 1 2 2 1 2...

output:

673
2 4 1662
13 14 1668
19 21 1669
32 34 1670
44 46 1671
49 50 1672
54 55 1674
63 64 1675
73 74 1677
79 80 1678
83 86 1679
92 93 1683
3 5 1684
7 8 1685
20 22 1686
25 26 1687
33 35 1688
45 47 1689
97 98 1690
101 102 1691
103 105 1692
104 106 1693
108 109 1694
115 116 1695
51 52 1696
53 56 1697
118 11...

result:

ok count=673

Test #134:

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

input:

2999
2 2 3 3 2 1 2 1 1 2 2 3 2 3 2 3 2 2 2 1 2 3 2 2 2 2 1 3 2 3 3 2 1 2 3 2 2 2 2 1 2 2 2 2 2 3 2 2 3 1 2 2 2 3 2 2 2 3 3 2 2 2 3 3 3 2 1 1 2 2 2 1 2 2 1 1 2 2 2 2 2 1 2 2 2 3 2 2 3 3 3 1 1 2 2 3 2 2 2 1 2 2 2 2 2 2 2 2 1 2 2 2 1 2 3 3 1 1 2 2 2 2 1 1 2 2 3 2 3 2 3 2 2 2 3 2 2 2 1 2 1 3 2 3 2 2 2 1...

output:

683
2 4 1641
3 6 1642
11 12 1643
13 14 1645
15 16 1648
21 22 1649
5 9 1650
7 10 1651
8 17 1652
19 20 1653
26 28 1654
27 31 1655
32 33 1656
29 35 1657
39 40 1658
49 50 1659
66 68 1660
30 36 1661
67 69 1662
71 72 1663
74 76 1664
34 37 1665
45 46 1666
75 77 1667
81 82 1668
91 93 1669
92 94 1670
99 100 ...

result:

ok count=683

Test #135:

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

input:

2998
2 1 2 1 3 2 2 2 2 2 2 2 1 2 2 2 2 3 3 2 1 2 1 2 2 3 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 1 3 1 3 2 2 1 2 2 2 3 2 2 2 2 1 2 2 1 2 2 2 2 2 2 2 2 3 2 1 2 3 2 2 3 3 2 2 2 2 1 2 1 2 2 2 2 3 2 3 3 3 1 2 2 2 2 2 3 2 2 2 1 2 2 2 2 2 2 2 3 2 2 3 3 2 1 1 2 2 3 3 2 1 2 2 2 2 2 2 2 2 3 2 1 2 1 2 2 3 1 2 3 2 2 2 2...

output:

629
1 2 1652
3 5 1655
12 13 1656
20 21 1657
22 23 1658
34 35 1659
41 45 1661
43 46 1663
47 48 1665
56 57 1667
59 60 1668
70 71 1669
81 82 1670
83 84 1671
93 94 1672
103 104 1673
117 119 1683
118 120 1686
124 125 1688
135 136 1690
137 138 1695
141 142 1696
149 150 1697
154 155 1702
158 159 1703
162 1...

result:

ok count=629

Test #136:

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

input:

2997
1 1 3 2 3 3 2 2 1 2 2 2 2 2 2 1 3 3 2 2 2 3 2 2 2 2 3 2 1 3 2 3 2 3 2 3 3 2 2 2 2 2 2 2 1 1 2 2 3 3 2 1 2 2 3 3 2 2 1 1 1 2 1 2 1 2 2 1 2 1 3 1 3 3 1 2 2 2 2 2 2 1 2 2 2 3 2 2 3 2 2 1 2 2 3 2 1 2 2 2 3 2 2 1 3 1 2 2 2 1 3 2 2 1 2 3 2 3 1 3 2 2 3 2 2 2 2 1 2 2 2 1 1 2 3 2 2 2 3 2 3 1 2 2 3 2 2 2...

output:

712
0 3 1635
1 6 1637
8 9 1639
15 18 1641
28 30 1643
44 46 1644
45 47 1645
51 52 1648
2 7 1649
4 10 1650
5 11 1651
58 61 1652
59 63 1653
16 19 1654
60 65 1655
17 20 1656
21 22 1657
62 66 1658
64 68 1659
67 75 1660
69 76 1661
71 77 1662
26 27 1663
74 78 1664
81 82 1665
29 32 1666
91 92 1667
96 97 166...

result:

ok count=712

Test #137:

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

input:

3000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

1000
0 1000 2000
1 1001 2001
2 1002 2002
3 1003 2003
4 1004 2004
5 1005 2005
6 1006 2006
7 1007 2007
8 1008 2008
9 1009 2009
10 1010 2010
11 1011 2011
12 1012 2012
13 1013 2013
14 1014 2014
15 1015 2015
16 1016 2016
17 1017 2017
18 1018 2018
19 1019 2019
20 1020 2020
21 1021 2021
22 1022 2022
23 102...

result:

ok count=1000

Test #138:

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

input:

600000
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...

output:

1
0 2 599999

result:

ok count=1

Test #139:

score: 0
Accepted
time: 116ms
memory: 27344kb

input:

600000
1 1 3 1 2 1 2 3 2 1 1 2 3 2 2 1 2 1 1 3 2 1 1 2 1 3 3 3 1 2 3 3 1 1 1 3 1 3 2 2 1 3 3 2 3 2 3 2 2 2 1 1 1 1 2 3 1 1 1 2 1 1 1 3 3 3 3 3 1 1 3 2 3 2 2 3 2 1 2 3 2 1 3 3 3 3 3 1 1 1 3 3 1 1 1 3 3 2 2 1 2 3 2 2 3 3 2 2 2 2 3 1 1 2 1 1 2 1 1 3 3 3 1 3 3 1 2 2 3 2 2 1 2 1 1 1 1 2 1 2 1 3 1 2 2 1 3...

output:

200000
0 4 2334
1 6 2337
3 8 2339
5 11 2340
9 13 2341
10 14 2343
15 16 2352
17 20 2354
18 23 2355
21 29 2357
22 38 2362
24 39 2368
28 43 2377
32 45 2379
33 47 2382
34 48 2383
36 49 2385
40 54 2389
50 59 2390
51 71 2397
52 73 2399
53 74 2400
56 76 2402
57 78 2405
58 80 2406
60 97 2417
61 98 2420
62 1...

result:

ok count=200000

Test #140:

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

input:

600000
3 1 2 3 3 2 1 1 1 2 3 2 2 3 3 3 2 2 2 2 2 3 1 3 3 1 2 1 3 1 3 1 2 3 3 3 1 1 2 1 2 1 1 3 1 3 1 2 1 1 3 2 2 2 3 2 2 2 1 1 1 3 2 1 1 1 2 3 1 2 1 1 2 3 3 3 2 3 2 2 2 1 1 2 3 1 2 1 3 2 2 3 1 1 3 1 2 2 2 1 3 3 3 1 1 2 1 1 3 3 3 2 2 3 1 2 2 1 3 1 1 2 3 3 3 3 3 1 1 3 3 3 2 1 1 3 3 2 2 2 3 2 2 3 1 1 3...

output:

200000
1 2 1292
6 9 1298
7 11 1301
8 12 1307
22 26 1311
25 32 1312
27 38 1316
29 40 1318
31 47 1320
36 51 1322
37 52 1324
39 53 1327
41 55 1332
42 56 1333
44 57 1334
46 62 1337
48 66 1338
49 69 1344
58 72 1345
59 76 1346
60 78 1352
63 79 1354
64 80 1355
65 83 1356
68 86 1357
70 89 1361
71 90 1369
81...

result:

ok count=200000

Test #141:

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

input:

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

output:

4999
1 39 1594
2 54 1630
3 65 1682
4 105 1766
5 156 1768
6 240 1779
7 324 1790
8 377 1814
9 465 1885
10 500 1887
11 542 1944
12 550 1979
13 563 2082
14 568 2211
15 571 2216
16 613 2308
17 675 2372
18 686 2388
19 703 2395
20 744 2761
21 781 2841
22 792 2923
23 809 2961
24 849 3048
25 894 3071
26 979 ...

result:

ok count=4999

Test #142:

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

input:

15000
1 2 1 1 1 2 3 1 2 3 3 3 2 2 1 2 1 3 3 2 3 2 1 1 2 3 3 1 1 2 1 3 2 3 1 1 2 2 2 1 3 1 2 3 3 2 2 1 2 3 3 2 2 2 2 3 3 3 2 3 3 2 1 2 3 3 1 3 3 1 1 3 3 3 2 3 2 1 3 1 1 2 1 3 1 2 1 1 2 1 2 3 2 2 3 3 2 2 1 3 3 2 3 1 2 2 3 3 2 3 1 3 1 1 3 1 3 3 1 3 1 2 2 2 1 3 1 3 2 2 2 2 3 2 1 2 2 3 3 1 2 3 1 1 3 1 2 ...

output:

5000
0 1 264
2 5 268
3 8 278
4 12 279
7 13 280
14 15 283
16 19 284
22 24 285
23 29 286
27 32 289
28 36 290
30 37 291
34 38 293
35 42 295
39 45 296
41 46 300
47 48 301
62 63 312
66 74 314
69 76 315
70 81 316
77 85 317
79 88 319
80 90 324
82 92 328
84 93 332
86 96 335
87 97 336
89 101 337
98 104 339
1...

result:

ok count=5000

Test #143:

score: 0
Accepted
time: 101ms
memory: 27636kb

input:

600000
3 2 1 3 1 1 2 3 1 1 2 1 2 2 1 1 2 1 1 2 2 2 1 2 3 3 2 2 1 2 3 1 2 1 2 2 3 2 2 1 3 1 2 2 3 1 2 1 2 3 1 2 1 1 2 3 2 2 2 1 2 3 3 1 2 1 3 2 3 1 3 2 1 2 3 2 1 1 3 1 2 3 2 1 2 3 1 3 2 1 1 1 2 2 1 1 1 2 1 3 2 2 2 3 2 2 2 3 1 2 1 3 2 3 3 2 3 1 1 3 3 3 1 1 3 1 1 1 1 1 2 1 3 2 2 3 1 2 1 1 1 2 2 1 2 2 2...

output:

200000
2 6 1637
4 10 1640
5 12 1642
8 13 1643
9 16 1650
11 19 1656
14 20 1667
15 21 1669
17 23 1670
18 26 1672
22 27 1677
28 29 1683
31 32 1684
33 34 1689
39 42 1693
41 43 1694
45 46 1697
47 48 1699
50 51 1709
52 54 1716
53 56 1717
59 60 1725
63 64 1729
65 67 1730
69 71 1731
72 73 1733
76 80 1734
77...

result:

ok count=200000

Test #144:

score: 0
Accepted
time: 97ms
memory: 27844kb

input:

600000
1 1 3 3 1 1 3 1 3 1 3 3 1 3 3 1 3 3 1 3 1 3 3 3 3 1 3 1 3 3 1 1 1 1 3 1 1 3 3 1 3 1 1 1 3 3 3 3 1 3 1 3 1 3 3 1 1 3 3 3 3 3 1 1 1 1 3 1 1 3 3 3 3 1 1 1 3 1 3 3 1 1 3 1 3 1 1 3 1 1 3 3 3 3 1 1 3 3 1 1 3 3 1 1 1 1 3 3 3 1 1 1 1 1 3 1 1 3 1 1 3 1 1 3 1 3 1 3 3 1 3 3 1 1 1 1 3 1 3 3 3 3 1 3 3 1 1...

output:

200000
0 947 351466
1 2611 351468
4 3964 351469
5 8354 351470
7 8355 351471
9 11205 351478
12 11334 351479
15 11341 351480
18 11342 351482
20 11343 351486
25 11344 351487
27 11345 351490
30 11346 351493
31 11347 351494
32 11348 351496
33 11349 351499
35 11350 351502
36 11351 351503
39 11352 351506
4...

result:

ok count=200000

Test #145:

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

input:

600000
3 1 3 3 3 1 1 1 1 3 3 1 3 1 3 1 1 3 3 3 1 3 3 3 3 3 3 3 3 3 3 3 1 3 3 3 1 1 3 3 3 1 1 1 3 3 1 1 3 3 1 1 3 1 1 1 1 1 3 3 1 1 1 3 1 3 3 3 1 1 3 3 1 3 1 1 3 3 1 3 1 3 3 3 1 1 3 3 3 1 1 1 3 3 1 1 1 3 3 1 1 3 1 3 1 1 3 3 1 1 1 3 1 1 1 3 1 1 3 3 3 3 1 1 1 1 1 3 3 1 3 3 1 1 1 1 1 3 1 3 3 1 1 3 1 3 1...

output:

200000
0 6995 337988
2 8232 337989
3 9381 337990
4 10408 337994
9 10446 337996
10 10456 337997
12 10458 337998
14 10459 337999
17 10460 338001
18 10461 338002
19 10462 338003
21 10463 338006
22 10464 338007
23 10465 338010
24 10466 338013
25 10467 338015
26 10468 338017
27 10469 338018
28 10470 3380...

result:

ok count=200000

Test #146:

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

input:

600000
1 3 3 3 1 3 1 3 1 1 3 1 3 1 3 3 3 1 1 1 3 1 1 1 3 1 3 3 3 1 3 3 3 3 3 3 1 1 1 3 3 3 1 1 3 3 3 3 3 1 3 3 3 3 1 3 3 3 3 1 1 1 1 1 3 3 3 3 1 1 1 3 3 1 1 1 3 1 1 1 1 3 3 3 3 3 1 3 3 3 1 3 1 3 3 1 1 3 3 3 1 1 3 1 3 3 1 1 1 3 3 1 1 1 1 3 1 3 1 1 1 3 1 3 3 3 1 3 3 1 1 3 1 1 3 3 1 1 1 3 3 1 1 3 1 3 3...

output:

200000
1 619 342710
2 1022 342711
3 1263 342713
5 1717 342714
7 1759 342717
10 2438 342719
12 2469 342721
14 2499 342723
15 2521 342724
16 2523 342729
20 2525 342730
24 2526 342731
26 2527 342733
27 2528 342736
28 2529 342738
30 2530 342739
31 2531 342742
32 2532 342745
33 2533 342750
34 2534 342754...

result:

ok count=200000

Test #147:

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

input:

60000
1 1 1 3 3 1 3 3 1 1 1 3 1 3 1 3 1 3 1 1 1 1 3 3 1 1 1 3 1 1 3 1 1 3 3 1 3 3 3 1 1 1 3 1 1 3 1 1 1 3 3 3 3 3 1 3 3 1 1 1 1 1 1 3 3 1 1 1 3 1 1 3 1 1 1 3 3 3 3 1 1 1 1 1 3 3 3 1 3 3 1 3 3 1 3 1 3 3 1 1 3 1 3 1 3 1 3 1 3 3 3 3 3 3 1 1 3 3 3 1 1 1 1 1 1 1 3 3 3 3 1 1 3 3 3 3 3 3 3 1 1 1 3 3 3 3 1 ...

output:

20000
0 167 27463
1 289 27464
3 304 27465
2 348 27466
4 391 27467
5 397 27468
8 402 27469
9 406 27470
6 423 27471
10 428 27472
12 433 27473
14 434 27474
7 435 27475
16 436 27476
11 437 27477
13 438 27478
18 439 27479
19 440 27480
15 441 27481
17 442 27482
22 443 27484
23 444 27485
20 445 27486
27 44...

result:

ok count=20000

Test #148:

score: 0
Accepted
time: 13ms
memory: 20928kb

input:

90000
3 1 1 3 3 1 3 3 3 3 3 3 1 1 3 3 1 1 1 3 3 1 3 1 1 1 3 3 3 3 3 1 1 1 1 1 1 1 3 3 3 1 1 3 3 3 1 1 1 3 3 1 3 1 1 1 3 1 1 3 3 3 1 1 1 1 3 3 3 3 1 1 1 1 1 1 1 3 3 3 3 3 3 1 1 1 3 1 1 3 3 1 1 3 3 1 1 3 3 1 1 3 3 1 1 1 1 3 1 3 3 1 3 1 1 3 1 3 3 1 3 3 3 1 3 1 3 1 3 1 3 1 3 1 3 3 3 1 1 3 3 3 3 1 3 3 1 ...

output:

30000
1 254 31470
2 282 31471
5 283 31473
12 303 31474
13 304 31478
16 315 31479
17 319 31481
18 320 31482
21 321 31486
23 322 31487
24 323 31489
25 324 31490
31 325 31494
32 326 31496
33 327 31497
34 328 31498
35 329 31502
36 330 31503
37 331 31504
41 332 31506
42 333 31509
46 334 31511
47 335 3151...

result:

ok count=30000

Test #149:

score: 0
Accepted
time: 21ms
memory: 17180kb

input:

120000
3 3 1 3 3 3 3 3 3 1 3 1 1 3 1 1 1 3 1 3 3 3 3 3 1 1 1 1 1 1 1 3 3 1 3 3 3 1 1 1 3 3 1 1 1 3 1 1 3 1 1 3 3 1 3 1 1 1 1 1 1 3 1 3 1 3 1 1 3 1 3 3 3 3 1 1 1 1 3 3 3 3 3 3 3 3 1 1 3 1 1 1 3 1 3 3 1 1 1 3 1 3 3 3 3 3 3 3 3 3 1 3 3 1 3 3 1 1 3 3 1 1 3 3 1 1 1 3 1 3 3 3 3 1 1 3 1 3 3 1 1 1 1 3 1 3 1...

output:

40000
2 556 62541
9 819 62544
11 933 62545
12 947 62549
14 949 62551
15 970 62554
16 976 62556
18 993 62557
24 995 62558
25 997 62559
26 998 62560
27 999 62561
28 1000 62563
29 1001 62566
30 1002 62571
33 1003 62573
37 1004 62574
38 1005 62575
39 1006 62577
42 1007 62578
43 1008 62580
44 1009 62583
...

result:

ok count=40000

Test #150:

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

input:

150000
3 3 3 3 1 3 3 1 1 1 3 3 3 1 3 3 1 3 3 3 3 1 3 3 3 1 3 3 3 1 3 1 3 1 1 3 3 1 1 3 1 3 1 3 1 3 3 1 1 1 1 1 1 3 1 1 3 3 1 3 1 3 3 3 3 3 3 1 3 3 3 3 3 1 3 3 1 1 3 3 3 3 3 1 3 1 1 1 1 1 3 1 3 1 1 1 1 1 3 1 3 3 1 1 3 1 3 1 1 3 1 3 3 1 1 3 1 1 1 1 3 3 1 3 1 1 1 3 1 3 3 3 1 1 2 1 1 1 3 3 1 1 3 1 1 3 1...

output:

50000
4 134 95052
7 1872 95054
8 3709 95057
9 4402 95059
13 4591 95060
16 4600 95062
21 4601 95063
25 4654 95064
29 4658 95066
31 4664 95069
33 4666 95072
34 4668 95074
37 4669 95075
38 4670 95076
40 4671 95078
42 4672 95080
44 4673 95084
47 4674 95085
48 4675 95086
49 4676 95087
50 4677 95089
51 46...

result:

ok count=50000

Test #151:

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

input:

150000
1 1 1 1 3 1 3 3 1 1 1 1 1 1 3 3 1 3 1 1 1 3 1 3 3 3 3 3 3 3 1 3 1 3 1 1 1 3 1 1 3 3 3 3 3 1 1 1 1 3 3 1 3 1 1 3 3 1 1 1 3 3 1 3 3 3 3 1 3 3 1 1 3 3 1 1 3 1 3 3 1 1 1 3 3 1 3 1 1 1 3 3 3 1 1 1 1 3 3 1 3 3 3 3 1 1 1 3 1 1 1 3 1 1 1 1 1 3 1 3 1 1 1 3 3 1 3 3 1 3 3 1 3 3 3 3 1 3 3 3 3 1 3 3 3 3 1...

output:

50000
0 2483 66906
1 3463 66907
2 5543 66908
3 5668 66911
5 6350 66912
8 6434 66913
9 6437 66914
10 6446 66915
11 6449 66916
12 6450 66920
13 6451 66922
16 6452 66924
18 6453 66926
19 6454 66928
20 6455 66931
22 6456 66932
30 6457 66933
32 6458 66934
34 6459 66935
35 6460 66937
36 6461 66938
38 6462...

result:

ok count=50000

Test #152:

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

input:

150000
1 3 3 3 3 3 3 1 1 1 3 1 1 1 1 3 1 1 1 3 1 1 1 3 3 3 1 1 1 3 1 3 1 1 1 1 3 1 3 1 3 1 1 1 3 3 1 1 1 3 3 1 1 1 3 3 3 1 3 3 3 1 3 3 1 3 1 3 3 3 3 1 1 3 3 1 1 1 3 3 3 3 1 3 1 1 3 1 3 3 1 3 3 1 3 1 1 1 1 3 3 1 1 1 3 3 1 1 1 1 3 1 3 3 3 3 1 3 1 1 1 3 1 3 1 1 1 3 3 1 1 1 1 3 1 3 1 3 1 1 3 1 1 1 3 1 1...

output:

50000
0 995 91493
7 1072 91494
8 1337 91495
9 1349 91497
11 1392 91499
12 1402 91501
13 1403 91503
14 1404 91504
16 1405 91507
17 1406 91509
18 1407 91511
20 1408 91513
21 1409 91514
22 1410 91515
26 1411 91521
27 1412 91522
28 1413 91525
30 1414 91531
32 1415 91534
33 1416 91537
34 1417 91541
35 14...

result:

ok count=50000

Test #153:

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

input:

600000
2 2 2 3 2 1 1 3 2 2 2 3 3 1 2 2 2 2 2 3 2 2 2 3 1 1 3 2 2 2 3 1 2 2 2 2 2 1 2 2 1 1 2 2 2 2 2 3 2 3 2 1 1 2 2 1 2 2 2 2 3 2 1 2 2 3 2 2 2 1 2 2 3 2 2 1 1 2 2 1 2 1 2 1 2 2 2 1 3 3 3 1 2 2 2 2 2 2 2 3 2 2 3 2 2 1 2 2 2 2 2 2 2 1 2 2 2 1 2 3 2 2 2 2 3 2 2 2 2 2 1 2 2 1 2 2 2 3 2 1 2 1 2 2 3 1 2...

output:

133513
5 8 333212
6 9 333217
13 14 333222
24 27 333223
25 28 333226
31 32 333230
37 38 333232
40 42 333235
41 43 333242
51 53 333244
52 54 333245
55 56 333246
62 63 333247
69 70 333249
75 77 333251
76 78 333253
79 80 333254
81 82 333255
83 84 333258
87 92 333262
91 93 333263
105 106 333264
113 114 3...

result:

ok count=133513

Test #154:

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

input:

600000
2 2 2 2 3 1 2 3 2 2 2 1 1 2 2 2 2 2 2 2 2 1 3 2 3 1 3 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 3 1 2 1 2 2 2 3 2 2 2 1 1 3 2 3 3 3 3 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 1 3 3 2 2 3 2 2 3 2 2 3 2 2 2 2 2 3 2 2 2 1 1 2 2 2 2 3 2 1 2 1 2 2 2 1 2 2 2 2 1 2 2 2 1 1 2 2 2 2 2 1 2 2 2 2 1 1 3 2 2 2 2 2 3 2 3 3...

output:

133361
5 6 332954
11 13 332955
12 14 332956
21 23 332957
25 27 332959
33 34 332962
46 47 332964
48 49 332965
56 59 332967
57 64 332970
79 82 332971
100 102 332973
101 103 332976
108 109 332981
110 111 332982
114 115 332983
119 120 332985
123 125 332988
124 126 332989
130 131 332990
135 138 332991
13...

result:

ok count=133361

Test #155:

score: 0
Accepted
time: 71ms
memory: 27232kb

input:

600000
2 2 2 2 3 2 2 3 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 1 2 2 1 2 3 2 2 3 3 2 2 2 2 2 2 2 1 3 2 3 3 2 2 2 3 3 2 2 2 2 2 2 2 2 2 2 2 2 3 2 3 3 2 2 1 2 1 2 2 2 2 2 2 2 2 2 2 3 2 1 2 2 2 1 3 2 2 1 2 1 2 1 2 2 2 2 3 2 2 2 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 1 2 2 2 2 3 1 1...

output:

133217
27 29 333128
28 30 333129
31 32 333131
34 35 333132
48 50 333134
76 77 333135
78 79 333139
91 92 333140
95 97 333141
99 100 333142
101 102 333146
103 104 333147
115 116 333149
119 120 333156
123 124 333159
139 140 333160
145 147 333161
146 148 333162
158 159 333163
162 164 333164
163 165 3331...

result:

ok count=133217

Test #156:

score: 0
Accepted
time: 68ms
memory: 28148kb

input:

600000
2 2 2 2 2 2 3 3 2 2 3 3 3 1 2 2 1 2 2 2 2 2 2 2 2 2 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 1 1 2 2 2 2 2 2 2 2 2 2 2 1 2 3 2 2 2 2 3 1 3 2 3 2 1 1 2 2 2 1 2 2 2 2 2 3 2 2 2 2 1 2 2 2 2 3 2 1 2 2 3 2 3 2 2 2 2 3 2 3 2 2 2 2 2 2 1 3 2 2 2 2 1 2 2 2 3 1 3 2 2 1 1 2 1 2 2 2 1 1 2 3 1 3 3 2 2 1 2 3 1...

output:

133621
13 14 333274
16 17 333275
44 46 333277
45 47 333278
57 58 333279
65 67 333281
70 72 333287
71 73 333290
75 76 333291
86 87 333292
93 94 333294
112 114 333296
118 119 333298
123 125 333305
127 129 333308
128 131 333309
130 132 333312
134 136 333313
135 141 333314
138 142 333316
143 144 333318
...

result:

ok count=133621

Test #157:

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

input:

470000
2 2 1 3 2 1 1 2 3 3 2 2 2 2 3 2 2 3 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 3 2 2 3 2 2 2 2 2 2 2 2 3 2 2 2 2 3 2 2 2 1 2 3 2 3 3 3 2 3 2 2 2 2 3 1 2 3 2 1 1 2 2 2 2 2 2 3 3 2 1 2 1 2 2 2 3 2 2 2 2 3 2 2 3 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 3 3 3 2 2 3 1 3 2 2 2 2 2 1 3 2 2 1 2 2 2 2 2 2 2 2 1 3...

output:

104516
3 4 260864
8 10 260866
9 11 260867
14 15 260868
17 18 260869
22 23 260870
35 36 260873
38 39 260874
47 48 260876
52 53 260879
58 59 260881
60 63 260882
61 65 260886
62 66 260888
64 67 260889
69 71 260891
72 73 260892
82 84 260894
83 86 260897
91 92 260898
96 97 260902
99 100 260903
119 122 26...

result:

ok count=104516

Test #158:

score: 0
Accepted
time: 50ms
memory: 22080kb

input:

470000
2 2 2 2 2 3 1 2 2 2 2 2 2 2 2 2 1 1 3 2 1 3 2 2 2 2 2 3 2 3 1 3 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 3 2 2 2 2 2 1 1 2 1 2 2 1 3 2 2 2 3 3 2 2 2 2 2 2 2 2 3 2 2 3 2 2 1 2 2 2 2 2 1 2 2 3 2 1 1 2 3 3 2 2 3 2 3 2 2 2 3 1 3 1 2 2 2 2 2 2 1 2 2 2 3 2 2 3 2 2 2 2 1 3 3 2 1 2 1 2 3 2 1 1 3 3 2 3 2 2 2 2 1...

output:

104147
6 7 261154
16 19 261155
17 22 261156
20 23 261157
30 32 261158
38 39 261159
53 55 261160
54 57 261161
56 58 261162
59 61 261163
80 81 261165
86 87 261166
91 93 261170
92 96 261172
105 108 261176
107 109 261177
114 115 261178
126 129 261180
130 131 261181
132 133 261182
136 140 261186
137 142 ...

result:

ok count=104147

Test #159:

score: 0
Accepted
time: 48ms
memory: 23880kb

input:

470000
2 2 2 1 1 3 2 1 2 2 2 2 1 3 2 3 3 2 2 2 2 2 2 2 3 2 2 2 2 3 3 2 2 3 3 3 2 1 2 2 2 2 2 2 1 3 2 2 1 3 1 1 1 2 2 2 2 2 2 1 2 3 2 2 1 2 2 2 2 2 2 3 1 3 3 3 2 1 2 2 3 2 2 1 1 2 1 3 3 2 2 2 2 2 2 1 2 3 2 1 3 1 2 2 2 2 2 2 3 2 3 2 1 3 2 3 2 3 3 1 2 2 2 2 1 1 2 3 2 2 3 2 2 2 1 2 2 3 2 2 2 2 2 1 1 2 2...

output:

104570
5 6 260851
13 14 260852
15 17 260853
16 18 260858
24 25 260859
29 31 260860
30 32 260864
33 36 260865
34 38 260869
35 39 260871
45 46 260872
49 53 260874
61 62 260875
71 76 260878
73 78 260879
74 79 260881
75 81 260889
80 82 260892
87 89 260895
88 90 260906
97 98 260907
100 102 260910
108 109...

result:

ok count=104570

Test #160:

score: 0
Accepted
time: 55ms
memory: 23548kb

input:

469999
2 2 2 2 2 2 2 1 3 3 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 1 2 1 2 2 3 2 2 1 3 2 2 2 2 2 3 2 2 2 2 1 1 2 2 1 2 2 1 2 2 2 2 2 1 1 2 2 2 2 2 3 2 2 2 2 1 2 1 2 2 2 3 1 2 3 2 2 1 2 2 2 1 2 3 2 2 2 2 2 2 2 2 2 1 2 1 2 2 2 3 2 2 2 2 2 2 2 2 1 2 2 2 2 2 3 2 2 2 2 2 2 2 1 2 2 1 3 3 3 2 3 2 2 2 1 2 3 1 1 3 2 1...

output:

103891
8 10 260998
9 11 261002
18 19 261004
30 31 261008
34 35 261009
40 41 261010
65 66 261012
76 78 261013
79 80 261015
88 89 261020
104 105 261022
119 120 261024
131 134 261026
132 136 261029
133 137 261030
135 138 261032
141 145 261034
144 147 261035
148 150 261037
149 151 261038
154 155 261041
...

result:

ok count=103891

Test #161:

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

input:

600000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

1
0 120192 386125

result:

ok count=1

Test #162:

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

input:

149980
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 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:

1
77404 77405 96783

result:

ok count=1

Test #163:

score: 0
Accepted
time: 64ms
memory: 28116kb

input:

600000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

200000
0 200000 400000
1 200001 400001
2 200002 400002
3 200003 400003
4 200004 400004
5 200005 400005
6 200006 400006
7 200007 400007
8 200008 400008
9 200009 400009
10 200010 400010
11 200011 400011
12 200012 400012
13 200013 400013
14 200014 400014
15 200015 400015
16 200016 400016
17 200017 4000...

result:

ok count=200000

Test #164:

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

input:

600000
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:

1
0 1 599999

result:

ok count=1

Test #165:

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

input:

600000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

120000
0 240000 480000
1 240001 480001
2 240002 480002
3 240003 480003
4 240004 480004
5 240005 480005
6 240006 480006
7 240007 480007
8 240008 480008
9 240009 480009
10 240010 480010
11 240011 480011
12 240012 480012
13 240013 480013
14 240014 480014
15 240015 480015
16 240016 480016
17 240017 4800...

result:

ok count=120000

Test #166:

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

input:

6
1 2 3 2 3 1

output:

2
0 1 4
2 3 5

result:

ok count=2

Test #167:

score: 0
Accepted
time: 56ms
memory: 26396kb

input:

599700
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

197700
0 197700 402000
1 197701 402001
2 197702 402002
3 197703 402003
4 197704 402004
5 197705 402005
6 197706 402006
7 197707 402007
8 197708 402008
9 197709 402009
10 197710 402010
11 197711 402011
12 197712 402012
13 197713 402013
14 197714 402014
15 197715 402015
16 197716 402016
17 197717 4020...

result:

ok count=197700