QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#551895#3675. Interactive Array GuessingTEAM1_AUCA#AC ✓2ms4124kbC++176.6kb2024-09-07 18:52:222024-09-07 18:52:22

Judging History

This is the latest submission verdict.

  • [2024-09-07 18:52:22]
  • Judged
  • Verdict: AC
  • Time: 2ms
  • Memory: 4124kb
  • [2024-09-07 18:52:22]
  • Submitted

answer

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("O3")
// #pragma unroll

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef std::vector<int> vi;
typedef std::vector<bool> vb;
typedef std::vector<std::string> vs;
typedef std::vector<double> vd;
typedef std::vector<long long> vll;
typedef std::vector<std::vector<int>> vvi;
typedef std::vector<vll> vvll;
typedef std::vector<std::pair<int, int>> vpi;
typedef std::vector<vpi> vvpi;
typedef std::pair<int, int> pi;
typedef std::pair<ll, ll> pll;
typedef std::vector<pll> vpll;
typedef std::vector<vpll> vvpll;

const long long mod = 1e9 + 7;
// const long long mod = 998244353;
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }
/*
const unsigned gen_seed = std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937_64 gen(gen_seed);
*/

#define _GLIBCXX_DEBUG 1
#define _GLIBCXX_DEBUG_PEDANTIC 1
#define _FORTIFY_SOURCE 2

#define I_am_clown               \
    ios::sync_with_stdio(false); \
    cin.tie(0);
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define srt(c) sort(all(c))
#define srtrev(c) sort(rall(c))
#define forn(i, a, b) for (ll i = a; i < b; i++)
#define read(x) scanf("%d", &x)
#define readv(x, n) \
    vll x(n);       \
    forn(i, 0, n) scanf("%u", &x[i])

#define pb push_back
#define mp make_pair
#define yes cout << "YES\n";
#define no cout << "NO\n";

#define sz(a) a.size()

using namespace __gnu_cxx;
using namespace std;

// benq - print any container + pair
template <typename T, typename = void>
struct is_iterable : false_type
{
};
template <typename T>
struct is_iterable<T, void_t<decltype(begin(declval<T>())), decltype(end(declval<T>()))>> : true_type
{
};
template <typename T>
typename enable_if<is_iterable<T>::value && !is_same<T, string>::value, ostream &>::type operator<<(ostream &cout, T const &v);
template <typename A, typename B>
ostream &operator<<(ostream &cout, pair<A, B> const &p) { return cout << "(" << p.first << ", " << p.second << ")"; }
template <typename T>
typename enable_if<is_iterable<T>::value && !is_same<T, string>::value, ostream &>::type operator<<(ostream &cout, T const &v)
{
    cout << "[";
    for (auto it = v.begin(); it != v.end();)
    {
        cout << *it;
        if (++it != v.end())
            cout << ", ";
    }
    return cout << "]";
}
template <typename A, typename B>
istream &operator>>(istream &cin, pair<A, B> &p)
{
    cin >> p.first;
    return cin >> p.second;
}

template <typename T>
void debug(string s, T x) { cerr << "\033[1;34m" << s << "\033[0;32m = \033[35m" << x << "\033[0m\n"; }
template <typename T, typename... Args>
void debug(string s, T x, Args... args)
{
    for (int i = 0, b = 0; i < (int)s.size(); i++)
        if (s[i] == '(' || s[i] == '{')
            b++;
        else if (s[i] == ')' || s[i] == '}')
            b--;
        else if (s[i] == ',' && b == 0)
        {
            cerr << "\033[1;34m" << s.substr(0, i) << "\033[0;32m = \033[35m" << x << "\033[31m | ";
            debug(s.substr(s.find_first_not_of(' ', i + 1)), args...);
            break;
        }
}
template <typename T>
void debug_nameless(T x) { cerr << "\033[35m" << x << "\033[0m\n"; }
template <typename T, typename... Args>
void debug_nameless(T x, Args... args)
{
    cerr << "\033[35m" << x << "\033[31m | ";
    debug_nameless(args...);
}

#ifdef temirbek_local
#define dbg(...) debug(#__VA_ARGS__, __VA_ARGS__)
#define dbgs(...) debug_nameless(__VA_ARGS__)
#else
#define dbg(...) 135
#define dbgs(...) 135
#endif

const long long int MAXN = 1e18 + 2;

