QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#527629#7119. Longest Tripgreen_gold_dog#15 7ms4172kbC++205.8kb2024-08-22 17:49:142024-08-22 17:49:16

Judging History

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

  • [2024-08-22 17:49:16]
  • 评测
  • 测评结果:15
  • 用时:7ms
  • 内存:4172kb
  • [2024-08-22 17:49:14]
  • 提交

answer

#include "longesttrip.h"
#include<bits/stdc++.h>

using namespace std;

typedef int ll;

ll find_what(vector<ll> fir, vector<ll> sec) {
	if (sec.size() == 1) {
		return sec[0];
	}
	vector<ll> fs, ss;
	for (ll i = 0; i < sec.size(); i++) {
		if (i % 2 == 0) {
			fs.push_back(sec[i]);
		} else {
			ss.push_back(sec[i]);
		}
	}
	if (are_connected(fir, ss)) {
		return find_what(fir, ss);
	} else {
		return find_what(fir, fs);
	}
}

vector<ll> longest_trip(ll n, ll d) {
	vector<ll> nw;
	nw.push_back(0);
	vector<vector<ll>> comps;
	for (ll i = 1; i < n; i++) {
		comps.push_back(vector<ll>(1, i));
	}
	while (comps.size() > 1) {
		vector<ll> now(1, nw.back());
		if (are_connected(now, comps.back())) {
			ll x = find_what(now, comps.back());
			nw.push_back(x);
			for (auto i : comps.back()) {
				if (i != x) {
					nw.push_back(i);
				}
			}
			comps.pop_back();
			continue;
		}
		vector<ll> nc = comps.back();
		comps.pop_back();
		while (!comps.empty()) {
			if (are_connected(now, comps.back())) {
				ll x = find_what(now, comps.back());
				nw.push_back(x);
				for (auto i : comps.back()) {
					if (i != x) {
						nw.push_back(i);
					}
				}
				comps.pop_back();
				break;
			}
			for (auto i : comps.back()) {
				nc.push_back(i);
			}
			comps.pop_back();
		}
		comps.insert(comps.begin(), nc);
	}
	vector<ll> now(1, comps[0][0]);
	if (are_connected(now, nw)) {
		vector<ll> now1(1, nw[0]);
		if (are_connected(now, now1)) {
			reverse(nw.begin(), nw.end());
			for (auto i : comps[0]) {
				nw.push_back(i);
			}
			return nw;
		}
		now1[0] = nw.back();
		if (are_connected(now, now1)) {
			for (auto i : comps[0]) {
				nw.push_back(i);
			}
			return nw;
		}
		ll x = find_what(now, nw);
		vector<ll> ans;
		while (nw.back() != x) {
			ans.push_back(nw.back());
			nw.pop_back();
		}
		for (auto i : nw) {
			ans.push_back(i);
		}
		for (auto i : comps[0]) {
			ans.push_back(i);
		}
		return ans;
	}
	if (comps[0].size() > nw.size()) {
		swap(nw, comps[0]);
	}
	return nw;
	if (are_connected(now, nw)) {
	}
	if (are_connected(nw, comps[0])) {
		ll x = find_what(nw, comps[0]);
		ll y = find_what(vector<ll>(1, x), nw);
		vector<ll> ans;
		for (auto i : nw) {
			if (i != y) {
				ans.push_back(i);
			}
		}
		ans.push_back(y);
		ans.push_back(x);
		for (auto i : comps[0]) {
			if (i != x) {
				ans.push_back(i);
			}
		}
		return ans;
	}
	if (nw.size() < comps[0].size()) {
		swap(nw, comps[0]);
	}
	return nw;
}

#ifdef LOCAL
static inline constexpr int maxNumberOfCalls = 32640;
static inline constexpr int maxTotalNumberOfCalls = 150000;
static inline constexpr int maxTotalNumberOfLandmarksInCalls = 1500000;
static int call_counter = 0;
static int total_call_counter = 0;
static int landmark_counter = 0;

static int C, N, D;
static std::vector<std::vector<int>> U;
static std::vector<bool> present;

