QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#425325#6537. One, Two, ThreecrsfaaAC ✓68ms37412kbC++142.4kb2024-05-30 08:35:382024-05-31 09:43:20

Judging History

你现在查看的是最新测评结果

  • [2024-05-31 09:43:20]
  • 管理员手动重测该提交记录
  • 测评结果:AC
  • 用时:68ms
  • 内存:37412kb
  • [2024-05-30 08:35:38]
  • 提交

answer

#include<bits/stdc++.h>
#define Yukinoshita namespace
#define Yukino std
using Yukinoshita Yukino;
int read()
{
	int s=0;
	char ch=getchar();
	while(ch<'0'||ch>'9') ch=getchar();
	while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
	return s;
}
using vec=vector<int>;
stack<vec> A,C,AB,CB;
stack<vec> ABC,ACB,ABCB;
//CBAB A
//CBA AB
vec get(stack<vec> &a)
{
	vec res=a.top();
	a.pop();
	return res;
}
vec operator +(vec x,vec y)
{
	for(auto i:y) x.push_back(i);
	return x;
}
const int mxn=6e6+5;
char s[mxn];
/*
CABBCA

6
3 1 2 2 3 1

6
1 2 3 2 1 3
*/
int main()
{
	int n=read(),i;
	for(i=0;i<n;i++)
	{
		int x=s[i]=read()+'A'-1;
		if(x=='A')
		{
			if(CB.size())
				ABC.push(get(CB)+vec{i});
			else if(ACB.size())
			{
				vec tp=get(ACB);
				if(s[tp[0]]==x)
					ABC.push({tp[1],tp[2],i}),
					A.push({tp[0]});
				else
					ABC.push({tp[0],tp[2],i}),
					A.push({tp[1]});
			}
			else if(ABCB.size())
			{
				vec tp=get(ABCB);
				if(s[tp[0]]==x)
					AB.push({tp[0],tp[1]}),
					ABC.push({tp[2],tp[3],i});
				else
					AB.push({tp[2],tp[3]}),
					ABC.push({tp[0],tp[1],i});
			}
			else A.push({i});
		}
		if(x=='B')
		{
			if(A.size()&&C.size())
			{
				vec ta=get(A),tb=get(C);
				ACB.push({min(ta[0],tb[0]),max(ta[0],tb[0]),i}); 
			} 
			else if(A.size())
				AB.push(get(A)+vec{i});
			else if(C.size())
				CB.push(get(C)+vec{i});
			else if(ACB.size())
			{
				vec tp=get(ACB);
				if(s[tp[0]]=='A')
					AB.push({tp[0],i}),
					CB.push({tp[1],tp[2]});
				else
					CB.push({tp[0],i}),
					AB.push({tp[1],tp[2]});
			}
			else if(ABC.size())
				ABCB.push(get(ABC)+vec{i});
		}
		if(x=='C')
		{
			if(AB.size())
				ABC.push(get(AB)+vec{i});
			else if(ACB.size())
			{
				vec tp=get(ACB);
				if(s[tp[0]]==x)
					ABC.push({tp[1],tp[2],i}),
					C.push({tp[0]});
				else
					ABC.push({tp[0],tp[2],i}),
					C.push({tp[1]});
			}
			else if(ABCB.size())
			{
				vec tp=get(ABCB);
				if(s[tp[0]]==x)
					CB.push({tp[0],tp[1]}),
					ABC.push({tp[2],tp[3],i});
				else
					CB.push({tp[2],tp[3]}),
					ABC.push({tp[0],tp[1],i});
			}
			else C.push({i});
		}
	}
	printf("%d\n",ABC.size()+ABCB.size());
	for(;ABC.size();ABC.pop())
		printf("%d %d %d\n",ABC.top()[0],ABC.top()[1],ABC.top()[2]);
	for(;ABCB.size();ABCB.pop())
		printf("%d %d %d\n",ABCB.top()[0],ABCB.top()[1],ABCB.top()[2]);
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

6
3 1 2 2 3 1

output:

2
0 3 5
1 2 4

result:

ok count=2

Test #2:

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

input:

6
2 1 3 1 3 2

output:

0

result:

ok count=0

Test #3:

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

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
2995 2998 2999
2956 2992 2993
2983 2984 2985
2978 2980 2981
2968 2969 2970
2963 2965 2966
2960 2961 2962
2755 2758 2951
2760 2761 2940
2759 2762 2934
2765 2766 2931
2926 2928 2930
2855 2856 2927
2871 2872 2921
2873 2874 2919
2911 2912 2913
2885 2886 2909
2898 2900 2908
2884 2887 2899
2880 2881 2...

result:

ok count=499

Test #4:

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

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
1932 1933 2901

result:

ok count=1

Test #5:

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

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: 0ms
memory: 3752kb

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
101 1290 1499
152 1278 1498
103 1291 1497
106 1292 1496
151 1279 1495
150 1280 1494
107 1293 1493
108 1294 1492
110 1295 1491
111 1296 1490
113 1297 1489
149 1281 1488
114 1298 1487
148 1282 1486
146 1283 1485
115 1299 1484
141 1284 1483
139 1285 1482
135 1286 1481
116 1300 1480
133 1287 1479
11...

result:

ok count=500

Test #7:

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

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
2680 2974 2999
2669 2975 2998
2682 2973 2997
2699 2971 2996
2666 2976 2995
2662 2977 2994
2700 2991 2993
2701 2970 2992
2661 2978 2990
2659 2979 2989
2671 2980 2988
2681 2981 2987
2688 2985 2986
2684 2982 2984
2687 2972 2983
2703 2936 2969
2702 2937 2968
2697 2938 2967
2685 2965 2966
2698 2939 ...

result:

ok count=1000

Test #8:

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

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
1918 2935 2999
1869 2939 2998
1917 2936 2997
1916 2937 2996
1870 2940 2995
1871 2941 2994
1875 2942 2993
1876 2943 2992
1884 2944 2991
1914 2938 2990
1919 2934 2989
1921 2933 2988
1922 2932 2987
1923 2931 2986
1924 2930 2985
1885 2945 2984
1925 2929 2983
1928 2928 2982
1887 2946 2981
1888 2947 ...

result:

ok count=1000

Test #9:

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

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
958 2989 2996
983 2988 2995
959 2990 2994
961 2991 2993
1085 2987 2992
971 2985 2986
993 2983 2984
1044 2981 2982
1075 2753 2980
1021 2754 2979
1014 2755 2978
979 2756 2977
962 2757 2976
658 2814 2975
665 2815 2974
670 2816 2973
955 2758 2972
671 2817 2971
952 2759 2970
938 2760 2969
681 2813 29...

result:

ok count=999

Test #10:

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

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
2772 2989 2993
2797 2987 2992
2796 2988 2991
2798 2986 2990
2775 2984 2985
2776 2982 2983
2779 2980 2981
2801 2978 2979
2786 2970 2977
2800 2971 2976
2799 2974 2975
2778 2972 2973
2802 2968 2969
2804 2962 2967
2783 2965 2966
2803 2963 2964
2813 2960 2961
2820 2952 2959
2814 2955 2958
2781 2956 2...

result:

ok count=998

Test #11:

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

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
2995 2996 2999
2978 2979 2998
2988 2989 2997
2923 2924 2994
2926 2927 2993
2910 2915 2992
2888 2900 2991
2977 2980 2990
2871 2872 2987
2868 2875 2986
2968 2973 2985
2969 2972 2984
2898 2899 2983
2889 2897 2982
2891 2896 2981
2970 2971 2976
2887 2895 2975
2877 2878 2974
2908 2909 2967
2874 2904 ...

result:

ok count=1000

Test #12:

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

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
1919 2998 2999
1913 2131 2994
1904 2133 2992
1906 2132 2991
1887 2985 2988
1889 2986 2987
1891 2147 2984
1892 2144 2983
1870 2978 2980
1888 2152 2979
1871 2165 2971
1874 2163 2970
1873 2164 2968
1848 2965 2966
1845 2962 2963
1864 2169 2960
1839 2958 2959
1820 2950 2955
1827 2953 2954
1823 2951 2...

result:

ok count=673

Test #13:

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

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
1974 2939 2998
1951 2930 2931
1968 2034 2929
1960 2042 2924
1923 2918 2920
1939 2073 2919
1936 2076 2917
1919 2914 2915
1851 2171 2890
1828 2882 2888
1832 2886 2887
1831 2883 2885
1847 2173 2884
1841 2181 2881
1819 2874 2879
1820 2875 2878
1824 2876 2877
1812 2870 2871
1800 2866 2867
1801 2214 2...

result:

ok count=683

Test #14:

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

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
1987 2989 2990
1989 2005 2987
1986 2006 2985
1965 2978 2979
1963 2039 2977
1971 2028 2976
1955 2040 2973
1949 2969 2970
1913 2960 2965
1914 2961 2964
1915 2962 2963
1929 2083 2958
1911 2955 2957
1930 2082 2956
1885 2942 2947
1888 2945 2946
1887 2943 2944
1884 2940 2941
1899 2105 2938
1877 2936 2...

result:

ok count=629

Test #15:

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

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
1997 1998 2996
1974 2986 2987
1970 2984 2985
1941 2085 2980
1952 2063 2979
1942 2084 2977
1948 2067 2976
1951 2064 2975
1937 2968 2973
1949 2066 2972
1950 2065 2971
1940 2969 2970
1947 2074 2966
1946 2075 2964
1887 2955 2956
1884 2952 2953
1883 2151 2951
1878 2155 2949
1881 2152 2948
1834 2205 2...

result:

ok count=712

Test #16:

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

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
999 1000 2999
998 1001 2998
997 1002 2997
996 1003 2996
995 1004 2995
994 1005 2994
993 1006 2993
992 1007 2992
991 1008 2991
990 1009 2990
989 1010 2989
988 1011 2988
987 1012 2987
986 1013 2986
985 1014 2985
984 1015 2984
983 1016 2983
982 1017 2982
981 1018 2981
980 1019 2980
979 1020 2979
9...

result:

ok count=1000

Test #17:

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

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 3 2999

result:

ok count=1

Test #18:

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

input:

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

output:

3
9 11 12
5 6 7
2 3 4

result:

ok count=3

Test #19:

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

input:

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

output:

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

result:

ok count=6

Test #20:

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

input:

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

output:

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

result:

ok count=5

Test #21:

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

input:

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

output:

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

result:

ok count=5

Test #22:

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

input:

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

output:

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

result:

ok count=6

Test #23:

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

input:

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

output:

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

result:

ok count=6

Test #24:

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

input:

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

output:

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

result:

ok count=6

Test #25:

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

input:

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

output:

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

result:

ok count=5

Test #26:

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

input:

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

output:

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

result:

ok count=6

Test #27:

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

input:

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

output:

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

result:

ok count=5

Test #28:

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

input:

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

output:

2
6 15 16
1 2 7

result:

ok count=2

Test #29:

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

input:

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

output:

1
0 1 9

result:

ok count=1

Test #30:

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

input:

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

output:

2
0 1 5
7 13 14

result:

ok count=2

Test #31:

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

input:

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

output:

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

result:

ok count=5

Test #32:

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

input:

6
1 2 3 2 3 1

output:

2
2 3 5
0 1 4

result:

ok count=2

Test #33:

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

input:

6
2 1 3 3 1 2

output:

0

result:

ok count=0

Test #34:

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

input:

6
3 1 2 2 3 1

output:

2
0 3 5
1 2 4

result:

ok count=2

Test #35:

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

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
14985 14992 14993
13687 13688 14989
13643 13644 14988
12242 12243 14987
14972 14973 14986
14976 14978 14984
14980 14981 14983
13638 13639 14982
14975 14977 14979
12240 12241 14974
13474 13475 14971
13649 13650 14970
13689 13690 14969
13694 13695 14968
13697 13698 14967
13700 13701 14966
13606 1...

result:

ok count=4997

Test #36:

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

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
14995 14997 14998
14971 14972 14994
14990 14991 14992
14965 14966 14989
14968 14969 14988
14982 14983 14987
14967 14970 14986
14912 14919 14985
14946 14947 14984
14549 14550 14981
14561 14562 14980
14584 14585 14979
14814 14815 14978
14964 14973 14977
14948 14949 14976
14891 14892 14975
14921 1...

result:

ok count=4999

Test #37:

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

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
14987 14997 14998
14993 14994 14995
14960 14966 14989
14983 14986 14988
14978 14979 14985
14981 14982 14984
14975 14976 14977
14967 14968 14974
14949 14950 14973
14948 14951 14972
14969 14970 14971
14963 14964 14965
14941 14954 14962
14957 14959 14961
14943 14952 14958
14953 14955 14956
14879 1...

result:

ok count=4998

Test #38:

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

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
14187 14296 14999
14837 14838 14998
14831 14839 14997
14830 14840 14996
14983 14994 14995
14828 14841 14993
14989 14991 14992
14775 14851 14990
14984 14987 14988
14947 14951 14986
14980 14981 14985
14952 14955 14982
14940 14941 14979
14970 14971 14978
14858 14861 14977
14773 14862 14976
14973 1...

result:

ok count=5000

Test #39:

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

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
1502 14238 14999
1404 14265 14998
1405 14266 14997
1501 14239 14996
1406 14267 14995
1496 14240 14994
1415 14268 14993
1491 14241 14992
1417 14269 14991
1490 14242 14990
1489 14243 14989
1488 14244 14988
1419 14270 14987
1486 14245 14986
1423 14271 14985
1427 14272 14984
1428 14273 14983
1429 1...

result:

ok count=5000

Test #40:

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

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
6047 14968 14999
6062 14964 14998
6037 14966 14997
6110 14970 14996
7115 14956 14995
7092 14993 14994
6167 14971 14992
6031 14967 14991
6232 14972 14990
6247 14973 14989
6052 14965 14988
6061 14969 14987
6151 14963 14986
6193 14962 14985
6315 14959 14984
6249 14961 14983
6254 14960 14982
6282 1...

result:

ok count=5000

Test #41:

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

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
5901 14466 14999
5903 14465 14998
5904 14464 14997
5866 14467 14996
5907 14463 14995
5863 14468 14994
5861 14469 14993
5908 14462 14992
5913 14461 14991
5914 14460 14990
5860 14470 14989
5916 14459 14988
5858 14471 14987
5851 14472 14986
5918 14458 14985
5850 14473 14984
5869 14474 14983
5871 1...

result:

ok count=5000

Test #42:

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

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
1739 5881 5999
1774 5870 5998
1771 5871 5997
1768 5872 5996
1743 5882 5995
1767 5873 5994
1745 5883 5993
1759 5884 5992
1766 5874 5991
1764 5875 5990
1769 5885 5989
1763 5876 5988
1760 5877 5987
1770 5886 5986
1773 5887 5985
1757 5878 5984
1755 5879 5983
1754 5880 5982
1775 5888 5981
1777 5869 ...

result:

ok count=2000

Test #43:

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

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
4002 8941 8999
4260 8940 8998
4276 8939 8997
4098 8942 8996
4108 8943 8995
4287 8938 8994
4111 8944 8993
4918 8922 8992
4805 8990 8991
4116 8945 8989
4128 8946 8988
4132 8947 8987
4169 8948 8986
4311 8937 8985
4273 8949 8984
4290 8950 8983
4302 8951 8982
4337 8936 8981
4310 8952 8980
4313 8953 ...

result:

ok count=3000

Test #44:

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

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
8204 11981 11999
8386 11977 11998
8352 11978 11997
8328 11979 11996
8235 11982 11995
8285 11980 11994
8287 11983 11993
8304 11984 11992
8396 11976 11991
8422 11975 11990
8394 11987 11989
8541 11972 11988
8432 11974 11986
8497 11973 11985
8797 11830 11971
8564 11831 11970
8303 11832 11969
8536 1...

result:

ok count=4000

Test #45:

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

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
3544 14972 14999
3967 14971 14998
4047 14970 14997
4695 14964 14996
3590 14973 14995
4891 14963 14994
3665 14974 14993
4098 14988 14992
5244 14989 14991
5369 14962 14990
3972 14986 14987
4684 14965 14985
3743 14975 14984
3888 14982 14983
4422 14969 14981
4442 14968 14980
4490 14967 14979
4491 1...

result:

ok count=5000

Test #46:

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

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
6703 14854 14999
6537 14861 14998
6697 14855 14997
6662 14856 14996
6552 14862 14995
6648 14857 14994
6642 14858 14993
6578 14863 14992
6598 14864 14991
6657 14865 14990
6661 14866 14989
6669 14867 14988
6626 14859 14987
6680 14868 14986
6625 14860 14985
6710 14853 14984
6687 14869 14983
6729 1...

result:

ok count=5000

Test #47:

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

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
3955 14861 14999
4022 14854 14998
3970 14862 14997
4012 14855 14996
3982 14863 14995
4029 14864 14994
4010 14856 14993
3987 14857 14992
3985 14858 14991
3952 14859 14990
4060 14865 14989
4062 14866 14988
3917 14860 14987
4096 14867 14986
4023 14853 14985
4044 14852 14984
4131 14868 14983
4080 1...

result:

ok count=5000

Test #48:

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

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
9964 10049 14999
9970 10047 14998
9971 10046 14995
9882 14899 14900
9880 14896 14897
9885 10115 14895
9873 14890 14891
9863 14886 14888
9869 10136 14887
9851 10149 14881
9839 14877 14878
9822 10177 14871
9828 10175 14870
9826 10176 14868
9816 14865 14866
9806 14862 14863
9779 10223 14850
9773 1...

result:

ok count=3267

Test #49:

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

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
9940 10058 14999
9931 10073 14993
9912 10091 14984
9878 14979 14980
9875 14974 14978
9906 10097 14977
9876 14975 14976
9869 14971 14972
9892 10105 14968
9889 10107 14965
9888 10108 14963
9866 10130 14958
9837 14954 14955
9823 14952 14953
9854 10146 14951
9805 14945 14946
9802 14943 14944
9832 1...

result:

ok count=3340

Test #50:

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

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
9230 13782 13999
9247 13792 13982
9236 13786 13981
9050 9622 13682
8961 13678 13679
9045 9627 13677
8943 13670 13672
9033 9643 13671
8932 13658 13667
9025 9650 13666
8936 13664 13665
8933 13659 13663
8934 13660 13662
9023 9653 13661
8909 13652 13653
8906 13646 13651
8907 13647 13650
9005 9676 1...

result:

ok count=3042

Test #51:

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

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
8588 8793 12999
8593 8788 12994
8614 8774 12993
8665 8668 12980
8666 8667 12979
8661 8706 12967
8637 8759 12965
8616 8773 12962
8597 8785 12959
8600 8784 12958
8589 12955 12957
8602 8779 12956
8596 8786 12952
8595 8787 12950
8571 12947 12948
8566 12944 12945
8553 12937 12938
8541 12930 12934
85...

result:

ok count=2941

Test #52:

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

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
7322 7340 10999
7328 7335 10998
7288 10965 10966
7279 10959 10960
7268 10952 10953
7262 10948 10949
7251 7411 10944
7245 7415 10940
7246 7414 10939
7235 7430 10934
7213 10930 10931
7232 7433 10929
7229 7434 10927
7209 10923 10925
7227 7435 10924
7201 10921 10922
7214 7452 10919
7197 7463 10911
...

result:

ok count=2460

Test #53:

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

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
7202 10879 10880
7215 7450 10875
7192 10871 10872
7188 10868 10869
7172 10862 10863
7171 7476 10859
7162 10855 10856
7159 7492 10853
7149 10849 10851
7153 7495 10850
7146 10846 10848
7151 7496 10847
7137 10840 10841
7130 10836 10837
7127 10834 10835
7119 7516 10830
7120 10828 10829
7113 7522 10...

result:

ok count=2423

Test #54:

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

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
7163 10996 10997
7220 7471 10994
7214 7480 10988
7141 10985 10986
7115 10971 10978
7117 10976 10977
7185 7520 10975
7188 7519 10974
7116 10972 10973
7161 7540 10969
7157 7559 10966
7158 7542 10965
7098 10963 10964
7144 7563 10961
7153 7562 10960
7081 10954 10955
7063 10950 10951
7100 7605 10946...

result:

ok count=2372

Test #55:

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

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
7293 7382 10995
7292 7383 10993
7261 10987 10990
7274 7404 10989
7279 7403 10988
7242 10980 10981
7240 10976 10979
7241 10977 10978
7234 10972 10973
7231 7436 10964
7225 7465 10960
7211 7473 10958
7221 7470 10957
7190 10953 10954
7176 10951 10952
7135 10939 10940
7134 10937 10938
7140 7557 1093...

result:

ok count=2490

Test #56:

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

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 8259

result:

ok count=1

Test #57:

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

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: 2ms
memory: 4308kb

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
4999 5000 14999
4998 5001 14998
4997 5002 14997
4996 5003 14996
4995 5004 14995
4994 5005 14994
4993 5006 14993
4992 5007 14992
4991 5008 14991
4990 5009 14990
4989 5010 14989
4988 5011 14988
4987 5012 14987
4986 5013 14986
4985 5014 14985
4984 5015 14984
4983 5016 14983
4982 5017 14982
4981 50...

result:

ok count=5000

Test #59:

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

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 14998

result:

ok count=1

Test #60:

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

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
5999 6000 11999
5998 6001 11998
5997 6002 11997
5996 6003 11996
5995 6004 11995
5994 6005 11994
5993 6006 11993
5992 6007 11992
5991 6008 11991
5990 6009 11990
5989 6010 11989
5988 6011 11988
5987 6012 11987
5986 6013 11986
5985 6014 11985
5984 6015 11984
5983 6016 11983
5982 6017 11982
5981 60...

result:

ok count=3000

Test #61:

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

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
4976 4977 14952
4975 4978 14951
4974 4979 14950
4973 4980 14949
4972 4981 14948
4971 4982 14947
4970 4983 14946
4969 4984 14945
4968 4985 14944
4967 4986 14943
4966 4987 14942
4965 4988 14941
4964 4989 14940
4963 4990 14939
4962 4991 14938
4961 4992 14937
4960 4993 14936
4959 4994 14935
4958 49...

result:

ok count=4977

Test #62:

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

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

result:

ok count=29

Test #63:

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

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

result:

ok count=29

Test #64:

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

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

result:

ok count=28

Test #65:

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

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

result:

ok count=30

Test #66:

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

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

result:

ok count=29

Test #67:

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

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

result:

ok count=28

Test #68:

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

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

result:

ok count=27

Test #69:

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

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

result:

ok count=30

Test #70:

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

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
50 51 58

result:

ok count=1

Test #71:

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

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
86 87 93

result:

ok count=1

Test #72:

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

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

result:

ok count=33

Test #73:

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

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

result:

ok count=32

Test #74:

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

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

result:

ok count=33

Test #75:

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

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

result:

ok count=31

Test #76:

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

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

result:

ok count=30

Test #77:

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

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
50 90 97
46 91 92
48 88 89
59 75 86
56 76 85
55 77 84
52 82 83
54 78 81
44 79 80
57 72 73
64 69 70
62 66 67
1 2 45
8 9 42
27 28 41
18 19 40
5 6 34
21 22 33
10 11 32
13 14 31

result:

ok count=20

Test #78:

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

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
50 94 97
49 95 96
88 89 90
62 85 86
65 83 84
66 74 81
57 75 80
63 78 79
64 76 77
71 72 73
61 67 70
60 68 69
7 8 42
24 25 39
9 10 38
16 17 35
22 23 34
26 27 33

result:

ok count=18

Test #79:

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

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
63 64 97
41 75 78
42 71 74
51 72 73
27 28 39
29 30 36
24 31 35
7 10 34
0 1 33
25 26 32
12 13 23
8 9 22
14 15 21
43 70 83
54 84 85

result:

ok count=15

Test #80:

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

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
50 89 92
49 90 91
80 81 82
53 77 79
54 73 75
62 64 68
59 65 66
2 5 57
6 7 55
15 16 51
10 11 46
21 22 44
14 17 43
13 19 42
20 23 38
18 24 37
25 26 36
28 29 35
27 30 34
12 31 33
3 4 32

result:

ok count=21

Test #81:

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

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

result:

ok count=33

Test #82:

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

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

result:

ok count=33

Test #83:

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

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

result:

ok count=32

Test #84:

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

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
2994 2996 2998
2992 2993 2995
2919 2983 2991
2842 2984 2990
2841 2985 2989
2920 2987 2988
2981 2982 2986
2937 2965 2980
2925 2978 2979
2927 2966 2977
2852 2969 2976
2846 2970 2975
2845 2971 2974
2844 2972 2973
2910 2967 2968
2923 2963 2964
2947 2961 2962
2954 2955 2960
2951 2958 2959
2945 2956 2...

result:

ok count=999

Test #85:

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

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
2449 2995 2996
2478 2992 2993
2493 2989 2990
2824 2985 2988
2491 2986 2987
2576 2973 2984
2515 2976 2983
2494 2979 2982
2700 2980 2981
2514 2977 2978
2568 2974 2975
2968 2969 2970
2958 2959 2966
2912 2964 2965
2589 2962 2963
2918 2960 2961
2932 2938 2957
2913 2945 2956
2864 2946 2955
2910 2947 2...

result:

ok count=995

Test #86:

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

input:

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

output:

2
6 15 16
1 2 7

result:

ok count=2

Test #87:

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

input:

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

output:

1
0 1 9

result:

ok count=1

Test #88:

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

input:

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

output:

2
0 1 5
7 13 14

result:

ok count=2

Test #89:

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

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

result:

ok count=29

Test #90:

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

input:

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

output:

3
9 11 12
5 6 7
2 3 4

result:

ok count=3

Test #91:

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

input:

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

output:

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

result:

ok count=6

Test #92:

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

input:

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

output:

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

result:

ok count=5

Test #93:

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

input:

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

output:

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

result:

ok count=5

Test #94:

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

input:

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

output:

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

result:

ok count=6

Test #95:

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

input:

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

output:

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

result:

ok count=6

Test #96:

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

input:

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

output:

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

result:

ok count=6

Test #97:

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

input:

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

output:

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

result:

ok count=5

Test #98:

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

input:

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

output:

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

result:

ok count=6

Test #99:

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

input:

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

output:

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

result:

ok count=5

Test #100:

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

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

result:

ok count=29

Test #101:

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

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

result:

ok count=29

Test #102:

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

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

result:

ok count=28

Test #103:

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

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

result:

ok count=30

Test #104:

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

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

result:

ok count=29

Test #105:

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

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

result:

ok count=28

Test #106:

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

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

result:

ok count=27

Test #107:

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

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

result:

ok count=30

Test #108:

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

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
50 51 58

result:

ok count=1

Test #109:

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

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
86 87 93

result:

ok count=1

Test #110:

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

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

result:

ok count=33

Test #111:

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

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

result:

ok count=32

Test #112:

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

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

result:

ok count=33

Test #113:

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

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

result:

ok count=31

Test #114:

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

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

result:

ok count=30

Test #115:

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

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
50 90 97
46 91 92
48 88 89
59 75 86
56 76 85
55 77 84
52 82 83
54 78 81
44 79 80
57 72 73
64 69 70
62 66 67
1 2 45
8 9 42
27 28 41
18 19 40
5 6 34
21 22 33
10 11 32
13 14 31

result:

ok count=20

Test #116:

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

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
50 94 97
49 95 96
88 89 90
62 85 86
65 83 84
66 74 81
57 75 80
63 78 79
64 76 77
71 72 73
61 67 70
60 68 69
7 8 42
24 25 39
9 10 38
16 17 35
22 23 34
26 27 33

result:

ok count=18

Test #117:

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

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
63 64 97
41 75 78
42 71 74
51 72 73
27 28 39
29 30 36
24 31 35
7 10 34
0 1 33
25 26 32
12 13 23
8 9 22
14 15 21
43 70 83
54 84 85

result:

ok count=15

Test #118:

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

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
50 89 92
49 90 91
80 81 82
53 77 79
54 73 75
62 64 68
59 65 66
2 5 57
6 7 55
15 16 51
10 11 46
21 22 44
14 17 43
13 19 42
20 23 38
18 24 37
25 26 36
28 29 35
27 30 34
12 31 33
3 4 32

result:

ok count=21

Test #119:

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

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

result:

ok count=33

Test #120:

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

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

result:

ok count=33

Test #121:

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

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

result:

ok count=32

Test #122:

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

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
2994 2996 2998
2992 2993 2995
2919 2983 2991
2842 2984 2990
2841 2985 2989
2920 2987 2988
2981 2982 2986
2937 2965 2980
2925 2978 2979
2927 2966 2977
2852 2969 2976
2846 2970 2975
2845 2971 2974
2844 2972 2973
2910 2967 2968
2923 2963 2964
2947 2961 2962
2954 2955 2960
2951 2958 2959
2945 2956 2...

result:

ok count=999

Test #123:

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

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
2449 2995 2996
2478 2992 2993
2493 2989 2990
2824 2985 2988
2491 2986 2987
2576 2973 2984
2515 2976 2983
2494 2979 2982
2700 2980 2981
2514 2977 2978
2568 2974 2975
2968 2969 2970
2958 2959 2966
2912 2964 2965
2589 2962 2963
2918 2960 2961
2932 2938 2957
2913 2945 2956
2864 2946 2955
2910 2947 2...

result:

ok count=995

Test #124:

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

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
2995 2998 2999
2956 2992 2993
2983 2984 2985
2978 2980 2981
2968 2969 2970
2963 2965 2966
2960 2961 2962
2755 2758 2951
2760 2761 2940
2759 2762 2934
2765 2766 2931
2926 2928 2930
2855 2856 2927
2871 2872 2921
2873 2874 2919
2911 2912 2913
2885 2886 2909
2898 2900 2908
2884 2887 2899
2880 2881 2...

result:

ok count=499

Test #125:

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

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
1932 1933 2901

result:

ok count=1

Test #126:

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

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: 1ms
memory: 3820kb

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
101 1290 1499
152 1278 1498
103 1291 1497
106 1292 1496
151 1279 1495
150 1280 1494
107 1293 1493
108 1294 1492
110 1295 1491
111 1296 1490
113 1297 1489
149 1281 1488
114 1298 1487
148 1282 1486
146 1283 1485
115 1299 1484
141 1284 1483
139 1285 1482
135 1286 1481
116 1300 1480
133 1287 1479
11...

result:

ok count=500

Test #128:

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

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
2680 2974 2999
2669 2975 2998
2682 2973 2997
2699 2971 2996
2666 2976 2995
2662 2977 2994
2700 2991 2993
2701 2970 2992
2661 2978 2990
2659 2979 2989
2671 2980 2988
2681 2981 2987
2688 2985 2986
2684 2982 2984
2687 2972 2983
2703 2936 2969
2702 2937 2968
2697 2938 2967
2685 2965 2966
2698 2939 ...

result:

ok count=1000

Test #129:

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

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
1918 2935 2999
1869 2939 2998
1917 2936 2997
1916 2937 2996
1870 2940 2995
1871 2941 2994
1875 2942 2993
1876 2943 2992
1884 2944 2991
1914 2938 2990
1919 2934 2989
1921 2933 2988
1922 2932 2987
1923 2931 2986
1924 2930 2985
1885 2945 2984
1925 2929 2983
1928 2928 2982
1887 2946 2981
1888 2947 ...

result:

ok count=1000

Test #130:

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

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
958 2989 2996
983 2988 2995
959 2990 2994
961 2991 2993
1085 2987 2992
971 2985 2986
993 2983 2984
1044 2981 2982
1075 2753 2980
1021 2754 2979
1014 2755 2978
979 2756 2977
962 2757 2976
658 2814 2975
665 2815 2974
670 2816 2973
955 2758 2972
671 2817 2971
952 2759 2970
938 2760 2969
681 2813 29...

result:

ok count=999

Test #131:

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

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
2772 2989 2993
2797 2987 2992
2796 2988 2991
2798 2986 2990
2775 2984 2985
2776 2982 2983
2779 2980 2981
2801 2978 2979
2786 2970 2977
2800 2971 2976
2799 2974 2975
2778 2972 2973
2802 2968 2969
2804 2962 2967
2783 2965 2966
2803 2963 2964
2813 2960 2961
2820 2952 2959
2814 2955 2958
2781 2956 2...

result:

ok count=998

Test #132:

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

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
2995 2996 2999
2978 2979 2998
2988 2989 2997
2923 2924 2994
2926 2927 2993
2910 2915 2992
2888 2900 2991
2977 2980 2990
2871 2872 2987
2868 2875 2986
2968 2973 2985
2969 2972 2984
2898 2899 2983
2889 2897 2982
2891 2896 2981
2970 2971 2976
2887 2895 2975
2877 2878 2974
2908 2909 2967
2874 2904 ...

result:

ok count=1000

Test #133:

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

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
1919 2998 2999
1913 2131 2994
1904 2133 2992
1906 2132 2991
1887 2985 2988
1889 2986 2987
1891 2147 2984
1892 2144 2983
1870 2978 2980
1888 2152 2979
1871 2165 2971
1874 2163 2970
1873 2164 2968
1848 2965 2966
1845 2962 2963
1864 2169 2960
1839 2958 2959
1820 2950 2955
1827 2953 2954
1823 2951 2...

result:

ok count=673

Test #134:

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

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
1974 2939 2998
1951 2930 2931
1968 2034 2929
1960 2042 2924
1923 2918 2920
1939 2073 2919
1936 2076 2917
1919 2914 2915
1851 2171 2890
1828 2882 2888
1832 2886 2887
1831 2883 2885
1847 2173 2884
1841 2181 2881
1819 2874 2879
1820 2875 2878
1824 2876 2877
1812 2870 2871
1800 2866 2867
1801 2214 2...

result:

ok count=683

Test #135:

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

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
1987 2989 2990
1989 2005 2987
1986 2006 2985
1965 2978 2979
1963 2039 2977
1971 2028 2976
1955 2040 2973
1949 2969 2970
1913 2960 2965
1914 2961 2964
1915 2962 2963
1929 2083 2958
1911 2955 2957
1930 2082 2956
1885 2942 2947
1888 2945 2946
1887 2943 2944
1884 2940 2941
1899 2105 2938
1877 2936 2...

result:

ok count=629

Test #136:

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

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
1997 1998 2996
1974 2986 2987
1970 2984 2985
1941 2085 2980
1952 2063 2979
1942 2084 2977
1948 2067 2976
1951 2064 2975
1937 2968 2973
1949 2066 2972
1950 2065 2971
1940 2969 2970
1947 2074 2966
1946 2075 2964
1887 2955 2956
1884 2952 2953
1883 2151 2951
1878 2155 2949
1881 2152 2948
1834 2205 2...

result:

ok count=712

Test #137:

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

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
999 1000 2999
998 1001 2998
997 1002 2997
996 1003 2996
995 1004 2995
994 1005 2994
993 1006 2993
992 1007 2992
991 1008 2991
990 1009 2990
989 1010 2989
988 1011 2988
987 1012 2987
986 1013 2986
985 1014 2985
984 1015 2984
983 1016 2983
982 1017 2982
981 1018 2981
980 1019 2980
979 1020 2979
9...

result:

ok count=1000

Test #138:

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

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 3 599999

result:

ok count=1

Test #139:

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

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
599866 599998 599999
599902 599996 599997
599985 599990 599995
599979 599993 599994
599982 599991 599992
599983 599986 599989
599984 599987 599988
599903 599980 599981
599974 599977 599978
599971 599975 599976
599970 599972 599973
599966 599968 599969
599939 599945 599967
599904 599964 599965...

result:

ok count=200000

Test #140:

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

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
599992 599993 599999
599996 599997 599998
599991 599994 599995
599979 599986 599990
599985 599987 599989
599973 599984 599988
599974 599980 599983
599978 599981 599982
599803 599804 599977
599791 599792 599976
599921 599926 599975
599969 599970 599972
599928 599929 599971
599677 599678 599968...

result:

ok count=200000

Test #141:

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

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
209853 209959 209960
209869 209938 209939
209673 209674 209832
209698 209699 209822
209729 209730 209812
209301 209663 209664
209303 209604 209605
209310 209586 209587
209423 209583 209584
209442 209496 209497
209426 209438 209439
209327 209419 209420
209284 209285 209286
209278 209279 209280
2...

result:

ok count=4999

Test #142:

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

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
14187 14296 14999
14837 14838 14998
14831 14839 14997
14830 14840 14996
14983 14994 14995
14828 14841 14993
14989 14991 14992
14775 14851 14990
14984 14987 14988
14947 14951 14986
14980 14981 14985
14952 14955 14982
14940 14941 14979
14970 14971 14978
14858 14861 14977
14773 14862 14976
14973 1...

result:

ok count=5000

Test #143:

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

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
599978 599995 599999
599989 599991 599998
599994 599996 599997
599986 599992 599993
599973 599974 599990
599981 599983 599988
599984 599985 599987
599979 599980 599982
599971 599972 599977
599967 599968 599976
599927 599929 599975
599853 599926 599970
599952 599953 599969
599957 599958 599966...

result:

ok count=200000

Test #144:

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

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
454136 597134 599999
454134 597135 599998
454131 597136 599997
455250 597133 599996
455255 597132 599995
455259 597131 599994
454130 597137 599993
454123 597138 599992
455262 597130 599991
455264 597129 599990
454122 597139 599989
454121 597140 599988
455270 597128 599987
454120 597141 599986...

result:

ok count=200000

Test #145:

score: 0
Accepted
time: 67ms
memory: 16660kb

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
422769 599294 599999
422998 599293 599998
422999 599292 599997
422755 599295 599996
422748 599296 599995
423000 599291 599994
423050 599290 599993
422739 599297 599992
423053 599289 599991
422720 599298 599990
423058 599288 599989
422700 599299 599988
423064 599287 599987
422693 599300 599986...

result:

ok count=200000

Test #146:

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

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
432757 594408 599999
432750 594409 599998
432748 594410 599997
433661 594407 599996
432747 594411 599995
432744 594412 599994
432741 594413 599993
432740 594414 599992
432738 594415 599991
433662 594406 599990
432737 594416 599989
433666 594405 599988
433669 594404 599987
432736 594417 599986...

result:

ok count=200000

Test #147:

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

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
22940 59494 59999
22941 59495 59998
23153 59493 59997
22942 59496 59996
23156 59492 59995
22943 59497 59994
22945 59498 59993
22946 59499 59992
23158 59491 59991
23170 59490 59990
22949 59500 59989
23172 59489 59988
23175 59488 59987
23177 59487 59986
23202 59486 59985
22950 59501 59984
22954 ...

result:

ok count=20000

Test #148:

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

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
4799 87145 89999
5147 87098 89998
4803 87146 89997
5146 87099 89996
4807 87147 89995
4816 87148 89994
5143 87100 89993
5140 87101 89992
4817 87149 89991
4818 87150 89990
5139 87102 89989
4819 87151 89988
5137 87103 89987
5135 87104 89986
5123 87105 89985
4820 87152 89984
5113 87106 89983
5110 ...

result:

ok count=30000

Test #149:

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

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
68513 118055 119999
68691 118054 119998
68693 118053 119997
68512 118056 119996
68506 118057 119995
68505 118058 119994
68694 118052 119993
68504 118059 119992
68699 118051 119991
68503 118060 119990
68502 118061 119989
68498 118062 119988
68497 118063 119987
68496 118064 119986
68701 118050 1...

result:

ok count=40000

Test #150:

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

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
135816 148184 149999
135893 148180 149998
135817 148185 149997
135890 148181 149996
135887 148182 149995
135818 148186 149994
135885 148183 149993
135894 148179 149992
135895 148178 149991
135820 148187 149990
135821 148188 149989
135898 148177 149988
135900 148176 149987
135823 148189 149986
...

result:

ok count=50000

Test #151:

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

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
68770 149616 149999
68648 149617 149998
68612 149618 149997
68601 149619 149996
68507 149620 149995
68677 149621 149994
68684 149622 149993
68859 149623 149992
68863 149624 149991
68898 149612 149990
68784 149615 149989
68968 149626 149988
68868 149614 149987
68875 149613 149986
68885 149625 1...

result:

ok count=50000

Test #152:

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

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
125066 149455 149999
125065 149456 149998
125063 149457 149997
125149 149454 149996
125061 149458 149995
125059 149459 149994
125150 149453 149993
125058 149460 149992
125152 149452 149991
125057 149461 149990
125155 149451 149989
125157 149450 149988
125043 149462 149987
125159 149449 149986
...

result:

ok count=50000

Test #153:

score: 0
Accepted
time: 65ms
memory: 15584kb

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
399709 599998 599999
399719 400312 599991
399674 599985 599988
399683 599986 599987
399703 400334 599984
399706 400332 599983
399705 400333 599981
399685 400354 599978
399699 400345 599977
399691 400350 599975
399697 400348 599974
399695 400349 599972
399688 400353 599969
399645 599965 599966...

result:

ok count=133513

Test #154:

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

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
399956 599992 599993
399952 599990 599991
399944 599988 599989
399929 400083 599984
399922 599982 599983
399912 599979 599980
399924 400087 599977
399910 599975 599976
399909 400098 599973
399919 400089 599972
399914 400095 599970
399916 400093 599969
399918 400092 599968
399903 599966 599967...

result:

ok count=133361

Test #155:

score: 0
Accepted
time: 53ms
memory: 15580kb

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
399882 400140 599985
399528 400459 599498
399526 400460 599496
399458 599491 599492
399444 599488 599489
399507 400488 599487
399497 400490 599484
399431 599478 599481
399434 599479 599480
399426 599473 599474
399473 400507 599469
399418 599464 599465
399413 599461 599462
399408 599459 599460...

result:

ok count=133217

Test #156:

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

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
399009 599997 599998
399168 400915 599994
399001 599992 599993
399166 400917 599990
399162 400920 599986
399159 400926 599983
398984 599981 599982
398981 599977 599979
399157 400928 599978
399151 400932 599973
398975 599971 599972
399150 400933 599970
398965 599964 599965
398960 599959 599962...

result:

ok count=133621

Test #157:

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

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
312940 313787 469996
312887 469994 469995
312886 469992 469993
312844 469978 469982
312902 313824 469981
312903 313823 469980
312906 313818 469979
312839 469975 469976
312834 469971 469972
312833 469969 469970
312830 469966 469967
312876 313837 469963
312796 469952 469953
312783 313939 469945...

result:

ok count=104516

Test #158:

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

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
313183 469875 469876
313212 313450 469870
313207 313457 469866
313158 469861 469862
313187 313482 469859
313178 313485 469855
313129 469852 469853
313176 313487 469851
313124 469847 469849
313167 313496 469848
313085 469830 469836
313142 313523 469835
313086 469831 469834
313088 469832 469833...

result:

ok count=104147

Test #159:

score: 0
Accepted
time: 41ms
memory: 12992kb

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
313215 313472 469999
313207 469751 469998
313224 313466 469991
312716 469511 469512
312739 313949 469508
312723 313961 469505
312702 313989 469500
312667 469498 469499
312686 314009 469497
312693 314000 469496
312694 313999 469495
312666 469492 469494
312700 313990 469493
312699 313991 469491...

result:

ok count=104570

Test #160:

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

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
313177 469996 469997
313204 313509 469995
313172 469993 469994
313165 469990 469991
313164 469988 469989
313162 469984 469987
313163 469985 469986
313156 469981 469983
313175 313549 469982
313158 313566 469976
313157 313567 469974
313128 469968 469972
313153 313568 469971
313129 469969 469970...

result:

ok count=103891

Test #161:

score: 0
Accepted
time: 27ms
memory: 37412kb

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
358024 358025 386125

result:

ok count=1

Test #162:

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

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: 52ms
memory: 15528kb

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
199999 200000 599999
199998 200001 599998
199997 200002 599997
199996 200003 599996
199995 200004 599995
199994 200005 599994
199993 200006 599993
199992 200007 599992
199991 200008 599991
199990 200009 599990
199989 200010 599989
199988 200011 599988
199987 200012 599987
199986 200013 599986...

result:

ok count=200000

Test #164:

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

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 599998

result:

ok count=1

Test #165:

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

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
239999 240000 479999
239998 240001 479998
239997 240002 479997
239996 240003 479996
239995 240004 479995
239994 240005 479994
239993 240006 479993
239992 240007 479992
239991 240008 479991
239990 240009 479990
239989 240010 479989
239988 240011 479988
239987 240012 479987
239986 240013 479986...

result:

ok count=120000

Test #166:

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

input:

6
1 2 3 2 3 1

output:

2
2 3 5
0 1 4

result:

ok count=2

Test #167:

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

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
197699 197700 595299
197698 197701 595298
197697 197702 595297
197696 197703 595296
197695 197704 595295
197694 197705 595294
197693 197706 595293
197692 197707 595292
197691 197708 595291
197690 197709 595290
197689 197710 595289
197688 197711 595288
197687 197712 595287
197686 197713 595286...

result:

ok count=197700