class Timer
{
    std::chrono::time_point<std::chrono::steady_clock> timePoint;
    size_t value;

public:
    void start() { timePoint = std::chrono::steady_clock::now(); }
    void finish()
    {
        auto curr = std::chrono::steady_clock::now();
        auto elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(curr - timePoint);
        value = elapsed.count();
    }
    size_t operator()() const { return value; }
};

Timer timer;

void ask(ll m, vll q)
{
    cout << "? " << m << " ";
    forn(i, 0, m)
    {
        cout << q[i] << " ";
    }
    cout << "\n";
    cout.flush();
}

void answer(vvll a)
{
    cout << "! ";
    forn(i, 0, a.size())
    {
        cout << a[i].size() << " ";
        forn(j, 0, a[i].size())
        {
            cout << a[i][j] << " ";
        }
    }
    cout.flush();
}

void solve()
{
    ll n;
    cin >> n;
    vvll a(n);
    if (n % 2 == 1)
    {
        ask(1, {n});
        ll m;
        cin >> m;
        forn(i, 0, m)
        {
            ll x;
            cin >> x;
            a[n - 1].pb(x);
        }
        n--;
    }
    if (n == 0)
    {
        answer(a);
        return;
    }
    ll half = n / 2;
    vll q;
    for (ll i = 1; i <= half; i++)
    {
        q.pb(i);
        q.pb(i);
    }
    ask(q.size(), q);
    ll m;
    cin >> m;
    vll b(m);
    forn(i, 0, m)
    {
        cin >> b[i];
    }
    ll start = 0;
    for (ll i = 1; i <= half; i++)
    {
        ll f = b[start];
        a[i - 1].pb(b[start]);
        forn(j, start + 1, m)
        {
            if (b[j] == f)
            {
                start = j + a[i - 1].size();
                break;
            }
            a[i - 1].pb(b[j]);
        }
    }
    q.clear();
    forn(i, half + 1, n + 1)
    {
        q.pb(i);
        q.pb(i);
    }
    ask(q.size(), q);
    cin >> m;
    vll c(m);
    forn(i, 0, m)
    {
        cin >> c[i];
    }
    start = 0;
    for (ll i = half + 1; i <= n; i++)
    {
        ll f = c[start];
        a[i - 1].pb(c[start]);
        forn(j, start + 1, m)
        {
            if (c[j] == f)
            {
                start = j + a[i - 1].size();
                break;
            }
            a[i - 1].pb(c[j]);
        }
    }
    answer(a);
    return;
}

void naive()
{
    return;
}