static inline void protocol_violation(std::string message)
{
    printf("Protocol Violation: %s\n", message.c_str());
    exit(0);
}

bool are_connected(std::vector<int> A, std::vector<int> B)
{
    ++call_counter;
    ++total_call_counter;
    if (call_counter > maxNumberOfCalls || total_call_counter > maxTotalNumberOfCalls)
    {
        protocol_violation("too many calls");
    }

    int nA = A.size(), nB = B.size();
    landmark_counter += nA + nB;
    if (landmark_counter > maxTotalNumberOfLandmarksInCalls)
    {
        protocol_violation("too many elements");
    }

    if (nA == 0 || nB == 0)
    {
        protocol_violation("invalid array");
    }
    for (int i = 0; i < nA; ++i)
    {
        if (A[i] < 0 || N <= A[i])
        {
            protocol_violation("invalid array");
        }
        if (present[A[i]])
        {
            protocol_violation("invalid array");
        }
        present[A[i]] = true;
    }
    for (int i = 0; i < nA; ++i)
    {
        present[A[i]] = false;
    }
    for (int i = 0; i < nB; ++i)
    {
        if (B[i] < 0 || N <= B[i])
        {
            protocol_violation("invalid array");
        }
        if (present[B[i]])
        {
            protocol_violation("invalid array");
        }
        present[B[i]] = true;
    }
    for (int i = 0; i < nB; ++i)
    {
        present[B[i]] = false;
    }

    for (int i = 0; i < nA; ++i)
    {
        for (int j = 0; j < nB; ++j)
        {
            if (A[i] == B[j])
            {
                protocol_violation("non-disjoint arrays");
            }
        }
    }

    for (int i = 0; i < nA; ++i)
    {
        for (int j = 0; j < nB; ++j)
        {
            if (U[std::max(A[i], B[j])][std::min(A[i], B[j])] == 1)
            {
                return true;
            }
        }
    }

    return false;
}

int main()
{
    assert(1 == scanf("%d", &C));
    int maximumCalls = 0;
    for (int c = 0; c < C; ++c)
    {
        call_counter = 0;
        assert(2 == scanf("%d %d", &N, &D));

        present.assign(N, false);
        U.resize(N);
        for (int i = 1; i < N; ++i)
        {
            U[i].resize(i);
            for (int j = 0; j < i; ++j)
            {
                assert(1 == scanf("%d", &U[i][j]));
            }
        }

        for (int i = 2; i < N; ++i)
        {
            for (int j = 1; j < i; ++j)
            {
                for (int k = 0; k < j; ++k)
                {
                    if (U[i][j] + U[i][k] + U[j][k] < D)
                    {
                        printf("Insufficient Density\n");
                        exit(0);
                    }
                }
            }
        }

        std::vector<int> t = longest_trip(N, D);
        int l = t.size();
        printf("%d\n", l);
        for (int i = 0; i < l; ++i)
        {
            printf(i == 0 ? "%d" : " %d", t[i]);
        }
        printf("\n");
        printf("%d\n", call_counter);

        maximumCalls = std::max(maximumCalls, call_counter);
        call_counter = 0;
    }
    printf("%d\n", maximumCalls);

    return 0;
}
#endif

詳細信息

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 7ms
memory: 3816kb

input:

341
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 2 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1...

result:

ok 

Test #2:

score: 5
Accepted
time: 6ms
memory: 3828kb

input:

103
10 3
1
1
1
1
1
1
1
1
1
1
1
10 3
1
1
1
1
1
1
1
1
1
1
1
10 3
1
1
1
1
1
1
1
1
1
1
1
10 3
1
1
1
1
1
1
1
1
1
1
1
10 3
1
1
1
1
1
1
1
1
1
1
1
10 3
1
1
1
1
1
1
1
1
1
1
1
10 3
1
1
1
1
1
1
1
1
1
1
1
10 3
1
1
1
1
1
1
1
1
1
1
1
10 3
1
1
1
1
1
1
1
1
1
1
1
10 3
1
1
1
1
1
1
1
1
1
1
1
10 3
1
1
1
1
1
1
1
1
1
1
1...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 9
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 9 8
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 8 7
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 7 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 3...

