QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#131875#5134. Jagged Skylinemshcherba#AC ✓47ms3600kbC++171.1kb2023-07-28 18:06:002023-07-28 18:06:04

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-28 18:06:04]
  • 评测
  • 测评结果:AC
  • 用时:47ms
  • 内存:3600kb
  • [2023-07-28 18:06:00]
  • 提交

answer

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

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define FOR(i, a, b) for (int i = (a); i<(b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i>=(a); --i)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define FILL(a, b) memset(a, b, sizeof(a))

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;

bool ask(int x, LL y) {
	cout << "? " << x << " " << y << endl;
	string res;
	cin >> res;
	return res[0] == 'b';
}

int main()
{
	//ios::sync_with_stdio(false);
	//cin.tie(0);	
	int w;
	LL h;
	cin >> w >> h;
	vector<int> a(w);
	iota(ALL(a), 1);
	mt19937 rng;
	shuffle(ALL(a), rng);
	int bestX = a[0];
	LL bestY = 0;
	for (int i : a) {
		if (bestY < h && ask(i, bestY + 1)) {
			LL l = bestY + 1, r = h + 1;
			while (r - l > 1) {
				LL m = (l + r) / 2;
				if (ask(i, m)) {
					l = m;
				}
				else {
					r = m;
				}
			}
			bestX = i;
			bestY = l;
		}
	}
	cout << "! " << bestX << " " << bestY << endl;
	return 0;
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1 1
sky

output:

? 1 1
! 1 0

result:

ok Used 1 queries

Test #2:

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

input:

1 1
building

output:

? 1 1
! 1 1

result:

ok Used 1 queries

Test #3:

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

input:

2 1
sky
sky

output:

? 1 1
? 2 1
! 1 0

result:

ok Used 2 queries

Test #4:

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

input:

2 1
building

output:

? 1 1
! 1 1

result:

ok Used 1 queries

Test #5:

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

input:

2 1000000000000000000
sky
sky

output:

? 1 1
? 2 1
! 1 0

result:

ok Used 2 queries

Test #6:

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

input:

2 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky

output:

? 1 1
? 1 500000000000000001
? 1 250000000000000001
? 1 125000000000000001
? 1 62500000000000001
? 1 31250000000000001
? 1 15625000000000001
? 1 7812500000000001
? 1 3906250000000001
? 1 1953125000000001
? 1 976562500000001
? 1 488281250000001
? 1 244140625000001
? 1 122070312500001
? 1 610351562500...

result:

ok Used 61 queries

Test #7:

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

input:

3 3
building
sky
sky
sky

output:

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

result:

ok Used 4 queries

Test #8:

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

input:

5 5
sky
building
building
building
building

output:

? 4 1
? 3 1
? 3 3
? 3 4
? 3 5
! 3 5

result:

ok Used 5 queries

Test #9:

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

input:

8 4
building
sky
building
sky
sky
building
sky
sky
sky
sky
sky

output:

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

result:

ok Used 11 queries

Test #10:

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

input:

10 100
building
building
sky
building
building
sky
building
building
sky
sky
sky
sky
sky
building
sky
sky
sky
sky
sky
sky
sky

output:

? 3 1
? 3 51
? 3 76
? 3 63
? 3 69
? 3 72
? 3 70
? 3 71
? 10 72
? 1 72
? 6 72
? 5 72
? 7 72
? 8 72
? 8 86
? 8 79
? 8 75
? 8 73
? 2 73
? 4 73
? 9 73
! 8 72

result:

ok Used 21 queries

Test #11:

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

input:

100 1000
building
building
sky
sky
building
sky
building
building
building
sky
building
building
building
sky
building
sky
sky
sky
building
building
sky
building
building
sky
building
sky
building
building
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
s...

output:

? 63 1
? 63 501
? 63 751
? 63 626
? 63 563
? 63 594
? 63 578
? 63 586
? 63 590
? 63 592
? 63 591
? 22 592
? 22 796
? 22 898
? 22 847
? 22 872
? 22 859
? 22 853
? 22 850
? 22 851
? 22 852
? 28 852
? 28 926
? 28 963
? 28 944
? 28 953
? 28 948
? 28 950
? 28 951
? 28 952
? 86 952
? 5 952
? 51 952
? 41 9...

result:

ok Used 137 queries

Test #12:

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

input:

100 10
building
sky
sky
sky
building
sky
building
sky
building
building
building
building

output:

? 63 1
? 63 6
? 63 3
? 63 2
? 22 2
? 22 6
? 22 4
? 22 5
? 28 5
? 28 8
? 28 9
? 28 10
! 28 10

result:

ok Used 12 queries

Test #13:

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

input:

1 98
building
building
building
sky
building
sky
sky

output:

? 1 1
? 1 50
? 1 74
? 1 86
? 1 80
? 1 83
? 1 81
! 1 80

result:

ok Used 7 queries

Test #14:

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

input:

899 2794
building
building
sky
building
sky
building
building
building
sky
building
building
building
building
sky
sky
sky
sky
sky
building
building
sky
building
building
building
building
sky
building
sky
sky
sky
sky
sky
sky
sky
sky
building
building
building
sky
building
sky
building
sky
sky
sky
s...

output:

? 527 1
? 527 1398
? 527 2096
? 527 1747
? 527 1921
? 527 1834
? 527 1877
? 527 1899
? 527 1910
? 527 1904
? 527 1907
? 527 1908
? 527 1909
? 127 1910
? 490 1910
? 339 1910
? 556 1910
? 261 1910
? 176 1910
? 176 2352
? 176 2573
? 176 2462
? 176 2517
? 176 2545
? 176 2559
? 176 2566
? 176 2562
? 176 ...

result:

ok Used 937 queries

Test #15:

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

input:

6370 86
building
sky
sky
sky
sky
building
building
building
building
sky
sky
sky
building
building
sky
sky
building
building
sky
building
building
building
building
sky
sky
sky
sky
sky
building
building
sky
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
sky...

output:

? 2184 1
? 2184 44
? 2184 22
? 2184 11
? 2184 6
? 2184 3
? 2184 4
? 2184 5
? 2431 6
? 2431 46
? 2431 26
? 2431 16
? 2431 11
? 2431 13
? 2431 14
? 1805 14
? 312 14
? 312 50
? 312 68
? 312 59
? 312 63
? 312 65
? 312 66
? 312 67
? 4024 67
? 1815 67
? 910 67
? 6313 67
? 536 67
? 536 77
? 536 82
? 536 79...

result:

ok Used 147 queries

Test #16:

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

input:

3647 2089
building
building
sky
sky
building
building
sky
sky
building
sky
sky
sky
building
sky
sky
sky
sky
sky
sky
sky
building
building
building
sky
sky
building
building
building
building
sky
building
building
sky
building
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
b...

output:

? 527 1
? 527 1045
? 527 1567
? 527 1306
? 527 1175
? 527 1240
? 527 1273
? 527 1256
? 527 1248
? 527 1252
? 527 1250
? 527 1249
? 2434 1249
? 2434 1669
? 2434 1459
? 2434 1354
? 2434 1301
? 2434 1275
? 2434 1262
? 2434 1255
? 2434 1252
? 2434 1253
? 2434 1254
? 1806 1255
? 1825 1255
? 3146 1255
? 3...

result:

ok Used 1063 queries

Test #17:

score: 0
Accepted
time: 11ms
memory: 3472kb

input:

3813 63935448
building
building
building
building
building
building
building
sky
sky
sky
building
building
building
building
building
building
sky
sky
sky
building
sky
building
sky
sky
building
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
s...

output:

? 527 1
? 527 31967725
? 527 47951587
? 527 55943518
? 527 59939483
? 527 61937466
? 527 62936457
? 527 63435953
? 527 63186205
? 527 63061331
? 527 62998894
? 527 63030112
? 527 63045721
? 527 63053526
? 527 63057428
? 527 63059379
? 527 63060355
? 527 63059867
? 527 63059623
? 527 63059501
? 527 6...

result:

ok Used 3969 queries

Test #18:

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

input:

3689 531350850216
building
sky
building
sky
sky
building
sky
sky
building
building
building
sky
building
building
sky
sky
sky
building
building
building
sky
sky
building
building
building
building
building
sky
sky
building
building
sky
building
building
building
sky
sky
sky
sky
building
sky
sky
sky
...

output:

? 527 1
? 527 265675425109
? 527 132837712555
? 527 199256568832
? 527 166047140693
? 527 149442426624
? 527 157744783658
? 527 153593605141
? 527 151518015882
? 527 152555810511
? 527 153074707826
? 527 153334156483
? 527 153204432154
? 527 153269294318
? 527 153301725400
? 527 153285509859
? 527 1...

result:

ok Used 3997 queries

Test #19:

score: 0
Accepted
time: 24ms
memory: 3492kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
building
sky
building
building
sky
sky
building
sky
sky
sky
sky
sky
building
building
sky
building
sky
sky
building
building
building
sky
sky
sky
building
building
sky
sky
sky
sky
building
sky
building
sky
building
building
sky
sky
sky
building
sky
...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 62500000000000001
? 2184 31250000000000001
? 2184 46875000000000001
? 2184 39062500000000001
? 2184 42968750000000001
? 2184 44921875000000001
? 2184 43945312500000001
? 2184 43457031250000001
? 2184 437011...

result:

ok Used 10522 queries

Test #20:

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

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
building
building
sky
building
sky
sky
building
sky
buil...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 62500000000000001
? 2184 31250000000000001
? 2184 15625000000000001
? 2184 7812500000000001
? 2184 3906250000000001
? 2184 1953125000000001
? 2184 976562500000001
? 2184 488281250000001
? 2184 2441406250000...

result:

ok Used 10298 queries

Test #21:

score: 0
Accepted
time: 47ms
memory: 3488kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
s...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 62500000000000001
? 2184 31250000000000001
? 2184 15625000000000001
? 2184 7812500000000001
? 2184 3906250000000001
? 2184 1953125000000001
? 2184 976562500000001
? 2184 488281250000001
? 2184 2441406250000...

result:

ok Used 10059 queries

Test #22:

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

input:

10000 1000000000000000000
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sk...

output:

? 2184 1
? 2431 1
? 7871 1
? 312 1
? 7913 1
? 9918 1
? 9437 1
? 6313 1
? 536 1
? 4896 1
? 7323 1
? 5754 1
? 8145 1
? 2265 1
? 3284 1
? 847 1
? 3975 1
? 5233 1
? 7117 1
? 6148 1
? 7846 1
? 635 1
? 3120 1
? 587 1
? 2008 1
? 3226 1
? 7598 1
? 3483 1
? 1887 1
? 4555 1
? 5556 1
? 3688 1
? 2969 1
? 8866 1...

result:

ok Used 10059 queries

Test #23:

score: 0
Accepted
time: 28ms
memory: 3480kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
building
sky
sky
sky
sky
sky
sky
sky
sky...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 62500000000000001
? 2184 31250000000000001
? 2184 15625000000000001
? 2184 7812500000000001
? 2184 3906250000000001
? 2184 1953125000000001
? 2184 976562500000001
? 2184 488281250000001
? 2184 2441406250000...

result:

ok Used 10059 queries

Test #24:

score: 0
Accepted
time: 21ms
memory: 3488kb

input:

10000 1000000000000000000
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
buil...

output:

? 2184 1
? 2184 500000000000000001
? 2184 750000000000000001
? 2184 875000000000000001
? 2184 937500000000000001
? 2184 968750000000000001
? 2184 984375000000000001
? 2184 992187500000000001
? 2184 996093750000000001
? 2184 998046875000000001
? 2184 999023437500000001
? 2184 999511718750000001
? 218...

result:

ok Used 8115 queries

Test #25:

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

input:

8 4
building
sky
building
building
sky
sky
building

output:

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

result:

ok Used 7 queries

Test #26:

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

input:

8 4
building
building
building

output:

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

result:

ok Used 3 queries

Test #27:

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

input:

3 3
sky
building
building
building

output:

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

result:

ok Used 4 queries

Test #28:

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

input:

3 3
building
building
building

output:

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

result:

ok Used 3 queries

Test #29:

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

input:

5 5
sky
building
building
sky
sky
building
building

output:

? 4 1
? 3 1
? 3 3
? 3 4
? 5 4
? 1 4
? 1 5
! 1 5

result:

ok Used 7 queries

Test #30:

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

input:

8 4
building
sky
sky
sky
sky
building
building
sky
building

output:

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

result:

ok Used 9 queries

Test #31:

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

input:

3 3
building
sky
building
building

output:

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

result:

ok Used 4 queries

Test #32:

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

input:

10000 1000000000000000000
building
sky
sky
building
building
building
sky
sky
sky
sky
sky
sky
sky
building
building
sky
building
building
sky
building
sky
building
sky
sky
sky
building
sky
building
sky
building
building
sky
sky
building
sky
sky
sky
sky
building
building
sky
building
sky
sky
sky
buil...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 187500000000000001
? 2184 218750000000000001
? 2184 234375000000000001
? 2184 226562500000000001
? 2184 222656250000000001
? 2184 220703125000000001
? 2184 219726562500000001
? 2184 219238281250000001
? 218...

result:

ok Used 10449 queries

Test #33:

score: 0
Accepted
time: 33ms
memory: 3480kb

input:

10000 1000000000000000000
building
building
building
sky
sky
building
sky
sky
sky
sky
building
sky
sky
building
sky
building
sky
building
building
sky
building
sky
sky
sky
building
building
building
sky
sky
sky
sky
building
building
building
building
building
sky
building
building
sky
sky
building
b...

output:

? 2184 1
? 2184 500000000000000001
? 2184 750000000000000001
? 2184 875000000000000001
? 2184 812500000000000001
? 2184 781250000000000001
? 2184 796875000000000001
? 2184 789062500000000001
? 2184 785156250000000001
? 2184 783203125000000001
? 2184 782226562500000001
? 2184 782714843750000001
? 218...

result:

ok Used 10475 queries

Test #34:

score: 0
Accepted
time: 27ms
memory: 3516kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
building
sky
sky
building
sky
sky
building
sky
building
building
sky
sky
sky
building
bu...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 62500000000000001
? 2184 31250000000000001
? 2184 15625000000000001
? 2184 7812500000000001
? 2184 3906250000000001
? 2184 1953125000000001
? 2184 976562500000001
? 2184 488281250000001
? 2184 2441406250000...

result:

ok Used 10480 queries

Test #35:

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

input:

10000 1000000000000000000
building
sky
sky
building
building
sky
sky
building
sky
sky
building
building
building
building
building
sky
building
building
sky
sky
sky
sky
building
sky
building
building
sky
building
building
building
building
building
building
building
sky
building
building
sky
sky
bui...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 187500000000000001
? 2184 218750000000000001
? 2184 203125000000000001
? 2184 195312500000000001
? 2184 199218750000000001
? 2184 197265625000000001
? 2184 196289062500000001
? 2184 196777343750000001
? 218...

result:

ok Used 10664 queries

Test #36:

score: 0
Accepted
time: 23ms
memory: 3528kb

input:

10000 1000000000000000000
building
building
building
building
sky
sky
sky
sky
sky
building
building
sky
building
building
sky
sky
sky
building
sky
building
sky
sky
sky
building
building
building
building
building
sky
sky
sky
building
sky
building
building
building
building
building
sky
sky
building
...

output:

? 2184 1
? 2184 500000000000000001
? 2184 750000000000000001
? 2184 875000000000000001
? 2184 937500000000000001
? 2184 906250000000000001
? 2184 890625000000000001
? 2184 882812500000000001
? 2184 878906250000000001
? 2184 876953125000000001
? 2184 877929687500000001
? 2184 878417968750000001
? 218...

result:

ok Used 10429 queries

Test #37:

score: 0
Accepted
time: 46ms
memory: 3496kb

input:

10000 1000000000000000000
building
sky
sky
building
sky
building
building
sky
sky
sky
sky
sky
sky
building
building
building
building
building
sky
sky
building
building
sky
building
sky
sky
sky
sky
building
building
sky
sky
building
sky
building
sky
building
sky
building
sky
building
sky
sky
buildin...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 187500000000000001
? 2184 156250000000000001
? 2184 171875000000000001
? 2184 179687500000000001
? 2184 175781250000000001
? 2184 173828125000000001
? 2184 172851562500000001
? 2184 172363281250000001
? 218...

result:

ok Used 10657 queries

Test #38:

score: 0
Accepted
time: 24ms
memory: 3476kb

input:

10000 1000000000000000000
building
sky
sky
building
building
building
sky
sky
sky
sky
building
sky
sky
sky
building
sky
building
building
building
building
sky
sky
sky
building
building
building
sky
sky
sky
sky
sky
sky
sky
building
building
building
building
sky
building
sky
building
building
buildi...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 187500000000000001
? 2184 218750000000000001
? 2184 234375000000000001
? 2184 226562500000000001
? 2184 222656250000000001
? 2184 220703125000000001
? 2184 219726562500000001
? 2184 220214843750000001
? 218...

result:

ok Used 10450 queries

Test #39:

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

input:

10000 1000000000000000000
building
building
building
sky
building
building
sky
sky
sky
building
sky
building
building
building
building
sky
building
sky
sky
building
building
sky
sky
sky
sky
sky
sky
building
building
building
building
sky
building
building
building
building
building
sky
building
sky...

output:

? 2184 1
? 2184 500000000000000001
? 2184 750000000000000001
? 2184 875000000000000001
? 2184 812500000000000001
? 2184 843750000000000001
? 2184 859375000000000001
? 2184 851562500000000001
? 2184 847656250000000001
? 2184 845703125000000001
? 2184 846679687500000001
? 2184 846191406250000001
? 218...

result:

ok Used 10430 queries

Test #40:

score: 0
Accepted
time: 33ms
memory: 3432kb

input:

10000 1000000000000000000
building
sky
sky
building
building
sky
sky
sky
sky
sky
building
sky
building
sky
building
sky
building
building
building
sky
sky
sky
sky
building
building
sky
sky
building
building
building
building
building
building
sky
building
sky
sky
building
sky
building
building
sky
b...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 187500000000000001
? 2184 218750000000000001
? 2184 203125000000000001
? 2184 195312500000000001
? 2184 191406250000000001
? 2184 189453125000000001
? 2184 188476562500000001
? 2184 188964843750000001
? 218...

result:

ok Used 10655 queries

Test #41:

score: 0
Accepted
time: 31ms
memory: 3480kb

input:

10000 1000000000000000000
building
building
building
sky
building
sky
sky
sky
sky
sky
building
building
sky
sky
sky
sky
building
sky
sky
building
building
sky
sky
building
building
building
sky
building
sky
building
building
sky
building
building
building
sky
building
sky
building
building
building
...

output:

? 2184 1
? 2184 500000000000000001
? 2184 750000000000000001
? 2184 875000000000000001
? 2184 812500000000000001
? 2184 843750000000000001
? 2184 828125000000000001
? 2184 820312500000000001
? 2184 816406250000000001
? 2184 814453125000000001
? 2184 813476562500000001
? 2184 813964843750000001
? 218...

result:

ok Used 10487 queries

Test #42:

score: 0
Accepted
time: 35ms
memory: 3476kb

input:

10000 1000000000000000000
building
building
building
sky
sky
building
sky
sky
sky
sky
building
sky
building
building
building
sky
sky
sky
building
sky
sky
sky
sky
sky
building
building
building
sky
sky
building
sky
sky
sky
sky
building
sky
sky
sky
sky
sky
sky
sky
building
sky
building
building
build...

output:

? 2184 1
? 2184 500000000000000001
? 2184 750000000000000001
? 2184 875000000000000001
? 2184 812500000000000001
? 2184 781250000000000001
? 2184 796875000000000001
? 2184 789062500000000001
? 2184 785156250000000001
? 2184 783203125000000001
? 2184 782226562500000001
? 2184 782714843750000001
? 218...

result:

ok Used 10473 queries

Test #43:

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

input:

10000 1000000000000000000
building
sky
building
building
sky
sky
building
building
sky
sky
sky
building
sky
sky
building
sky
building
sky
sky
sky
sky
sky
building
building
building
sky
sky
sky
sky
building
building
building
building
building
building
building
sky
sky
sky
building
sky
sky
sky
sky
bui...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 375000000000000001
? 2184 437500000000000001
? 2184 406250000000000001
? 2184 390625000000000001
? 2184 398437500000000001
? 2184 402343750000000001
? 2184 400390625000000001
? 2184 399414062500000001
? 2184 398925781250000001
? 218...

result:

ok Used 10484 queries

Test #44:

score: 0
Accepted
time: 29ms
memory: 3540kb

input:

10000 1000000000000000000
building
sky
sky
building
sky
sky
sky
building
sky
building
building
sky
building
building
sky
sky
building
building
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
building
building
building
building
building
building
building
sky
building
sky
sky
building
building
building
s...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 187500000000000001
? 2184 156250000000000001
? 2184 140625000000000001
? 2184 132812500000000001
? 2184 136718750000000001
? 2184 134765625000000001
? 2184 135742187500000001
? 2184 136230468750000001
? 218...

result:

ok Used 10779 queries

Test #45:

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

input:

10000 1000000000000000000
building
sky
sky
building
building
sky
sky
sky
building
building
sky
building
building
building
building
sky
building
building
building
building
building
sky
sky
building
building
sky
building
sky
sky
sky
sky
sky
sky
sky
building
building
building
building
sky
building
buil...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 187500000000000001
? 2184 218750000000000001
? 2184 203125000000000001
? 2184 195312500000000001
? 2184 191406250000000001
? 2184 193359375000000001
? 2184 194335937500000001
? 2184 193847656250000001
? 218...

result:

ok Used 10607 queries

Test #46:

score: 0
Accepted
time: 42ms
memory: 3476kb

input:

10000 1000000000000000000
building
sky
sky
building
building
building
sky
sky
sky
sky
building
building
sky
building
sky
building
building
building
building
sky
sky
sky
sky
building
building
sky
building
building
building
building
building
building
sky
sky
building
sky
building
sky
sky
building
buil...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 187500000000000001
? 2184 218750000000000001
? 2184 234375000000000001
? 2184 226562500000000001
? 2184 222656250000000001
? 2184 220703125000000001
? 2184 219726562500000001
? 2184 220214843750000001
? 218...

result:

ok Used 10451 queries

Test #47:

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

input:

100 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
building
sky
sky
building
building
building
sky
sky
building
sky
sky
building
sky
building
building
building
sky
building
building
bui...

output:

? 63 1
? 63 500000000000000001
? 63 250000000000000001
? 63 125000000000000001
? 63 62500000000000001
? 63 31250000000000001
? 63 15625000000000001
? 63 7812500000000001
? 63 3906250000000001
? 63 1953125000000001
? 63 976562500000001
? 63 488281250000001
? 63 244140625000001
? 63 122070312500001
? ...

result:

ok Used 340 queries

Test #48:

score: 0
Accepted
time: 28ms
memory: 3496kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
building
sky
sky
building
building
building
sky
sky
building
sky...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 62500000000000001
? 2184 31250000000000001
? 2184 15625000000000001
? 2184 7812500000000001
? 2184 3906250000000001
? 2184 1953125000000001
? 2184 976562500000001
? 2184 488281250000001
? 2184 2441406250000...

result:

ok Used 10418 queries

Test #49:

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

input:

100 1000000000000000000
building
sky
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
bu...

output:

? 63 1
? 63 500000000000000001
? 63 250000000000000001
? 63 375000000000000001
? 63 437500000000000001
? 63 468750000000000001
? 63 484375000000000001
? 63 492187500000000001
? 63 496093750000000001
? 63 498046875000000001
? 63 499023437500000001
? 63 499511718750000001
? 63 499755859375000001
? 63 ...

result:

ok Used 134 queries

Test #50:

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

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
buildin...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 62500000000000001
? 2184 31250000000000001
? 2184 15625000000000001
? 2184 7812500000000001
? 2184 11718750000000001
? 2184 13671875000000001
? 2184 14648437500000001
? 2184 15136718750000001
? 2184 1538085...

result:

ok Used 479 queries

Test #51:

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

input:

100 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
building
sky
sky
building
building
building
sky
sky
building
sky
sky
building
sky
building
building
building
sky
building
building
building
sky
building
sky
sky
sky
building
building
building
sky
building
sky
sky
b...

output:

? 63 1
? 63 500000000000000001
? 63 250000000000000001
? 63 125000000000000001
? 63 62500000000000001
? 63 31250000000000001
? 63 15625000000000001
? 63 7812500000000001
? 63 3906250000000001
? 63 1953125000000001
? 63 976562500000001
? 63 1464843750000001
? 63 1220703125000001
? 63 1098632812500001...

result:

ok Used 159 queries

Test #52:

score: 0
Accepted
time: 16ms
memory: 3484kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
building
sky
sky
building
building
building
sky
sky
building
sky
sky
building
sky
building
building
building
sky
building
bu...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 62500000000000001
? 2184 31250000000000001
? 2184 15625000000000001
? 2184 7812500000000001
? 2184 3906250000000001
? 2184 1953125000000001
? 2184 976562500000001
? 2184 488281250000001
? 2184 2441406250000...

result:

ok Used 10417 queries

Test #53:

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

input:

100 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
bui...

output:

? 63 1
? 63 500000000000000001
? 63 250000000000000001
? 63 125000000000000001
? 63 62500000000000001
? 63 31250000000000001
? 63 15625000000000001
? 63 7812500000000001
? 63 3906250000000001
? 63 1953125000000001
? 63 976562500000001
? 63 488281250000001
? 63 244140625000001
? 63 122070312500001
? ...

result:

ok Used 191 queries

Test #54:

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

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
building
bu...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 62500000000000001
? 2184 31250000000000001
? 2184 15625000000000001
? 2184 7812500000000001
? 2184 3906250000000001
? 2184 1953125000000001
? 2184 976562500000001
? 2184 488281250000001
? 2184 2441406250000...

result:

ok Used 401 queries

Test #55:

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

input:

100 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
sky
sky
building
sky
sky
sky
s...

output:

? 63 1
? 63 500000000000000001
? 63 250000000000000001
? 63 125000000000000001
? 63 62500000000000001
? 63 31250000000000001
? 63 15625000000000001
? 63 7812500000000001
? 63 3906250000000001
? 63 1953125000000001
? 63 976562500000001
? 63 488281250000001
? 63 244140625000001
? 63 122070312500001
? ...

result:

ok Used 399 queries

Test #56:

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

input:

100 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
building
sky
sky
sky
sky
sky
sky
building
building
sky
sky
sky
sky
building
sky
sky
building
building
building
building
building
building
sky
sky
sky
sky
sky
sky
building
building
sky
building
building
buil...

output:

? 63 1
? 63 500000000000000001
? 63 250000000000000001
? 63 125000000000000001
? 63 62500000000000001
? 63 31250000000000001
? 63 15625000000000001
? 63 7812500000000001
? 63 3906250000000001
? 63 1953125000000001
? 63 976562500000001
? 63 488281250000001
? 63 244140625000001
? 63 366210937500001
? ...

result:

ok Used 400 queries

Test #57:

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

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
building
building
sky
sky
building
sky
building
sky
buil...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 62500000000000001
? 2184 31250000000000001
? 2184 15625000000000001
? 2184 7812500000000001
? 2184 3906250000000001
? 2184 1953125000000001
? 2184 976562500000001
? 2184 488281250000001
? 2184 2441406250000...

result:

ok Used 10600 queries

Test #58:

score: 0
Accepted
time: 28ms
memory: 3552kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
sky
building
building
building
building
sky
sky
building
sky
sky
sky
sky
building
sky
building
building
sky
building
sky
sky
building
sky
building
sky
building
sky
building
sky
sky
building
sky
sky
building
build...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 62500000000000001
? 2184 31250000000000001
? 2184 15625000000000001
? 2184 7812500000000001
? 2184 3906250000000001
? 2184 1953125000000001
? 2184 976562500000001
? 2184 1464843750000001
? 2184 122070312500...

result:

ok Used 10539 queries

Test #59:

score: 0
Accepted
time: 20ms
memory: 3544kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
sky
sky
building
sky
sky
sky
building
sky
building
building
sky
building
building
sky
building
building
building
building
sky
sky
building
sky
building
building
sky
building
sky
sky
sky
building
sky
building
building...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 62500000000000001
? 2184 31250000000000001
? 2184 15625000000000001
? 2184 7812500000000001
? 2184 3906250000000001
? 2184 1953125000000001
? 2184 976562500000001
? 2184 1464843750000001
? 2184 122070312500...

result:

ok Used 10419 queries

Test #60:

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

input:

10000 1000000000000000000
building
building
building
sky
building
building
building
sky
sky
building
sky
building
sky
sky
building
sky
building
sky
sky
building
building
sky
building
sky
sky
sky
sky
sky
sky
building
sky
sky
building
sky
building
sky
building
building
sky
building
sky
sky
sky
buildin...

output:

? 2184 1
? 2184 500000000000000001
? 2184 750000000000000001
? 2184 875000000000000001
? 2184 812500000000000001
? 2184 843750000000000001
? 2184 859375000000000001
? 2184 867187500000000001
? 2184 863281250000000001
? 2184 861328125000000001
? 2184 862304687500000001
? 2184 861816406250000001
? 218...

result:

ok Used 10480 queries

Test #61:

score: 0
Accepted
time: 30ms
memory: 3480kb

input:

10000 1000000000000000000
building
sky
building
sky
sky
sky
building
sky
building
sky
sky
sky
building
building
sky
sky
sky
building
sky
building
sky
sky
building
building
building
building
sky
building
building
building
sky
sky
sky
sky
sky
building
sky
building
building
building
sky
building
sky
bu...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 375000000000000001
? 2184 312500000000000001
? 2184 281250000000000001
? 2184 265625000000000001
? 2184 273437500000000001
? 2184 269531250000000001
? 2184 271484375000000001
? 2184 270507812500000001
? 2184 270019531250000001
? 218...

result:

ok Used 10431 queries

Test #62:

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

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
sky
building
building
sky
building
building
building...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 62500000000000001
? 2184 31250000000000001
? 2184 15625000000000001
? 2184 7812500000000001
? 2184 3906250000000001
? 2184 1953125000000001
? 2184 976562500000001
? 2184 488281250000001
? 2184 2441406250000...

result:

ok Used 10958 queries

Test #63:

score: 0
Accepted
time: 11ms
memory: 3472kb

input:

10000 1000000000000000000
building
building
sky
building
building
building
sky
building
sky
sky
sky
sky
building
building
sky
building
sky
sky
sky
sky
building
building
building
sky
building
building
sky
sky
building
sky
sky
sky
building
sky
building
sky
building
sky
building
building
building
build...

output:

? 2184 1
? 2184 500000000000000001
? 2184 750000000000000001
? 2184 625000000000000001
? 2184 687500000000000001
? 2184 718750000000000001
? 2184 734375000000000001
? 2184 726562500000000001
? 2184 730468750000000001
? 2184 728515625000000001
? 2184 727539062500000001
? 2184 727050781250000001
? 218...

result:

ok Used 10318 queries

Test #64:

score: 0
Accepted
time: 17ms
memory: 3496kb

input:

10000 1000000000000000000
building
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
sky
building
building
sky
sky
sky
building
sky
sky
sky
building
building
building
sky
building
building
sky
sky
building
building
building
building
sky
building
sky
building
building
sky
sky
sky
building
sky
building
sky
buil...

output:

? 2184 1
? 2184 500000000000000001
? 2184 250000000000000001
? 2184 125000000000000001
? 2184 62500000000000001
? 2184 31250000000000001
? 2184 15625000000000001
? 2184 7812500000000001
? 2184 3906250000000001
? 2184 1953125000000001
? 2184 976562500000001
? 2184 488281250000001
? 2184 2441406250000...

result:

ok Used 10599 queries