QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#162362#7119. Longest Tripzhouhuanyi15 32ms3800kbC++143.0kb2023-09-03 11:05:062023-09-03 11:05:06

Judging History

你现在查看的是测评时间为 2023-09-03 11:05:06 的历史记录

  • [2024-04-28 08:13:11]
  • 管理员手动重测本题所有提交记录
  • 测评结果:15
  • 用时:7ms
  • 内存:4116kb
  • [2023-09-03 11:05:06]
  • 评测
  • 测评结果:15
  • 用时:32ms
  • 内存:3800kb
  • [2023-09-03 11:05:06]
  • 提交

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--;
						else
						{
							for (int j=lg[p.size()];j>=0;--j)
							{
								if (x-(1<<j)>=1)
								{
									if (!check2(p,x-(1<<j),P[i])) x-=(1<<j);
									else
									{
										x-=(1<<j);
										break;
									}
								}
								if (!j) x--;
							}
						}
					}
					else
					{
						for (int j=lg[p.size()];j>=0;--j)
						{
							if (x-(1<<j)>=1)
							{
								if (!check2(p,x-(1<<j),P[i])) x-=(1<<j);
								else
								{
									x-=(1<<j);
									break;
								}
							}
							if (!j) x--;
						}
					}
					for (int j=x+1;j<p.size();++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: 2ms
memory: 3664kb

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

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: 2ms
memory: 3640kb

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

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

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: 18ms
memory: 3760kb

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

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: 0ms
memory: 3764kb

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: 5ms
memory: 3668kb

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: 5ms
memory: 3668kb

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: 5ms
memory: 3780kb

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: 32ms
memory: 3688kb

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

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

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: 0ms
memory: 3680kb

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: 8ms
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 

Test #17:

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

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: 19ms
memory: 3708kb

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: 11ms
memory: 3652kb

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

result:

ok 

Test #20:

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

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

result:

ok 

Test #21:

score: 0
Accepted
time: 13ms
memory: 3656kb

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 12 28
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 28 27
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 27 15
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 15 21
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 21 20
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 20 43
3kC2Ia2048BfyJVGojMUKKtilctlZK...

result:

ok 

Test #22:

score: 0
Accepted
time: 15ms
memory: 3676kb

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 94 111
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 111 63
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 63 67
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 67 19
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 19 119
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 119 27
3kC2Ia2048BfyJVGojMUKKtilc...

result:

ok 

Test #23:

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

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 223 61
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 61 159
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 159 194
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 194 111
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 111 215
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 215 136
3kC2Ia2048BfyJVGojMU...

result:

ok 

Test #24:

score: 0
Accepted
time: 9ms
memory: 3660kb

input:

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

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

result:

ok 

Test #25:

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

input:

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

output:

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

result:

ok 

Test #26:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 49 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 43
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 43 22
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 22 36
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 36 20
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 20 13
3kC2Ia2048BfyJVGojMUKKtilctlZKcB...

result:

ok 

Test #27:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 46 38
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 38 98
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 98 33
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 33 66
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 66 89
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 89 62
3kC2Ia2048BfyJVGojMUKKtilctlZK...

result:

ok 

Test #28:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 17 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 4 84
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 84 149
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 149 32
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 32 208
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 208 201
3kC2Ia2048BfyJVGojMUKKtilct...

result:

ok 

Test #29:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 139 221
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 221 252
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 252 30
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 30 31
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 31 37
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 37 112
3kC2Ia2048BfyJVGojMUKKti...

result:

ok 

Test #30:

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

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 126 122
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 122 97
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 97 76
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 76 209
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 209 82
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 82 255
3kC2Ia2048BfyJVGojMUKKti...

result:

ok 

Test #31:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 254 14
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 14 174
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 174 48
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 48 137
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 137 168
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 168 95
3kC2Ia2048BfyJVGojMUKKt...

result:

ok 

Test #32:

score: 0
Accepted
time: 12ms
memory: 3636kb

input:

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

output:

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

result:

ok 

Test #33:

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

input:

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

result:

ok 

Test #34:

score: -25
Wrong Answer
time: 19ms
memory: 3792kb

input:

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 11
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 11 8
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 8 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 3 1 6 11 8 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 4
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 ...

result:

wrong answer 

Subtask #4:

score: 0
Wrong Answer

Test #83:

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

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

result:

ok 

Test #84:

score: 60
Accepted
time: 8ms
memory: 3660kb

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

result:

ok 

Test #85:

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

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 38 19
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 19 23
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 23 32
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 32 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 29
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 29 5
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
...

result:

ok 

Test #86:

score: 60
Accepted
time: 8ms
memory: 3660kb

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 60 92
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 92 106
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 106 121
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 121 67
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 67 70
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 70 48
3kC2Ia2048BfyJVGojMUKKtilc...

result:

ok 

Test #87:

score: 60
Accepted
time: 12ms
memory: 3668kb

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 125 248
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 248 34
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 34 246
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 246 136
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 136 95
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 95 168
3kC2Ia2048BfyJVGojMUKK...

result:

ok 

Test #88:

score: 60
Accepted
time: 1ms
memory: 3648kb

input:

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

output:

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

result:

ok 

Test #89:

score: 60
Accepted
time: 14ms
memory: 3636kb

input:

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

output:

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

result:

ok 

Test #90:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 32 39
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 39 46
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 46 7
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 7 43
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 43 11
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 11 13
3kC2Ia2048BfyJVGojMUKKtilctlZKcB...

result:

ok 

Test #91:

score: 60
Accepted
time: 10ms
memory: 3604kb

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 79 13
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 13 22
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 22 66
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 66 59
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 59 67
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 67 35
3kC2Ia2048BfyJVGojMUKKtilctlZK...

result:

ok 

Test #92:

score: 60
Accepted
time: 14ms
memory: 3760kb

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 96 186
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 186 245
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 245 156
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 156 6
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 6 19
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 19 233
3kC2Ia2048BfyJVGojMUKKtil...

result:

ok 

Test #93:

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

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 249 113
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 113 167
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 167 69
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 69 160
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 160 34
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 34 120
3kC2Ia2048BfyJVGojMUKK...

result:

ok 

Test #94:

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

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 193 35
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 35 174
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 174 237
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 237 173
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 173 230
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 230 59
3kC2Ia2048BfyJVGojMUK...

result:

ok 

Test #95:

score: 60
Accepted
time: 9ms
memory: 3800kb

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
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 231 75
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 75 71
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 71 240
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 240 60
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 60 208
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 208 40
3kC2Ia2048BfyJVGojMUKKtil...

result:

ok 

Test #96:

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

input:

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

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

result:

ok 

Test #97:

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

input:

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

output:

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

result:

ok 

Test #98:

score: 0
Wrong Answer
time: 5ms
memory: 3680kb

input:

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 13
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 13 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 5 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 5 13 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 7
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 12
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 3...

result:

wrong answer