result:

ok 

Test #3:

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

input:

22
50 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
1
1
1
1
1
1
1
1
1
1
50 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
1
1
1
1
1
1
1
1
1
1
50 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
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 49
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 49 48
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 48 47
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 47 46
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 46 45
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 45 44
3kC2Ia2048BfyJVGojMUKKtilctlZKc...

result:

ok 

Test #4:

score: 5
Accepted
time: 3ms
memory: 3788kb

input:

8
128 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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
128 3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 127
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 127 126
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 126 125
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 125 124
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 124 123
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 123 122
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #5:

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

input:

4
256 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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 255
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 255 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 253
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 253 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 251
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 251 250
3kC2Ia2048BfyJVGojMU...

result:

ok 

Subtask #2:

score: 10
Accepted

Test #6:

score: 10
Accepted
time: 0ms
memory: 3908kb

input:

341
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 2 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1...

result:

ok 

Test #7:

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

input:

103
10 2
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 9
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 9 8
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 8 7
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 7 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 3...

result:

ok 

Test #8:

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

input:

22
50 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
50 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
50 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
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 49
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 49 48
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 48 47
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 47 46
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 46 45
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 45 44
3kC2Ia2048BfyJVGojMUKKtilctlZKc...

result:

ok 

Test #9:

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

input:

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 127
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 127 126
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 126 125
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 125 124
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 124 123
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 123 122
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #10:

score: 10
Accepted
time: 5ms
memory: 3864kb

input:

4
256 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
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 255
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 255 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 253
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 253 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 251
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 251 250
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #11:

score: 10
Accepted
time: 0ms
memory: 4120kb

input:

341
3 2
1
1
1
1
3 2
0
1
1
0
1
1
3 2
0
1
1
0
1
1
3 2
0
1
1
0
1
1
3 2
1
1
1
1
3 2
0
1
1
0
1
1
3 2
0
1
1
0
1
1
3 2
1
1
0
1
1
3 2
1
1
0
1
1
3 2
0
1
1
0
1
1
3 2
1
1
0
1
1
3 2
0
1
1
0
1
1
3 2
1
1
1
1
3 2
1
1
0
1
1
3 2
0
1
1
0
1
1
3 2
0
1
1
0
1
1
3 2
1
1
0
1
1
3 2
0
1
1
0
1
1
3 2
1
1
0
1
1
3 2
0
1
1
0
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 2 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 2...

result:

ok 

Test #12:

score: 10
Accepted
time: 3ms
memory: 3796kb

input:

103
10 2
1
1
1
0
1
1
0
1
1
1
1
1
1
10 2
0
1
1
1
0
1
1
0
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
10 2
0
1
1
1
1
1
1
1
1
1
0
1
1
10 2
0
1
1
0
1
1
1
1
1
1
1
1
1
10 2
1
1
1
0
1
1
1
1
1
1
1
1
10 2
1
1
1
1
0
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
0
1
1
1
1
0
1
1
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 9
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 9 8
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 8 7
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 7 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 7 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 3...

result:

ok 

Test #13:

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

input:

22
50 2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
50 2
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
50 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
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 49
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 49 48
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 48 47
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 47 46
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 46 45
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 45 44
3kC2Ia2048BfyJVGojMUKKtilctlZKc...

result:

ok 

Test #14:

score: 10
Accepted
time: 0ms
memory: 3860kb

input:

11
101 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
101 2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 100
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 100 99
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 99 98
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 98 97
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 97 96
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 96 95
3kC2Ia2048BfyJVGojMUKKtilctlZ...

result:

ok 

Test #15:

score: 10
Accepted
time: 6ms
memory: 3852kb

input:

4
256 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
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 255
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 255 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 253
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 253 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 251
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 251 250
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #16:

score: 10
Accepted
time: 6ms
memory: 4152kb

input:

4
256 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
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 255
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 255 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 253
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 253 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 251
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 251 250
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #17:

score: 10
Accepted
time: 4ms
memory: 3804kb

