QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#212633#6828. Heirloom Paintingnameless_story#AC ✓57ms7184kbC++20710b2023-10-13 18:45:082023-10-13 18:45:08

Judging History

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

  • [2023-10-13 18:45:08]
  • 评测
  • 测评结果:AC
  • 用时:57ms
  • 内存:7184kb
  • [2023-10-13 18:45:08]
  • 提交

answer

#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
void solve()
{
	int n,m,t; cin>>n>>m>>t;
	vector<int> a(n+1);
	for (int i=1; i<=n; ++i) cin>>a[i];
	if (count(1+all(a),a[1])!=n)
	{
		int x=0;
		for (int i=1; i<=n; i++) if (a[i]!=a[1])
		{
			x=i;
			break;
		}
		rotate(1+a.begin(),x+a.begin(),a.end());
	}
	int flag=0,ans=0;
	for (int i=1; i<=n; ++i)
	{
		int j=0;
		for (j=i; j<=n&&a[j]==a[i]; ++j);
		flag|=(j-i)>=t;
		ans+=(j-i+t-1)/t;
		i=j-1;
	}
	if (!flag)
	{
		cout<<-1<<'\n';
	}
	else cout<<ans<<'\n';
}
int main()
{
	ios::sync_with_stdio(0); cin.tie(0);
	int T; cin>>T;
	while (T--)
	{
		solve();
	}
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
11 4 2
1 1 1 2 2 3 3 3 4 4 1
5 2 1
1 2 1 2 1
6 2 2
1 2 1 2 1 2

output:

6
5
-1

result:

ok 3 number(s): "6 5 -1"

Test #2:

score: 0
Accepted
time: 44ms
memory: 3644kb

input:

62500
16 2 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 1
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 1
1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 1
2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 1
1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 1
2 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 1
1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 1
2 2 2 1 1 1 1 ...

output:

16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
...

result:

ok 62500 numbers

Test #3:

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

input:

3036
16 2 1
1 1 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 1
2 1 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 1
1 2 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 1
2 2 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 1
1 1 1 2 1 2 1 1 1 1 2 1 2 2 2 2
16 2 1
2 1 1 2 1 2 1 1 1 1 2 1 2 2 2 2
16 2 1
1 2 1 2 1 2 1 1 1 1 2 1 2 2 2 2
16 2 1
2 2 1 2 1 2 1 1...

output:

16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
16
...

result:

ok 3036 numbers

Test #4:

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

input:

62500
16 2 2
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 2
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 2
1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 2
2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 2
1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 2
2 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 2
1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 2
2 2 2 1 1 1 1 ...

output:

8
9
9
8
9
10
8
9
9
9
10
9
8
9
9
8
9
10
9
9
10
11
9
10
8
9
9
9
9
10
8
9
9
9
10
9
9
10
9
9
10
10
11
10
9
10
10
9
8
9
9
8
9
10
9
9
9
9
10
9
8
9
9
8
9
10
9
9
10
11
9
10
9
10
10
10
9
10
9
9
10
11
10
10
11
12
10
11
9
10
10
10
10
11
9
10
8
9
9
9
9
10
8
9
9
10
10
10
9
10
9
9
9
10
9
9
10
11
9
10
8
9
9
9
9
10...

result:

ok 62500 numbers

Test #5:

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

input:

3036
16 2 2
1 1 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 2
2 1 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 2
1 2 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 2
2 2 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 2
1 1 1 2 1 2 1 1 1 1 2 1 2 2 2 2
16 2 2
2 1 1 2 1 2 1 1 1 1 2 1 2 2 2 2
16 2 2
1 2 1 2 1 2 1 1 1 1 2 1 2 2 2 2
16 2 2
2 2 1 2 1 2 1 1...

output:

10
11
10
10
11
11
12
11
10
11
11
10
9
10
10
9
10
11
10
10
10
10
11
10
9
10
10
9
10
11
11
10
11
12
11
11
11
11
12
11
10
11
11
10
11
12
12
11
12
13
12
12
11
11
12
11
11
12
11
11
10
10
11
10
10
11
10
10
11
11
12
11
10
11
11
10
10
11
11
10
11
12
11
11
10
10
11
10
10
11
10
10
10
10
11
10
10
11
10
10
11
1...

result:

ok 3036 numbers

Test #6:

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

input:

62500
16 2 3
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 3
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 3
1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 3
2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 3
1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 3
2 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 3
1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 3
2 2 2 1 1 1 1 ...

output:

6
6
6
6
6
8
6
6
6
7
8
7
6
7
6
6
6
7
7
7
8
9
7
7
6
7
7
7
6
7
6
6
6
8
7
7
7
9
7
7
8
9
9
9
7
9
7
8
6
7
7
7
7
9
7
7
6
7
7
7
6
8
6
6
6
7
8
7
7
8
7
6
7
8
9
8
7
8
7
7
8
8
9
8
9
10
9
8
7
8
9
8
7
8
8
7
6
7
7
6
7
8
7
6
7
8
9
8
7
8
7
7
6
6
7
6
7
8
7
6
6
7
8
7
6
7
6
6
6
7
7
7
8
9
7
7
7
8
8
8
7
8
6
7
7
8
8
8
9
1...

result:

ok 62500 numbers

Test #7:

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

input:

3036
16 2 3
1 1 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 3
2 1 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 3
1 2 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 3
2 2 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 3
1 1 1 2 1 2 1 1 1 1 2 1 2 2 2 2
16 2 3
2 1 1 2 1 2 1 1 1 1 2 1 2 2 2 2
16 2 3
1 2 1 2 1 2 1 1 1 1 2 1 2 2 2 2
16 2 3
2 2 1 2 1 2 1 1...

output:

10
10
10
9
10
10
12
10
10
10
10
9
9
8
10
8
10
10
10
9
8
8
10
8
9
9
9
8
8
8
10
8
9
9
9
8
9
9
11
9
9
9
9
8
10
9
11
9
11
11
11
10
9
9
11
9
9
9
10
8
8
8
9
7
9
9
9
8
9
9
11
9
9
9
9
8
8
7
9
7
9
9
9
8
8
8
10
8
8
8
8
7
9
8
10
8
10
10
10
9
9
9
11
9
9
9
9
8
10
9
11
9
11
11
11
10
9
9
11
9
9
9
10
8
10
10
11
9
1...

result:

ok 3036 numbers

Test #8:

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

input:

62500
16 2 4
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 4
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 4
1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 4
2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 4
1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 4
2 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 4
1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 4
2 2 2 1 1 1 1 ...

output:

4
5
5
5
5
7
5
5
5
6
7
6
5
6
5
4
5
6
6
6
7
8
6
6
5
6
6
6
5
6
4
5
5
6
6
6
6
8
6
6
7
8
8
8
6
8
6
6
5
6
6
6
6
8
6
6
5
6
6
6
4
6
5
5
5
7
6
6
6
8
6
6
6
8
8
8
6
8
6
6
7
8
8
8
8
10
8
8
6
8
8
8
6
8
6
7
5
6
6
6
6
8
6
6
6
8
8
8
6
8
6
6
5
6
6
6
6
8
6
6
4
6
6
6
5
7
5
5
5
6
7
6
6
7
6
5
6
7
8
7
6
7
6
5
6
7
8
7
8
9...

result:

ok 62500 numbers

Test #9:

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

input:

3036
16 2 4
1 1 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 4
2 1 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 4
1 2 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 4
2 2 2 1 1 2 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
5
5
4
5
4
4
4
6
5
5
5
7
5
5
6
7
7
7
5
7
5
5
6
7
7
7
7
9
...

result:

ok 62500 numbers

Test #11:

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

input:

3036
16 2 5
1 1 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 5
2 1 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 5
1 2 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 5
2 2 2 1 1 2 1 1 1 1 2 1 2 2 2 2
16 2 5
1 1 1 2 1 2 1 1 1 1 2 1 2 2 2 2
16 2 5
2 1 1 2 1 2 1 1 1 1 2 1 2 2 2 2
16 2 5
1 2 1 2 1 2 1 1 1 1 2 1 2 2 2 2
16 2 5
2 2 1 2 1 2 1 1...

output:

-1
8
-1
7
-1
8
-1
9
-1
8
-1
7
-1
6
-1
7
-1
8
-1
7
-1
6
-1
7
-1
6
6
5
7
6
-1
7
-1
8
-1
7
-1
8
-1
9
-1
8
-1
7
-1
8
-1
9
-1
10
-1
9
-1
8
-1
9
-1
8
-1
7
6
6
-1
7
-1
8
-1
7
-1
8
-1
9
-1
8
-1
7
-1
6
-1
7
-1
8
-1
7
-1
6
-1
7
6
6
7
6
7
7
8
7
-1
8
-1
7
-1
8
-1
9
-1
8
-1
7
-1
8
-1
9
-1
10
-1
9
-1
8
-1
9
-1
8
...

result:

ok 3036 numbers

Test #12:

score: 0
Accepted
time: 40ms
memory: 3620kb

input:

62500
16 2 6
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 6
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 6
1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 6
2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 6
1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 6
2 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 6
1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 6
2 2 2 1 1 1 1 ...

output:

3
4
4
4
4
6
4
4
4
5
6
5
4
5
4
3
4
5
5
5
6
7
5
5
4
5
5
5
4
5
3
3
4
5
5
5
5
7
5
5
6
7
7
7
5
7
5
5
4
5
5
5
5
7
5
5
4
5
5
5
3
5
3
3
4
5
5
5
5
7
5
5
5
7
7
7
5
7
5
5
6
7
7
7
7
9
7
7
5
7
7
7
5
7
5
5
4
5
5
5
5
7
5
5
5
7
7
7
5
7
5
5
4
5
5
5
5
7
5
5
3
5
5
5
3
5
3
4
4
5
5
5
5
7
5
5
5
7
7
7
5
7
5
5
5
7
7
7
7
9
...

result:

ok 62500 numbers

Test #13:

score: 0
Accepted
time: 44ms
memory: 3644kb

input:

62500
16 2 15
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 15
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 15
1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 15
2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 15
1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 15
2 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 15
1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1
16 2 15
2 2 2 ...

output:

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

result:

ok 62500 numbers

Test #14:

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

input:

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

result:

ok 3036 numbers

Test #16:

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

input:

1
999996 5 10
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 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 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 2 2 2 2 2 2 2 2 2 2 2 2 2 2 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 ...

output:

122055

result:

ok 1 number(s): "122055"

Test #17:

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

input:

1
999989 5 10
5 5 5 5 5 5 5 5 5 5 5 5 5 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 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 3 3 3 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 4 ...

output:

122344

result:

ok 1 number(s): "122344"

Test #18:

score: 0
Accepted
time: 42ms
memory: 7016kb

input:

1
999917 1000000 100
880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996 880996...

output:

13292

result:

ok 1 number(s): "13292"

Test #19:

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

input:

1
999953 1000000 100
877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398 877398...

output:

13245

result:

ok 1 number(s): "13245"

Test #20:

score: 0
Accepted
time: 42ms
memory: 7036kb

input:

1
999408 1000000 1000
465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 465591 46559...

output:

1336

result:

ok 1 number(s): "1336"

Test #21:

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

input:

1
994353 1000000 10000
34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 34098 3...

output:

130

result:

ok 1 number(s): "130"

Test #22:

score: 0
Accepted
time: 44ms
memory: 6896kb

input:

1
933043 1000000 100000
224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224325 224...

output:

12

result:

ok 1 number(s): "12"

Test #23:

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

input:

1
994769 1000000 500000
277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277976 277...

output:

2

result:

ok 1 number(s): "2"

Test #24:

score: 0
Accepted
time: 42ms
memory: 6524kb

input:

1
895242 1000000 500000
560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560586 560...

output:

-1

result:

ok 1 number(s): "-1"

Test #25:

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

input:

1
1000000 1000000 985319
114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 11...

output:

2

result:

ok 1 number(s): "2"

Test #26:

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

input:

1
1000000 1000000 1000000
114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 1...

output:

1

result:

ok 1 number(s): "1"

Test #27:

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

input:

1
1000000 1000000 514
114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 114514 11451...

output:

1946

result:

ok 1 number(s): "1946"

Test #28:

score: 0
Accepted
time: 37ms
memory: 7028kb

input:

1
1000000 1000000 7
19 13 25 40 35 31 13 15 13 24 30 15 6 20 35 26 13 13 37 5 26 30 28 10 40 32 32 26 7 31 30 29 24 23 36 12 31 37 10 39 9 30 4 35 6 25 14 16 2 32 27 18 15 8 40 14 8 10 16 7 32 38 20 5 20 35 25 13 20 26 31 29 4 27 10 29 32 9 17 38 18 17 2 12 19 19 23 3 28 25 2 15 13 11 17 16 26 28 7 ...

output:

-1

result:

ok 1 number(s): "-1"

Test #29:

score: 0
Accepted
time: 37ms
memory: 7128kb

input:

1
1000000 1000000 12
36 31 24 39 11 22 1 14 32 21 20 1 22 16 31 26 30 35 28 12 38 38 4 33 27 5 25 3 15 26 15 16 23 21 30 24 11 40 22 31 32 32 18 12 40 7 24 13 8 33 23 39 7 39 13 7 7 3 4 26 6 9 10 4 17 28 39 8 23 34 29 12 37 5 34 29 33 8 26 2 27 30 20 32 15 23 27 40 6 29 31 15 33 21 12 20 2 22 34 17 ...

output:

-1

result:

ok 1 number(s): "-1"

Test #30:

score: 0
Accepted
time: 37ms
memory: 7016kb

input:

1
1000000 1000000 5
26 34 34 8 28 23 31 37 24 5 9 11 13 9 23 19 16 40 2 13 13 29 18 28 25 26 4 4 30 38 2 27 24 26 39 35 15 26 19 30 9 27 37 32 37 26 19 14 1 14 32 27 5 20 40 10 32 12 25 16 35 11 14 31 10 23 16 29 8 36 40 1 22 24 18 23 14 32 38 38 30 30 10 8 9 15 16 8 29 8 18 32 12 40 21 26 13 4 14 3...

output:

-1

result:

ok 1 number(s): "-1"

Test #31:

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

input:

1
1 1 1
1

output:

1

result:

ok 1 number(s): "1"

Test #32:

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

input:

6
1 9 1
9
9 1 1
1 1 1 1 1 1 1 1 1
2 1 1
1 1
2 1 2
1 1
2 9 2
8 8
3 3 2
1 2 3

output:

1
9
2
1
1
-1

result:

ok 6 numbers