QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#155505#7119. Longest Tripzhouhuanyi#15 8ms4116kbC++142.7kb2023-09-01 18:18:252024-04-28 07:37:07

Judging History

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

  • [2024-04-28 07:37:07]
  • 管理员手动重测本题所有提交记录
  • 测评结果:15
  • 用时:8ms
  • 内存:4116kb
  • [2023-09-01 18:18:26]
  • 评测
  • 测评结果:15
  • 用时:18ms
  • 内存:4132kb
  • [2023-09-01 18:18:25]
  • 提交

answer

#include"longesttrip.h"
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<random>
#define N 256
using namespace std;
mt19937 RAND(random_device{}());
int n,P[N+1],lg[N+1];
bool check(int x,int y)
{
	return are_connected({x},{y});
}
bool check2(vector<int>p,int d,int x)
{
	vector<int>q;
	for (int i=d;i<p.size();++i) q.push_back(p[i]);
	return are_connected(q,{x});
}
bool check3(vector<int>p,int d,int x)
{
	vector<int>q;
	for (int i=0;i<=d;++i) q.push_back(p[i]);
	return are_connected(q,{x});
}
vector<int>longest_trip(int SN, int D)
{
	vector<int>p;
	vector<int>p2;
	vector<int>q;
	int x;
	n=SN;
	for (int i=2;i<=N;++i) lg[i]=lg[i>>1]+1;
    if (D==3)
	{
		for (int i=0;i<n;++i) p.push_back(i);
		return p;
	}
	else if (D==2)
	{
		if (!check(0,1)) p.push_back(0),p.push_back(2),p.push_back(1);
		else if (!check(0,2)) p.push_back(0),p.push_back(1),p.push_back(2);
		else p.push_back(1),p.push_back(0),p.push_back(2);
		for (int i=3;i<n;++i)
		{
			if (!check(p.back(),i)) reverse(p.begin(),p.end());
			p.push_back(i);
		}
		return p;
	}
	else
	{
		for (int i=0;i<n;++i) P[i]=i;
		shuffle(P,P+n,RAND),p.push_back(P[0]);
		for (int i=1;i<n;++i)
		{
			if (p2.empty())
			{
				if (check(p.back(),{P[i]})) p.push_back(P[i]);
				else if (check(p[0],{P[i]})) reverse(p.begin(),p.end()),p.push_back(P[i]);
				else if (!are_connected(p,{P[i]})) p2.push_back(P[i]);
				else
				{
					x=p.size()-1,q.clear();
					if (p.size()>=3)
					{
						if (check2(p,p.size()-2,P[i])) x-=2;
						else
						{
							for (int j=lg[p.size()];j>=0;--j)
								if (x-(1<<j)>=1&&!check2(p,x-(1<<j),P[i]))
									x-=(1<<j);
							x--;
						}
					}
					else
					{
						for (int j=lg[p.size()];j>=0;--j)
							if (x-(1<<j)>=1&&!check2(p,x-(1<<j),P[i]))
								x-=(1<<j);
						x--;
					}
					for (int j=(int)(p.size())-1;j>=x+1;--j) q.push_back(p[j]);
					for (int j=0;j<=x;++j) q.push_back(p[j]);
					q.push_back(P[i]),p=q;
				}
			}
			else
			{
				if (!are_connected(p2,{P[i]})) p.push_back(P[i]);
				else if (!are_connected(p,{P[i]})) p2.push_back(P[i]);
				else
				{
					x=-1,q.clear();
					for (int j=lg[p.size()];j>=0;--j)
						if (x+(1<<j)+1<p.size()&&!check3(p,x+(1<<j),P[i]))
							x+=(1<<j);
					x++;
					for (int j=0;j<p.size();++j)
						if (j!=x)
							q.push_back(p[j]);
					q.push_back(p[x]),q.push_back(P[i]),x=-1;
					for (int j=lg[p2.size()];j>=0;--j)
						if (x+(1<<j)+1<p2.size()&&!check3(p2,x+(1<<j),P[i]))
							x+=(1<<j);
					x++,q.push_back(p2[x]);
					for (int j=0;j<p2.size();++j)
						if (j!=x)
							q.push_back(p2[j]);
					p=q,p2.clear();
				}
			}
			if (p.size()<p2.size()) swap(p,p2);
		}
		return p;
	}
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

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

input:

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

output:

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

result:

ok 

Test #2:

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

input:

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 10 0 1 2 3 4 5 6 7 8 9
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 10 0 1 2 3 4 5 6 7 8 9
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 10 0 1 2 3 4 5 6 7 8 9
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 10 0 1 2 3 4 5 6 7 8 9
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 10 0 1 2 3 4 5 6 7 8 9
3kC2Ia2048...

result:

ok 

Test #3:

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

input:

22
50 3
1
50 3
1
50 3
1
50 3
1
50 3
1
50 3
1
50 3
1
50 3
1
50 3
1
50 3
1
50 3
1
50 3
1
50 3
1
50 3
1
50 3
1
50 3
1
50 3
1
50 3
1
50 3
1
50 3
1
12 3
1
12 3
1

output:

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

result:

ok 

Test #4:

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

input:

8
128 3
1
128 3
1
128 3
1
128 3
1
128 3
1
128 3
1
128 3
1
128 3
1

output:

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

result:

ok 

Test #5:

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

input:

4
256 3
1
256 3
1
256 3
1
256 3
1

output:

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

result:

ok 

Subtask #2:

score: 10
Accepted

Test #6:

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

input:

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

output:

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

result:

ok 

Test #7:

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

input:

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 7...

result:

ok 

Test #8:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 7...

result:

ok 

Test #9:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 7...

result:

ok 

Test #10:

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

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 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 7...

result:

ok 

Test #11:

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

input:

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

output:

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

result:

ok 

Test #12:

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

input:

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

output:

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

result:

ok 

Test #13:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 7...

result:

ok 

Test #14:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 7...

result:

ok 

Test #15:

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

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 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 7...

result:

ok 

Test #16:

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

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 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 7...

result:

ok 

Test #17:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 7...

result:

ok 

Test #18:

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

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 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 7...

result:

ok 

Subtask #3:

score: 0
Wrong Answer

Test #19:

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

input:

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

output:

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

result:

ok 

Test #20:

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

input:

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 9 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 7
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 7 8
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 8 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 3...

result:

ok 

Test #21:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 45 31
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 31 49
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 49 19
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 19 46
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 46 9
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 9 38
3kC2Ia2048BfyJVGojMUKKtilctlZKcB...

result:

ok 

Test #22:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 107 62
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 62 48
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 48 40
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 40 122
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 122 61
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 61 77
3kC2Ia2048BfyJVGojMUKKtilct...

result:

ok 

Test #23:

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

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 123 127
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 127 76
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 76 111
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 111 121
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 121 138
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 138 162
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #24:

score: 0
Accepted
time: 4ms
memory: 4108kb

input:

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

output:

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

result:

ok 

Test #25:

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

input:

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

output:

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

result:

ok 

Test #26:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 27 28
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 28 12
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 12 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 42
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 42 35
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 35 21
3kC2Ia2048BfyJVGojMUKKtilctlZKcB...

result:

ok 

Test #27:

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

input:

11
101 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
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
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 32 56
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 56 63
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 63 20
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 32 20
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 20 81
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 81 6
3kC2Ia2048BfyJVGojMUKKtilctlZKc...

result:

ok 

Test #28:

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

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 87 254
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 178
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 178 51
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 51 204
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 204 183
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 183 217
3kC2Ia2048BfyJVGojMUK...

result:

ok 

Test #29:

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

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
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
1
1
1
1
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 64 182
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 182 181
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 181 139
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 139 149
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 149 41
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 41 242
3kC2Ia2048BfyJVGojMUK...

result:

ok 

Test #30:

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

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 133 211
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 211 127
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 127 19
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 19 204
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 204 192
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 192 162
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #31:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 150
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 150 76
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 76 159
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 159 162
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 162 238
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 238 181
3kC2Ia2048BfyJVGojMUKK...

result:

ok 

Test #32:

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

input:

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

output:

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

result:

ok 

Test #33:

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

input:

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

output:

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

result:

ok 

Test #34:

score: -25
Wrong Answer
time: 0ms
memory: 3828kb

input:

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 13
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 13
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 13
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 13 10
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 10
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2...

result:

wrong answer 

Subtask #4:

score: 0
Wrong Answer

Test #83:

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

input:

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

output:

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

result:

ok 

Test #84:

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

input:

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

output:

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

result:

ok 

Test #85:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 11 42
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 42 28
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 28 40
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 40 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 0 46
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0...

result:

ok 

Test #86:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 117 54
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 54 94
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 94 16
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 16 57
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 57 70
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 70 91
3kC2Ia2048BfyJVGojMUKKtilctlZ...

result:

ok 

Test #87:

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

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 158 25
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 25 97
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 97 35
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 35 79
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 79 138
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 138 45
3kC2Ia2048BfyJVGojMUKKtilct...

result:

ok 

Test #88:

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

input:

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

output:

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

result:

ok 

Test #89:

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

input:

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

output:

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

result:

ok 

Test #90:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 40 33
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 33 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 22
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 22 32
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 32 8
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 8 18
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0...

result:

ok 

Test #91:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 77 51
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 51 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 21
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 21 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 20
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 20 55
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0...

result:

ok 

Test #92:

score: 60
Accepted
time: 7ms
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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 139 103
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 103 180
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 180 218
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 218 79
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 79 28
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 28 37
3kC2Ia2048BfyJVGojMUKKt...

result:

ok 

Test #93:

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

input:

4
256 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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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 124 25
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 25 204
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 204 112
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 112 39
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 39 203
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 203 110
3kC2Ia2048BfyJVGojMUKK...

result:

ok 

Test #94:

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

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 4 187
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 187 195
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 195 120
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 120 177
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 177 231
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 231 46
3kC2Ia2048BfyJVGojMUK...

result:

ok 

Test #95:

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

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 29 150
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 150 34
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 34 75
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 75 62
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 62 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 186
3kC2Ia2048BfyJVGojMUKKtilctlZ...

result:

ok 

Test #96:

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

input:

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

output:

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

result:

ok 

Test #97:

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

input:

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

output:

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

result:

ok 

Test #98:

score: 0
Wrong Answer
time: 2ms
memory: 3824kb

input:

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 9
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 9 15
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 15 10
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 10 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 14
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 ...

result:

wrong answer