input:

4
256 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
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 255
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 255 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 253
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 253 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 251
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 251 250
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #18:

score: 10
Accepted
time: 7ms
memory: 4172kb

input:

4
256 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
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 255
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 255 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 253
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 253 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 251
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 251 250
3kC2Ia2048BfyJVGojMU...

result:

ok 

Subtask #3:

score: 0
Wrong Answer

Test #19:

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

input:

341
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 2 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1...

result:

ok 

Test #20:

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

input:

103
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 9
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 9 8
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 8 7
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 7 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 3...

result:

ok 

Test #21:

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

input:

22
50 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
50 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
50 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 49
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 49 48
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 48 47
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 47 46
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 46 45
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 45 44
3kC2Ia2048BfyJVGojMUKKtilctlZKc...

result:

ok 

Test #22:

score: 25
Accepted
time: 2ms
memory: 4128kb

input:

8
128 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
128 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 127
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 127 126
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 126 125
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 125 124
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 124 123
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 123 122
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #23:

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

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 255
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 255 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 253
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 253 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 251
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 251 250
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #24:

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

input:

341
3 1
1
1
1
1
3 1
0
1
1
0
1
1
3 1
0
1
1
0
1
1
3 1
0
1
1
0
1
1
3 1
1
1
1
1
3 1
0
1
1
0
1
1
3 1
0
1
1
0
1
1
3 1
1
1
0
1
1
3 1
1
1
0
1
1
3 1
0
1
1
0
1
1
3 1
1
1
0
1
1
3 1
0
1
1
0
1
1
3 1
1
1
1
1
3 1
1
1
0
1
1
3 1
0
1
1
0
1
1
3 1
0
1
1
0
1
1
3 1
1
1
0
1
1
3 1
0
1
1
0
1
1
3 1
1
1
0
1
1
3 1
0
1
1
0
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 2 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 2...

result:

ok 

Test #25:

score: 25
Accepted
time: 2ms
memory: 3832kb

input:

103
10 1
1
1
1
0
1
1
0
1
1
1
1
1
1
10 1
0
1
1
1
0
1
1
0
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
0
1
1
1
1
1
1
1
1
1
0
1
1
10 1
0
1
1
0
1
1
1
1
1
1
1
1
1
10 1
1
1
1
0
1
1
1
1
1
1
1
1
10 1
1
1
1
1
0
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
0
1
1
1
1
0
1
1
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 9
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 9 8
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 8 7
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 7 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 7 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 3...

result:

ok 

Test #26:

score: 25
Accepted
time: 6ms
memory: 3840kb

input:

22
50 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
50 1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
50 1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 49
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 49 48
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 48 47
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 47 46
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 46 45
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 45 44
3kC2Ia2048BfyJVGojMUKKtilctlZKc...

result:

ok 

Test #27:

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

input:

11
101 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
101 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 100
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 100 99
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 99 98
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 98 97
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 97 96
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 96 95
3kC2Ia2048BfyJVGojMUKKtilctlZ...

result:

ok 

Test #28:

score: 25
Accepted
time: 5ms
memory: 3920kb

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 255
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 255 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 253
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 253 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 251
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 251 250
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #29:

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

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 255
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 255 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 253
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 253 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 251
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 251 250
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #30:

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

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 255
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 255 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 253
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 253 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 251
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 251 250
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #31:

score: 25
Accepted
time: 3ms
memory: 3868kb

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 255
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 255 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 253
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 253 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 251
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 251 250
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #32:

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

input:

341
3 1
1
0
1
3 1
1
0
1
3 1
1
0
1
3 1
0
0
0
1
3 1
1
0
1
3 1
1
0
1
3 1
0
0
0
1
3 1
1
0
1
3 1
1
0
1
3 1
1
0
1
3 1
1
0
1
3 1
0
0
0
1
3 1
0
1
0
1
3 1
0
0
0
1
3 1
0
0
0
1
3 1
0
0
0
1
3 1
0
0
0
1
3 1
1
0
1
3 1
0
0
0
1
3 1
1
0
1
3 1
1
0
1
3 1
0
0
0
1
3 1
0
1
0
1
3 1
1
0
1
3 1
1
0
1
3 1
1
0
1
3 1
1
0
1
3 1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 2 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 2 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2...

