QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#450734#6828. Heirloom Paintingalgotester#AC ✓189ms13108kbC++14876b2024-06-22 17:29:542024-06-22 17:29:54

Judging History

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

  • [2024-06-22 17:29:54]
  • 评测
  • 测评结果:AC
  • 用时:189ms
  • 内存:13108kb
  • [2024-06-22 17:29:54]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

void solve(int test)
{
    int n, m, k;
    cin >> n >> m >> k;
    vector<int> c(n);
    for(int i = 0; i < n; ++i) cin >> c[i];
    for(int i = 0; i < n; ++i)
        if(c[i] != c[(i + n - 1) % n])
        {
            rotate(c.begin(), c.begin() + i, c.end());
            break;
        }
    int prev = 0;
    vector<int> v;
    for(int i = 1; i <= n; ++i)
        if(i == n || c[i] != c[prev])
        {
            v.push_back(i - prev);
            prev = i;
        }

    if(*max_element(v.begin(), v.end()) < k) 
        cout << -1 << endl;
    else
    {
        int res = 0;
        for(int a : v) 
            res += (a + k - 1)/k;
        cout << res << endl;
    }
}

int main()
{
    int t;
    cin >> t;
    for(int i = 0; i < t; ++i)
        solve(i);
    return 0;
}

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

詳細信息

Test #1:

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

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: 100ms
memory: 3768kb

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: 9ms
memory: 3600kb

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: 124ms
memory: 3544kb

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: 3ms
memory: 3600kb

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: 126ms
memory: 3576kb

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: 9ms
memory: 3792kb

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: 120ms
memory: 3636kb

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: 3ms
memory: 3484kb

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

output:

8
9
8
7
8
9
10
9
8
9
8
7
6
7
8
7
8
9
8
7
6
7
8
7
6
7
7
6
7
8
8
7
8
9
8
7
8
9
10
9
8
9
8
7
8
9
10
9
10
11
10
9
8
9
10
9
8
9
8
8
7
7
8
7
8
9
8
7
8
9
10
9
8
9
8
7
6
7
8
7
8
9
8
7
6
7
8
7
7
8
7
6
7
8
9
8
8
9
8
7
8
9
10
9
8
9
8
7
8
9
10
9
10
11
10
9
8
9
10
9
8
9
8
8
9
9
10
9
10
11
10
9
10
11
12
11
10
11
...

result:

ok 3036 numbers

Test #10:

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

input:

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

output:

4
4
4
4
4
6
4
4
4
6
6
6
4
6
4
4
4
6
6
6
6
8
6
6
4
6
6
6
4
6
4
4
4
5
6
5
6
7
6
5
6
7
8
7
6
7
6
5
4
5
6
5
6
7
6
5
4
5
6
5
4
5
4
4
4
5
5
5
6
7
5
5
6
7
7
7
6
7
5
5
6
7
7
7
8
9
7
7
6
7
7
7
6
7
5
5
4
5
5
5
6
7
5
5
6
7
7
7
6
7
5
5
4
5
5
5
6
7
5
5
4
5
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: 9ms
memory: 3572kb

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: 128ms
memory: 3556kb

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: 121ms
memory: 3840kb

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: 165ms
memory: 3572kb

input:

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

output:

1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-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 #15:

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

input:

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

output:

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

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: 80ms
memory: 7532kb

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: 180ms
memory: 7396kb

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: 181ms
memory: 7236kb

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: 180ms
memory: 7016kb

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: 181ms
memory: 6996kb

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: 170ms
memory: 6668kb

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: 184ms
memory: 7080kb

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: 161ms
memory: 6732kb

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: 189ms
memory: 7088kb

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: 181ms
memory: 6992kb

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: 189ms
memory: 7128kb

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: 95ms
memory: 13108kb

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: 101ms
memory: 11524kb

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: 100ms
memory: 11468kb

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: 3540kb

input:

1
1 1 1
1

output:

1

result:

ok 1 number(s): "1"

Test #32:

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

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