int main()
{
    I_am_clown;

    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int T = 1;
    // cin >> T;
#ifdef temirbek_local
    timer.start();
#endif
    while (T--)
    {
        solve();
        // naive();
    }
#ifdef temirbek_local
    timer.finish();
    cout << timer() << " ms"
         << "\n";
#endif
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3564kb

input:

3
2 2 1
2 1 1
4 1 2 1 2

output:

? 1 3 
? 2 1 1 
? 2 2 2 
! 1 1 2 1 2 2 2 1 

result:

ok 3 arrays, sum_len = 5

Test #2:

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

input:

3
3 1 4 2
4 2 3 2 3
2 2 2

output:

? 1 3 
? 2 1 1 
? 2 2 2 
! 2 2 3 1 2 3 1 4 2 

result:

ok 3 arrays, sum_len = 6

Test #3:

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

input:

3
2 2 1
4 1 2 1 2
4 1 2 1 2

output:

? 1 3 
? 2 1 1 
? 2 2 2 
! 2 1 2 2 1 2 2 2 1 

result:

ok 3 arrays, sum_len = 6

Test #4:

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

input:

1
1 3

output:

? 1 1 
! 1 3 

result:

ok 1 arrays, sum_len = 1

Test #5:

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

input:

2
8 3 4 1 2 3 4 1 2
8 3 4 2 1 3 4 2 1

output:

? 2 1 1 
? 2 2 2 
! 4 3 4 1 2 4 3 4 2 1 

result:

ok 2 arrays, sum_len = 8

Test #6:

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

input:

1
2 2 3

output:

? 1 1 
! 2 2 3 

result:

ok 1 arrays, sum_len = 2

Test #7:

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

input:

2
2 1 1
2 1 1

output:

? 2 1 1 
? 2 2 2 
! 1 1 1 1 

result:

ok 2 arrays, sum_len = 2

Test #8:

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

input:

3
2 1 2
4 2 1 2 1
4 1 2 1 2

output:

? 1 3 
? 2 1 1 
? 2 2 2 
! 2 2 1 2 1 2 2 1 2 

result:

ok 3 arrays, sum_len = 6

Test #9:

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

input:

1
2 1 3

output:

? 1 1 
! 2 1 3 

result:

ok 1 arrays, sum_len = 2

Test #10:

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

input:

1
2 1 2

output:

? 1 1 
! 2 1 2 

result:

ok 1 arrays, sum_len = 2

Test #11:

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

input:

9
1 1
16 2 3 2 3 2 2 1 4 2 1 4 2 1 4 1 4
12 1 1 2 4 2 4 2 3 2 3 2 2

output:

? 1 9 
? 8 1 1 2 2 3 3 4 4 
? 8 5 5 6 6 7 7 8 8 
! 2 2 3 1 2 3 1 4 2 2 1 4 1 1 2 2 4 2 2 3 1 2 1 1 

result:

ok 9 arrays, sum_len = 15

Test #12:

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

input:

10
18 1 2 1 2 1 2 1 2 2 1 2 1 2 1 2 1 1 1
14 1 2 1 2 1 1 2 1 2 1 2 2 2 2

output:

? 10 1 1 2 2 3 3 4 4 5 5 
? 10 6 6 7 7 8 8 9 9 10 10 
! 2 1 2 2 1 2 2 2 1 2 2 1 1 1 2 1 2 1 1 2 2 1 1 2 1 2 

result:

ok 10 arrays, sum_len = 16

Test #13:

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

input:

3
1 2
2 3 3
2 2 2

output:

? 1 3 
? 2 1 1 
? 2 2 2 
! 1 3 1 2 1 2 

result:

ok 3 arrays, sum_len = 3

Test #14:

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

input:

9
3 4 3 2
30 3 4 1 2 3 4 1 2 3 4 2 1 3 4 2 1 4 1 3 4 1 3 4 2 1 3 4 2 1 3
18 4 4 4 3 4 3 2 1 3 2 1 3 1 3 4 1 3 4

output:

? 1 9 
? 8 1 1 2 2 3 3 4 4 
? 8 5 5 6 6 7 7 8 8 
! 4 3 4 1 2 4 3 4 2 1 3 4 1 3 4 4 2 1 3 1 4 2 4 3 3 2 1 3 3 1 3 4 3 4 3 2 

result:

ok 9 arrays, sum_len = 27

Test #15:

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

input:

1
8 369 876 138 664 45 749 540 971

output:

? 1 1 
! 8 369 876 138 664 45 749 540 971 

result:

ok 1 arrays, sum_len = 8

Test #16:

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

input:

1
1 913

output:

? 1 1 
! 1 913 

result:

ok 1 arrays, sum_len = 1

Test #17:

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

input:

1
1 177

output:

? 1 1 
! 1 177 

result:

ok 1 arrays, sum_len = 1

Test #18:

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

input:

57
2 3 1
98 1 2 1 2 3 3 1 1 3 3 4 1 4 1 4 2 4 2 1 3 1 3 1 1 4 3 2 4 3 2 1 2 1 2 4 4 1 4 1 4 3 4 3 4 1 3 1 3 4 2 4 2 2 2 3 4 3 4 3 2 3 2 4 3 4 3 1 1 1 4 3 1 4 3 1 3 1 3 4 2 4 2 2 3 2 3 1 1 3 3 2 3 2 3 4 2 4 2
92 2 2 1 1 2 1 2 1 4 4 3 3 2 4 2 4 3 4 3 4 4 4 3 1 3 1 2 2 1 1 2 3 2 3 3 3 3 4 3 4 1 3 4 1 3...

output:

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

result:

ok 57 arrays, sum_len = 97

Test #19:

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

input:

7
3 3 2 1
10 1 3 1 3 3 2 3 2 1 1
10 2 2 2 1 2 1 2 1 2 1

output:

? 1 7 
? 6 1 1 2 2 3 3 
? 6 4 4 5 5 6 6 
! 2 1 3 2 3 2 1 1 1 2 2 2 1 2 2 1 3 3 2 1 

result:

ok 7 arrays, sum_len = 13

Test #20:

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

input:

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

? 36 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 
? 36 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 
! 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 36 arrays, sum_len = 36

Test #21:

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

input:

47
1 3
66 3 3 2 3 2 3 1 1 2 2 2 1 2 1 2 2 3 3 1 1 1 3 1 3 3 3 2 2 3 2 3 2 3 3 2 1 2 1 3 1 2 3 1 2 3 1 3 1 2 2 3 3 3 3 2 2 3 2 3 2 1 1 2 1 2 1
88 3 1 3 1 2 3 2 3 1 2 3 1 2 3 2 1 2 1 1 3 1 3 3 1 3 1 2 3 2 3 2 2 1 3 1 3 2 3 1 2 3 1 3 2 3 2 3 3 3 2 3 2 1 3 1 3 3 2 1 3 2 1 3 3 2 1 2 1 2 2 3 2 3 2 1 2 1 2...

output:

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

result:

ok 47 arrays, sum_len = 78

Test #22:

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

input:

77
1 1
76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 77 
? 76 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 
? 76 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50...

result:

ok 77 arrays, sum_len = 77

Test #23:

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

input:

512
758 1 2 1 2 1 1 1 2 1 2 2 2 2 2 2 2 2 1 2 1 2 1 2 1 2 2 2 1 2 1 1 1 2 2 2 1 2 1 2 2 1 2 1 2 1 2 1 2 2 2 2 2 2 2 2 2 2 1 2 1 1 1 1 2 1 2 1 1 1 2 1 2 1 2 1 2 2 2 2 2 2 1 2 1 1 1 1 2 1 2 1 1 1 1 1 1 1 1 1 2 1 2 1 2 1 2 2 2 2 2 2 1 2 1 1 1 2 2 1 2 1 2 2 1 2 1 2 1 2 1 1 1 1 2 1 2 2 2 1 1 1 1 2 2 2 1 ...

output:

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

result:

ok 512 arrays, sum_len = 747

Test #24:

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

input:

635
2 2 4
1586 2 4 1 3 2 4 1 3 2 1 4 3 2 1 4 3 4 2 4 2 1 4 2 3 1 4 2 3 2 2 1 2 4 1 2 4 3 3 2 3 1 2 3 1 2 1 3 2 1 3 1 2 4 1 2 4 4 1 4 1 3 2 4 3 2 4 4 1 2 3 4 1 2 3 2 2 2 2 2 4 1 3 2 4 1 3 2 2 1 4 3 1 4 3 4 3 4 3 1 3 4 1 3 4 4 4 2 3 2 3 3 4 2 1 3 4 2 1 3 1 4 3 1 4 4 4 4 4 2 1 4 3 2 1 4 3 3 1 2 3 1 2 4...

output:

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

result:

ok 635 arrays, sum_len = 1599

Test #25:

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

input:

261
1 1
260 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 261 
? 260 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 ...

result:

ok 261 arrays, sum_len = 261

Test #26:

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

input:

389
3 4 1 2
1046 3 3 3 1 4 2 3 1 4 2 1 4 3 1 4 3 1 3 4 1 3 4 4 1 3 4 1 3 2 4 3 2 4 3 2 3 2 3 3 1 3 1 1 3 1 3 1 4 3 2 1 4 3 2 3 2 4 3 2 4 3 1 3 1 4 4 4 2 3 4 2 3 2 4 3 2 4 3 1 3 4 2 1 3 4 2 3 2 3 2 1 4 1 4 1 2 4 1 2 4 4 1 3 4 1 3 4 3 2 4 3 2 2 3 2 3 2 3 4 2 3 4 2 3 4 2 3 4 1 1 1 2 3 1 2 3 4 1 4 1 2 3...

output:

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

result:

ok 389 arrays, sum_len = 1071

Test #27:

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

input:

14
14 1 1 1 1 1 1 1 1 1 1 1 1 1 1
14 1 1 1 1 1 1 1 1 1 1 1 1 1 1

output:

? 14 1 1 2 2 3 3 4 4 5 5 6 6 7 7 
? 14 8 8 9 9 10 10 11 11 12 12 13 13 14 14 
! 1 1 1 1 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 14 arrays, sum_len = 14

Test #28:

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

input:

542
1590 820 311 820 311 371 405 565 371 405 565 17 17 631 631 347 32 347 32 407 44 788 407 44 788 244 234 763 585 244 234 763 585 98 98 418 643 41 117 418 643 41 117 342 271 200 112 731 342 271 200 112 731 187 187 188 745 188 745 320 320 107 37 107 37 513 14 613 579 513 14 613 579 457 457 375 630 2...

output:

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

result:

ok 542 arrays, sum_len = 1599

Test #29:

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

input:

670
3316 295 199 179 190 295 199 179 190 252 314 65 64 60 91 345 3 218 252 314 65 64 60 91 345 3 218 335 236 31 261 226 335 236 31 261 226 324 298 141 307 324 298 141 307 102 2 71 186 318 102 2 71 186 318 2 10 56 263 252 22 2 10 56 263 252 22 224 322 341 182 338 224 322 341 182 338 1 280 166 1 280 1...

output:

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

result:

ok 670 arrays, sum_len = 3376

Test #30:

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

input:

295
4 13 55 51 38
1112 133 77 90 133 77 90 17 5 17 5 13 12 89 16 70 75 13 12 89 16 70 75 127 127 80 14 5 80 14 5 29 130 3 29 130 3 107 14 42 131 84 107 14 42 131 84 169 123 4 169 123 4 47 155 72 47 155 72 2 154 2 154 74 74 126 1 126 1 144 125 159 52 144 125 159 52 168 55 78 69 149 168 55 78 69 149 1...

output:

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

result:

ok 295 arrays, sum_len = 1184

Test #31:

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

input:

419
1 111
418 42 42 356 356 222 222 73 73 62 62 244 244 34 34 340 340 274 274 282 282 177 177 144 144 225 225 218 218 86 86 134 134 342 342 277 277 180 180 292 292 248 248 104 104 225 225 21 21 293 293 239 239 181 181 292 292 343 343 185 185 5 5 301 301 299 299 324 324 1 1 46 46 188 188 145 145 139 ...

output:

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

result:

ok 419 arrays, sum_len = 419

Test #32:

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

input:

44
242 126 511 126 511 454 462 368 67 454 462 368 67 478 459 353 253 339 478 459 353 253 339 26 283 386 486 235 146 238 94 26 283 386 486 235 146 238 94 80 477 80 477 274 459 161 145 127 458 274 459 161 145 127 458 387 459 530 388 54 376 387 459 530 388 54 376 15 285 317 94 15 285 317 94 19 157 523 ...

output:

? 44 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 
? 44 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 
! 2 126 511 4 454 462 368 67 5 478 459 353...

result:

ok 44 arrays, sum_len = 232

Test #33:

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

input:

1000
5444 105 590 827 793 804 832 272 163 548 105 590 827 793 804 832 272 163 548 419 372 419 372 557 469 557 469 107 467 593 42 245 995 297 873 739 759 107 467 593 42 245 995 297 873 739 759 83 880 831 570 738 161 656 33 235 83 880 831 570 738 161 656 33 235 249 770 941 249 770 941 327 988 808 327 ...

output:

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

result:

ok 1000 arrays, sum_len = 5507

Test #34:

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

input:

1000
5336 242 325 95 275 458 84 737 750 442 770 242 325 95 275 458 84 737 750 442 770 110 597 850 529 110 597 850 529 581 581 161 114 806 146 405 290 161 114 806 146 405 290 441 85 775 679 439 162 96 393 283 441 85 775 679 439 162 96 393 283 37 224 792 618 791 37 224 792 618 791 907 698 739 944 854 ...

output:

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

result:

ok 1000 arrays, sum_len = 5477

Test #35:

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

input:

1000
5496 61 839 834 126 401 929 997 61 839 834 126 401 929 997 351 351 772 238 163 910 619 549 772 238 163 910 619 549 265 458 254 678 265 458 254 678 505 242 505 242 562 477 380 562 477 380 426 122 33 501 220 771 871 167 81 426 122 33 501 220 771 871 167 81 684 507 763 855 271 422 923 684 507 763 ...

output:

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

result:

ok 1000 arrays, sum_len = 5461

Test #36:

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

input:

1000
5590 605 593 969 925 605 593 969 925 179 280 639 586 691 356 136 477 228 179 280 639 586 691 356 136 477 228 996 432 703 760 524 996 432 703 760 524 37 386 277 373 824 645 608 664 790 862 37 386 277 373 824 645 608 664 790 862 641 641 648 592 445 648 592 445 665 866 470 595 172 711 526 897 665 ...

output:

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

result:

ok 1000 arrays, sum_len = 5545

Test #37:

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

input:

1000
1000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52...

result:

ok 1000 arrays, sum_len = 1000

Test #38:

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

input:

1000
1776 1 2 1 2 1 1 1 2 1 2 2 1 2 1 2 1 2 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2 1 2 1 2 1 2 1 2 2 1 2 1 2 2 1 2 1 1 2 1 2 2 1 2 1 2 1 2 1 1 2 1 2 1 2 1 2 2 1 2 1 2 1 2 1 1 2 1 2 1 1 1 2 1 2 1 1 2 1 2 1 2 1 2 1 1 2 1 2 2 1 2 1 2 1 2 1 2 1 2 1 1 1 2 1 2 1 1 2 1 2 2 2 1 1 2 1 2 1 2 1 2 1 2 2 2 1 2 1 1 ...

output:

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

result:

ok 1000 arrays, sum_len = 1789

Test #39:

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

input:

1000
2402 3 1 2 3 1 2 2 2 3 1 3 1 2 1 3 2 1 3 1 3 2 1 3 2 3 3 3 2 1 3 2 1 2 3 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 2 3 2 2 3 1 2 3 1 3 1 3 1 3 1 2 3 1 2 3 1 3 1 3 3 1 1 3 2 1 3 2 1 2 3 2 3 3 1 3 1 3 1 3 1 1 3 1 3 2 3 2 3 1 2 3 1 2 3 3 3 2 3 2 3 2 3 2 3 1 3 1 3 1 2 3 1 2 3 2 1 2 1 2 2 3 3 3 3 3 2 3 2 2 2 2 ...

output:

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

result:

ok 1000 arrays, sum_len = 2420

Test #40:

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

input:

1000
2846 1 3 4 2 1 3 4 2 4 1 4 1 3 1 4 2 3 1 4 2 1 2 1 2 1 1 3 4 2 3 4 2 3 3 1 2 3 4 1 2 3 4 3 3 3 4 3 4 1 2 1 2 2 1 4 2 1 4 4 1 4 1 3 2 4 3 2 4 4 1 4 1 2 3 1 2 3 1 3 4 1 2 3 4 1 2 3 4 3 4 2 1 3 4 2 1 3 4 1 2 4 3 1 2 4 3 1 4 2 3 1 4 2 3 2 3 4 1 2 3 4 1 3 2 1 4 3 2 1 4 2 3 1 2 3 1 2 3 2 3 4 3 2 4 3 ...

output:

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

result:

ok 1000 arrays, sum_len = 2872

Test #41:

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

input:

1000
1030 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52...

result:

ok 1000 arrays, sum_len = 1023

Test #42:

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

input:

1000
1532 1 1 1 1 1 1 6 13 4 16 19 10 11 6 13 4 16 19 10 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 6 20 18 10 5 2 6 20 18 10 5 1 1 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 15 1 16 5 18 12 11 7 15 1 16 5 18 12 11 7 1 1 1 1 1 3 14 18 6 8 20 2 1 3 14 18 6 8 20 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

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

result:

ok 1000 arrays, sum_len = 1423

Test #43:

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

input:

1000
1058 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52...

result:

ok 1000 arrays, sum_len = 1057

Test #44:

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

input:

1000
1078 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 20 20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52...

result:

ok 1000 arrays, sum_len = 1082

Test #45:

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

input:

1000
1182 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 17 20 2 17 20 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 13 10 3 13 10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 14 18 14 18 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52...

result:

ok 1000 arrays, sum_len = 1180

Test #46:

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

input:

1000
1998 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 ...

output:

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

result:

ok 1000 arrays, sum_len = 1999

Test #47:

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

input:

1000
1998 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 ...

output:

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

result:

ok 1000 arrays, sum_len = 1999

Test #48:

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

input:

1000
2000 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 ...

output:

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

result:

ok 1000 arrays, sum_len = 2000

Test #49:

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

input:

1000
2000 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 ...

output:

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

result:

ok 1000 arrays, sum_len = 2000

Test #50:

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

input:

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

output:

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

result:

ok 1000 arrays, sum_len = 1084

Test #51:

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

input:

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

output:

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

result:

ok 1000 arrays, sum_len = 1041

Test #52:

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

input:

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

output:

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

result:

ok 1000 arrays, sum_len = 1013