result:

ok 

Test #33:

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

input:

205
5 1
1
0
1
0
0
0
1
5 1
0
1
0
1
0
0
0
1
5 1
0
0
1
1
0
1
5 1
0
1
0
0
0
0
1
5 1
0
1
0
0
0
0
1
5 1
1
1
0
0
0
1
5 1
0
0
0
1
0
1
5 1
1
0
0
1
0
1
5 1
1
0
0
1
0
1
5 1
0
1
0
0
0
0
1
5 1
0
1
0
1
0
0
0
1
5 1
0
1
0
0
0
0
1
5 1
0
0
1
1
0
1
5 1
1
1
0
0
0
1
5 1
0
1
0
1
0
0
0
1
5 1
0
1
0
1
0
0
0
1
5 1
0
1
0
1
0
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 3 1 0 4 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 0...

result:

ok 

Test #34:

score: 0
Wrong Answer
time: 1ms
memory: 3828kb

input:

64
16 1
0
1
1
1
0
1
1
1
1
1
1
0
0
1
0
1
1
1
1
1
1
1
16 1
1
1
1
1
0
1
1
0
0
1
0
0
0
1
1
1
1
1
1
1
1
16 1
1
0
0
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
16 1
1
0
1
1
0
0
0
1
0
1
0
1
1
0
1
1
1
1
1
1
1
1
1
16 1
1
1
0
1
1
1
0
1
1
0
1
1
1
0
1
1
1
1
1
0
0
1
1
1
1
16 1
1
1
1
1
1
0
1
1
0
1
1
1
0
1
0
1
1
1
1
1
1
16 ...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 15
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 14
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 14 13
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 13 12
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 12 11
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 12 10
3kC2Ia2048BfyJVGojMUKKtilctlZKcB...

result:

wrong answer 

Subtask #4:

score: 0
Wrong Answer

Test #83:

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

input:

341
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 2 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1...

result:

ok 

Test #84:

score: 60
Accepted
time: 5ms
memory: 3824kb

input:

103
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 9
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 9 8
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 8 7
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 7 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 3...

result:

ok 

Test #85:

score: 60
Accepted
time: 3ms
memory: 3868kb

input:

22
50 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
50 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
50 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 49
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 49 48
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 48 47
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 47 46
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 46 45
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 45 44
3kC2Ia2048BfyJVGojMUKKtilctlZKc...

result:

ok 

Test #86:

score: 60
Accepted
time: 5ms
memory: 3844kb

input:

8
128 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
128 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 127
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 127 126
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 126 125
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 125 124
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 124 123
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 123 122
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #87:

score: 60
Accepted
time: 0ms
memory: 4112kb

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 255
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 255 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 253
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 253 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 251
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 251 250
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #88:

score: 60
Accepted
time: 5ms
memory: 3840kb

input:

341
3 1
1
1
1
1
3 1
0
1
1
0
1
1
3 1
0
1
1
0
1
1
3 1
0
1
1
0
1
1
3 1
1
1
1
1
3 1
0
1
1
0
1
1
3 1
0
1
1
0
1
1
3 1
1
1
0
1
1
3 1
1
1
0
1
1
3 1
0
1
1
0
1
1
3 1
1
1
0
1
1
3 1
0
1
1
0
1
1
3 1
1
1
1
1
3 1
1
1
0
1
1
3 1
0
1
1
0
1
1
3 1
0
1
1
0
1
1
3 1
1
1
0
1
1
3 1
0
1
1
0
1
1
3 1
1
1
0
1
1
3 1
0
1
1
0
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 2 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 2...

result:

ok 

Test #89:

score: 60
Accepted
time: 4ms
memory: 4128kb

input:

103
10 1
1
1
1
0
1
1
0
1
1
1
1
1
1
10 1
0
1
1
1
0
1
1
0
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
0
1
1
1
1
1
1
1
1
1
0
1
1
10 1
0
1
1
0
1
1
1
1
1
1
1
1
1
10 1
1
1
1
0
1
1
1
1
1
1
1
1
10 1
1
1
1
1
0
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
0
1
1
1
1
0
1
1
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 9
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 9 8
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 8 7
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 7 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 7 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 3...

result:

ok 

Test #90:

score: 60
Accepted
time: 0ms
memory: 3804kb

input:

22
50 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
50 1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
50 1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 49
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 49 48
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 48 47
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 47 46
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 46 45
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 45 44
3kC2Ia2048BfyJVGojMUKKtilctlZKc...

result:

ok 

Test #91:

score: 60
Accepted
time: 5ms
memory: 3808kb

input:

11
101 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
101 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 100
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 100 99
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 99 98
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 98 97
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 97 96
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 96 95
3kC2Ia2048BfyJVGojMUKKtilctlZ...

result:

ok 

Test #92:

score: 60
Accepted
time: 6ms
memory: 3820kb

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 255
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 255 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 253
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 253 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 251
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 251 250
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #93:

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

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 255
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 255 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 253
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 253 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 251
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 251 250
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #94:

score: 60
Accepted
time: 2ms
memory: 3852kb

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 255
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 255 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 253
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 253 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 251
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 251 250
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #95:

score: 60
Accepted
time: 7ms
memory: 3856kb

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 255
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 255 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 253
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 253 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 251
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 251 250
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #96:

score: 60
Accepted
time: 4ms
memory: 3896kb

input:

341
3 1
1
0
1
3 1
1
0
1
3 1
1
0
1
3 1
0
0
0
1
3 1
1
0
1
3 1
1
0
1
3 1
0
0
0
1
3 1
1
0
1
3 1
1
0
1
3 1
1
0
1
3 1
1
0
1
3 1
0
0
0
1
3 1
0
1
0
1
3 1
0
0
0
1
3 1
0
0
0
1
3 1
0
0
0
1
3 1
0
0
0
1
3 1
1
0
1
3 1
0
0
0
1
3 1
1
0
1
3 1
1
0
1
3 1
0
0
0
1
3 1
0
1
0
1
3 1
1
0
1
3 1
1
0
1
3 1
1
0
1
3 1
1
0
1
3 1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 2 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 2 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 2 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2...

result:

ok 

Test #97:

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

input:

205
5 1
1
0
1
0
0
0
1
5 1
0
1
0
1
0
0
0
1
5 1
0
0
1
1
0
1
5 1
0
1
0
0
0
0
1
5 1
0
1
0
0
0
0
1
5 1
1
1
0
0
0
1
5 1
0
0
0
1
0
1
5 1
1
0
0
1
0
1
5 1
1
0
0
1
0
1
5 1
0
1
0
0
0
0
1
5 1
0
1
0
1
0
0
0
1
5 1
0
1
0
0
0
0
1
5 1
0
0
1
1
0
1
5 1
1
1
0
0
0
1
5 1
0
1
0
1
0
0
0
1
5 1
0
1
0
1
0
0
0
1
5 1
0
1
0
1
0
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 3 1 0 4 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 0...

result:

ok 

Test #98:

score: 0
Wrong Answer
time: 1ms
memory: 4132kb

input:

64
16 1
0
1
1
1
0
1
1
1
1
1
1
0
0
1
0
1
1
1
1
1
1
1
16 1
1
1
1
1
0
1
1
0
0
1
0
0
0
1
1
1
1
1
1
1
1
16 1
1
0
0
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
16 1
1
0
1
1
0
0
0
1
0
1
0
1
1
0
1
1
1
1
1
1
1
1
1
16 1
1
1
0
1
1
1
0
1
1
0
1
1
1
0
1
1
1
1
1
0
0
1
1
1
1
16 1
1
1
1
1
1
0
1
1
0
1
1
1
0
1
0
1
1
1
1
1
1
16 ...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 15
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 14
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 14 13
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 13 12
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 12 11
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 12 10
3kC2Ia2048BfyJVGojMUKKtilctlZKcB...

result:

wrong answer