QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#901192#10087. ArchaeologyTranscend Lights (Qiwen Xu, Nuo Chen, Fanyou He)#AC ✓2ms6116kbC++263.7kb2025-02-15 19:45:482025-02-15 19:45:50

Judging History

This is the latest submission verdict.

  • [2025-02-15 19:45:50]
  • Judged
  • Verdict: AC
  • Time: 2ms
  • Memory: 6116kb
  • [2025-02-15 19:45:48]
  • Submitted

answer

//Author: Kevin
#include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define ull unsigned ll
#define pb emplace_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (int)(x.size())
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define lb(v,x) (int)(lower_bound(ALL(v),x)-v.begin())
#define ub(v,x) (int)(upper_bound(ALL(v),x)-v.begin())
#define uni(v) v.resize(unique(ALL(v))-v.begin())
#define longer __int128_t
void die(string S){puts(S.c_str());exit(0);}
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define db double
const int maxn=1e5+5;
const db eps=1e-6;
struct pt{db x,y;}p[maxn];
pt operator -(pt A,pt B){return {A.x-B.x,A.y-B.y};}
pt operator +(pt A,pt B){return {A.x+B.x,A.y+B.y};}
db operator *(pt A,pt B){return A.x*B.x+A.y*B.y;}
db operator ^(pt A,pt B){return A.x*B.y-A.y*B.x;}
pt operator *(db a,pt B){return {a*B.x,a*B.y};}
db atan2(pt A){return atan2(A.y,A.x);}
int dcmp(db x){return (x>eps)-(x<-eps);}
db len(pt A){return sqrt(A.x*A.x+A.y*A.y);}
db dis(pt A,pt B){return len(B-A);}
struct line{pt p,q;}L[maxn];
pt itsect(line A,line B){
	pt u=A.p-B.p;
	db t=(B.q^u)/(A.q^B.q);
	return A.p+t*A.q;
}
int q[maxn],ql,qr,n,cnt=0;
#define Poly vector<pt>
bool operator <(line A,line B){
	db sa=atan2(A.q),sb=atan2(B.q);
	if(dcmp(sa-sb)!=0)return sa<sb;
	return (A.q^(B.p-A.p))>0;
}
db calcS(Poly P){
	db S=0;for(int i=1;i+1<P.size();i++)S+=(P[i]-P[0])^(P[i+1]-P[0]);
	return S/2.0;
}
Poly Half_itsect(){
	sort(L+1,L+n+1);
	ql=1,qr=0;
	for(int i=1;i<=n;i++){
		while(qr>ql&&((itsect(L[q[qr]],L[q[qr-1]])-L[i].p)^L[i].q)>0)--qr;
		while(qr>ql&&((itsect(L[q[ql]],L[q[ql+1]])-L[i].p)^L[i].q)>0)++ql;
		if(qr>=ql&&dcmp(atan2(L[i].q)-atan2(L[q[qr]].q))==0)--qr;
		q[++qr]=i;
	}
	while(qr>ql&&((itsect(L[q[qr]],L[q[qr-1]])-L[q[ql]].p)^L[q[ql]].q)>0)--qr;
	q[qr+1]=q[ql],++qr;Poly P;
	for(int j=ql;j<qr;j++)P.push_back(itsect(L[q[j]],L[q[j+1]]));
	return P;
}
pair<pt,Poly> getcent(vector<line> vec){
	n=sz(vec);
	for(int i=1;i<=n;i++)
	{
		L[i]=vec[i-1];
		L[i].q=L[i].q-L[i].p;
	}
	Poly res=Half_itsect();
	db S=calcS(res)*6;
	pt Ans={0,0};
	for(int i=1;i+1<res.size();i++)
		Ans=Ans+((res[i]-res[0])^(res[i+1]-res[0]))*(res[0]+res[i]+res[i+1]);
	return mp((1.0/S)*Ans,res);
}
int _kround(db x)
{
	int a=floor(x);
	if((a+1-x)<(x-a)) return a+1;
	return a;
}
pair<int,int> reshape(Poly P,int x,int y)
{
	for(int d=0;;d++)
		for(int a=-d;a<=d;a++)
			for(int b=-d;b<=d;b++)
				if(abs(a)+abs(b)<=d)
				{
					int flag=1;
					for(int i=0;i<P.size();i++)
					{
						int j=(i+1)%P.size();
						if(((pt{x-P[i].x,y-P[i].y})^(P[j]-P[i]))>eps)
						{
							flag=0;
							break;
						}
					}
					if(flag) return mp(x,y);
				}
}
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int d;
	cin>>d;
	if(d==1)
	{
		cout<<"1 1"<<endl;
		return 0;
	}
	vector<line> vec;
	vec.push_back(line{{1,1},{(db)d,1}});
	vec.push_back(line{{(db)d,1},{(db)d,(db)d}});
	vec.push_back(line{{(db)d,(db)d},{1,(db)d}});
	vec.push_back(line{{1,(db)d},{1,1}});
	for(int i=0;i<90;i++)
	{
		auto pr=getcent(vec);
		pt p=pr.first;
		int x=_kround(p.x);
		int y=_kround(p.y);
		auto ppr=reshape(pr.second,x,y);
		x=ppr.first;
		y=ppr.second;
		cout<<x<<" "<<y<<endl;
		int x2,y2;
		cin>>x2>>y2;
		if(x==x2&&y==y2) return 0;
		x2-=x;
		y2-=y;
		db x3=x2,y3=y2;
		db len=sqrt(x3*x3+y3*y3);
		x3/=len;
		y3/=len;
		vec.push_back(line{{(db)x-y2+eps*x3,(db)y+x2+eps*y3},{(db)x+y2+eps*x3,(db)y-x2+eps*y3}});
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1
1 1

output:

1 1

result:

ok guessed correctly in 1 attempt

Test #2:

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

input:

2
2 2
1 1
1 2
1 2

output:

1 1
2 2
1 1
1 2

result:

ok guessed correctly in 4 attempts

Test #3:

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

input:

2
1 2
2 1
2 2

output:

1 1
1 2
2 2

result:

ok guessed correctly in 3 attempts

Test #4:

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

input:

2
1 1

output:

1 1

result:

ok guessed correctly in 1 attempt

Test #5:

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

input:

2
2 1
2 1

output:

1 1
2 1

result:

ok guessed correctly in 2 attempts

Test #6:

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

input:

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

output:

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

result:

ok guessed correctly in 10 attempts

Test #7:

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

input:

8
2 7
6 2
6 5
6 7
8 2
8 8
8 6
8 1
8 3
8 2
8 6
8 2
8 1
8 3
8 7
8 8
8 7

output:

4 4
4 6
4 5
6 6
7 7
6 6
7 7
7 7
7 7
7 7
7 7
7 7
7 7
7 7
7 7
7 7
8 7

result:

ok guessed correctly in 17 attempts

Test #8:

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

input:

15
9 6
15 2
13 13
13 8

output:

8 8
9 5
12 5
13 8

result:

ok guessed correctly in 4 attempts

Test #9:

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

input:

30
27 16
30 16
23 28
22 10
16 13
14 3
7 17
23 17

output:

15 15
22 16
26 15
26 22
26 19
24 18
24 16
23 17

result:

ok guessed correctly in 8 attempts

Test #10:

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

input:

60
10 48
46 59
22 35
4 46
8 41
26 55
1 31
13 48
4 60
6 54
12 54

output:

30 30
20 39
30 49
24 45
17 50
16 48
19 46
19 45
16 49
14 52
12 54

result:

ok guessed correctly in 11 attempts

Test #11:

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

input:

120
61 46
81 85
38 79
102 56
27 5
6 38
32 22
48 5
41 75
95 17
26 58
19 58
57 37

output:

60 60
62 31
78 43
52 49
68 49
61 44
57 46
57 40
58 36
57 38
59 38
58 37
57 37

result:

ok guessed correctly in 13 attempts

Test #12:

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

input:

239
70 77
5 5
238 222
205 58
182 63
28 106
234 72
34 12
230 33
26 29
182 106
146 2
101 14
118 160
110 35
53 25
122 33

output:

120 120
75 86
58 51
77 61
112 31
131 24
118 38
125 33
122 34
124 28
123 31
123 36
123 34
123 33
123 34
122 34
122 33

result:

ok guessed correctly in 17 attempts

Test #13:

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

input:

477
137 90
177 393
24 290
66 154
57 462
27 385
78 19
61 446
25 145
60 370
21 339
44 351
1 416
415 212
34 96
21 112
61 424
24 92
27 376
15 207
41 242

output:

239 239
185 139
126 227
60 258
57 204
67 233
58 244
46 235
67 241
46 239
55 240
47 241
48 242
40 242
45 242
43 242
42 241
42 242
42 241
42 242
41 242

result:

ok guessed correctly in 21 attempts

Test #14:

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

input:

954
563 324
84 206
763 42
312 294
200 238
355 41
716 742
779 807
280 26
907 453
735 28
158 195
26 180
178 218
112 121
622 12
71 173
156 140
375 125

output:

477 477
567 264
326 190
453 201
420 270
361 170
338 94
360 133
376 150
361 146
378 137
388 128
383 132
380 132
379 135
377 130
377 128
376 126
375 125

result:

ok guessed correctly in 19 attempts

Test #15:

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

input:

1908
1841 245
1253 412
1204 1489
1301 716
1765 619
357 93
1683 531
414 313
756 81
699 20
1318 105
1382 94
1787 738
1856 732
1819 10
1811 431
1701 370
453 281
1648 195
1513 183
1806 104
1616 349

output:

954 954
1330 700
1149 329
1213 511
1410 556
1660 475
1542 500
1605 477
1571 504
1577 439
1579 404
1590 373
1593 360
1589 368
1593 368
1606 358
1613 353
1617 351
1615 352
1616 350
1615 350
1616 349

result:

ok guessed correctly in 22 attempts

Test #16:

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

input:

3815
3677 2978
2089 3746
78 2675
211 2874
2254 2715
3174 3069
665 3612
2726 3216
3022 3663
1112 3543
1993 2409
393 1092
233 3647
1468 3614
740 3162
228 3502
529 3264
2690 3489
972 3476
1713 3570
61 3510
2091 3607
1377 2623
800 2083
1705 3410

output:

1908 1908
2745 2292
2418 3093
1822 3030
1478 3165
1671 2803
1760 2829
1713 3177
1757 3199
1755 3372
1737 3470
1735 3399
1727 3356
1717 3370
1716 3390
1710 3387
1707 3393
1706 3384
1706 3390
1705 3402
1705 3408
1704 3410
1704 3413
1705 3411
1705 3410

result:

ok guessed correctly in 25 attempts

Test #17:

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

input:

7630
6905 2125
3117 5254
1639 6546
869 6009
3029 4920
2972 7402
5259 6605
793 4872
6198 6921
3558 7209
6940 7015
7373 6007
1242 7290
4579 7092
6360 6826
3347 7262
7391 6681
5286 7367
6945 6650
56 5087
7469 7074
4096 7153
6732 7188
3006 7137
6775 6965
5493 6777

output:

3815 3815
5532 3120
5127 4209
4686 4385
3766 3154
4667 4938
5207 6055
5555 6746
5373 6388
5466 6556
5422 6615
5469 6713
5483 6679
5461 6632
5464 6672
5479 6709
5477 6719
5486 6746
5491 6764
5494 6775
5492 6767
5493 6771
5493 6773
5493 6775
5493 6776
5493 6777

result:

ok guessed correctly in 26 attempts

Test #18:

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

input:

15259
8394 10191
11489 13478
15080 10833
9120 13853
6453 14541
14102 12219
14264 13873
2585 1038
13970 13241
14614 13650
13699 14765
8552 464
15207 2646
15247 15091
6587 14828
14048 14497
14242 13935
13559 14254
13447 10986
14207 12752
14599 14457
14212 14893
14403 14059
1110 13778
9659 12941
2528 1...

output:

7630 7630
8389 11331
11829 11356
13535 10320
13286 12321
12601 12196
13142 13607
13457 14375
13356 13847
13472 13515
13609 13741
13641 13928
13592 13843
13623 13796
13698 13805
13659 13808
13666 13830
13685 13828
13684 13842
13681 13835
13686 13833
13694 13836
13697 13838
13700 13837
13699 13838
136...

result:

ok guessed correctly in 65 attempts

Test #19:

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

input:

30518
25671 25954
20707 4761
22183 8442
25896 8643
3134 15616
21931 26052
27481 6460
28754 10777
29287 22914
26170 18271
30502 6488
29562 17371
15894 23607
30258 3513
30209 13978
26736 6616
27979 2453
29282 2332
28657 14127
29073 448
28895 1793
26909 23047
27399 28231
29190 7533
29053 22629
16086 81...

output:

15259 15259
20211 20478
23753 13790
24929 9645
27867 7292
26485 8512
26839 10016
26145 9097
27353 9483
27643 9821
27415 9960
28122 10069
28431 10171
28181 10178
28266 10146
28373 10194
28321 10166
28331 10144
28350 10131
28358 10140
28360 10136
28367 10133
28360 10134
28362 10135
28379 10136
28386 1...

result:

ok guessed correctly in 35 attempts

Test #20:

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

input:

61036
7249 41099
13242 55094
7404 8350
7583 58523
18706 21299
18032 19590
5736 12704
6232 20848
20487 50187
4559 34504
855 53027
1416 29706
9884 56766
5210 59041
1273 43117
5466 27369
2162 52575
2674 22930
1051 55065
6005 20055
1455 11708
3537 26099
2431 30889
1858 35900
2736 38479
947 36605
2913 60...

output:

30518 30518
16311 35144
18937 48734
14323 42462
8362 45857
10597 43650
10004 42054
4769 40038
3129 38839
5175 39416
4282 38992
3823 39274
3490 39124
3621 39215
3279 39339
2997 39404
3109 39357
3100 39385
3037 39369
2956 39372
2992 39370
2932 39361
2907 39356
2883 39354
2872 39353
2870 39352
2864 393...

result:

ok guessed correctly in 36 attempts

Test #21:

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

input:

122071
53132 117856
101364 30755
119171 84404
62830 117866
56948 83237
32363 109059
104919 97727
72859 117443
71885 6040
89533 66279
108762 88503
100624 117645
46603 11141
102815 99816
45192 114703
101480 119807
108202 115399
84530 65735
111163 61419
109259 114504
37783 76003
65517 122067
14956 1034...

output:

61036 61036
58206 91357
81617 84886
102384 92809
95625 99439
88404 89827
86066 96600
88683 102046
88393 106999
88042 104320
87510 102619
88193 102381
89103 103436
88625 102945
88981 102859
88781 102819
88870 103166
88931 103319
88956 103196
88992 103125
89026 103171
89008 103146
88992 103176
88979 1...

result:

ok guessed correctly in 42 attempts

Test #22:

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

input:

244141
92644 71279
114263 64041
236427 126925
226638 238363
217272 104776
102091 8373
203752 67123
52764 202708
5658 21190
72780 79854
128713 19967
183497 12061
213631 21951
203504 62018
77322 15135
72623 1232
228795 71594
192048 18671
194788 233363
180905 63969
214288 46697
235939 25659
188360 1722...

output:

122071 122071
98497 67865
159663 46668
182489 58225
162900 81736
194900 68603
178094 75269
186952 67069
182465 71929
179221 67518
177509 67719
176556 63569
176361 61655
177267 61112
177951 61451
177733 60679
177683 60105
177906 59979
178032 59648
178006 59809
178083 59856
178175 59781
178227 59717
1...

result:

ok guessed correctly in 45 attempts

Test #23:

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

input:

488282
106433 474884
275239 277064
201738 9984
432849 427924
21138 357195
413054 285462
369066 121494
95718 90564
279035 16708
350601 84382
156714 204935
315901 335507
269380 24895
302500 322746
317532 320065
775 486544
405076 225586
472322 384895
283995 396291
395201 303142
467625 192681
16340 1652...

output:

244141 244141
195574 351719
272911 332785
166784 245498
229611 289790
193492 288213
211532 293547
209697 264317
202770 245066
202364 232799
203079 227308
198457 222253
200813 224735
202010 222440
203301 223168
203967 223573
203311 224524
203792 224461
203941 224813
203771 225230
203949 225197
204090...

result:

ok guessed correctly in 38 attempts

Test #24:

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

input:

976563
670084 117171
747297 48281
820688 801038
129874 391932
953482 155789
397894 298282
782537 267454
609735 164893
203434 115971
677984 77274
735372 78595
789527 916359
962747 346055
241235 136531
974575 60800
482625 32167
819751 468487
817511 127500
775206 118250
219199 768535
966091 334621
3607...

output:

488282 488282
568016 263672
734788 201243
827211 333710
727993 303603
773746 291101
738176 260904
757101 278460
754192 245665
747341 245483
752039 220786
754367 209232
753086 214958
757018 215239
754507 216242
755926 213722
755740 212367
754930 213849
755502 213088
755817 212688
755378 212827
755744...

result:

ok guessed correctly in 34 attempts

Test #25:

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

input:

1953125
718546 34788
1020974 1870054
549509 1721279
557645 1594068
37382 1009612
90915 261529
31034 1610562
1372303 121029
348765 195309
5285 876475
29088 747112
141155 1533279
1012766 327428
78164 1670702
26235 630785
67252 1122216
79345 1233160
398250 230446
269913 292664
86299 627298
322956 15618...

output:

976563 976563
887380 500499
860871 755672
438235 881215
520687 987267
251101 1044298
252678 978238
133462 1010728
205552 1000264
201989 980042
147926 965333
124791 954606
125950 964190
140623 960569
136448 964782
132632 962527
129178 963389
129881 964933
130846 964370
130741 964001
128003 963451
129...

result:

ok guessed correctly in 48 attempts

Test #26:

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

input:

3906250
1158174 2062772
1260908 679315
610050 3548370
316857 786407
389002 1368689
3068613 288276
371809 1063502
3091416 3556496
24900 629897
1719172 3802857
536655 2326382
462952 820776
416368 3223057
155746 1640547
307240 605952
61615 1634738
2511140 1334250
785534 249860
302630 1043173
77268 2708...

output:

1953126 1953126
982756 2042922
949537 1052145
981528 1556791
543685 1393385
269055 1405774
383392 1277679
356916 1112825
446968 1156022
415043 1123618
365119 1184894
303817 1232317
336113 1208882
325007 1221507
309549 1225456
294989 1218658
283323 1218690
291345 1221053
293290 1219782
288512 1217000...

result:

ok guessed correctly in 46 attempts

Test #27:

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

input:

7812500
4940148 3839991
5283134 2286639
1639950 850522
4502401 6738094
6179712 2094758
7216989 3962204
5325790 3310401
1775130 6046971
3854207 1342480
3098272 3702126
3210690 4210654
4446501 433823
4018848 1989771
2637827 3606026
4427265 4658026
6679095 2441222
269287 7557436
5028020 794980
7208697 ...

output:

3906251 3906251
5856702 3822803
5675984 1912010
4724434 1883682
4599939 2999855
4917758 2573219
5160222 2827956
5072087 3229112
4978855 3382087
4863937 3190000
4786171 3178889
4779354 3236861
4716967 3132654
4682935 3077943
4665334 3074236
4674738 3105427
4683259 3108875
4687651 3126453
4684216 3116...

result:

ok guessed correctly in 46 attempts

Test #28:

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

input:

15625000
1097234 12279512
8077934 6948981
1317308 11219641
4980306 4752709
413938 14606942
916425 7908815
3740300 116859
3888340 71138
962747 3326093
1040602 6401589
1519362 6876173
729360 193424
3598266 1694881
16687 12796998
2120031 3071734
1067308 3397345
662892 3863104
3541359 13224058
4335100 1...

output:

7812501 7812501
4482415 9544798
5713044 7943905
5214087 8837692
2658651 5305352
3832615 7067184
2999774 6624893
2596031 5870477
2425948 5531520
1921699 5365537
1714262 5390832
1865075 5556999
1755771 5477405
1852543 5458866
1849617 5483994
1785842 5455601
1708609 5436039
1663665 5420877
1686736 5429...

result:

ok guessed correctly in 47 attempts

Test #29:

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

input:

31250000
15163801 8278166
3933736 14860487
26670854 17175966
16697424 23175149
9662249 5132697
24996560 4553945
15995737 27684033
10892558 20003660
16157403 13565988
15408938 8972152
8637069 2944371
9024654 15974571
6032382 4963061
26264373 29208236
18112514 18202900
27881863 6221751
28995495 464559...

output:

15625000 15625000
15298046 7822763
7790489 8847138
11877015 10948587
12569848 13503944
11246777 12636949
14132154 11529768
13903907 12253855
12611927 12613587
13382328 12693995
13686682 12469865
13246480 12266239
13046555 12289507
12903032 12155425
12944385 12244243
12986068 12274775
13060601 122104...

result:

ok guessed correctly in 51 attempts

Test #30:

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

input:

62500000
51943776 46352566
55651698 45955833
19325256 48616623
30926988 60871455
53215813 55153468
53841780 61591388
4037942 54044468
38673048 59793079
42539372 62342109
59329044 54533936
62347557 50328061
58312075 62399430
61956747 61161971
27817619 59828797
1154453 59731841
33938042 62469644
97355...

output:

31250000 31250000
44100909 38852208
51519248 44644841
44321432 51591014
40497271 56810740
44042817 56380628
46106473 59472573
44403104 59020271
43262721 60435611
42979284 61514351
43753782 61451880
44186553 61443349
44481245 61730413
44629072 61787386
44561079 61537634
44517593 61494812
44503887 617...

result:

ok guessed correctly in 74 attempts

Test #31:

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

input:

125000000
79222151 76332998
89676498 113110069
71432638 113970598
22641011 56418251
27511483 99731329
17847977 100964511
2249252 109326215
83519958 26177022
13681632 124742991
58137042 116617163
4148624 106652353
19600872 121096369
33042631 124950813
12218678 119086567
10846853 46253051
11593672 105...

output:

62500000 62500000
86621845 79733875
77485318 103837483
56094007 111392009
41906468 106704577
32839199 108288893
26722039 111342052
21179923 118335299
23725264 114291062
22707195 116675357
24347434 117636602
23605570 116478971
23352377 117720100
23522290 118275004
23164290 118759538
23197476 11835741...

result:

ok guessed correctly in 70 attempts

Test #32:

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

input:

250000000
62418427 219810195
33529078 190803476
17361500 126814830
93307200 127361544
60932044 92450939
211665137 215731458
207257606 54823862
159311793 18438846
59401931 30159756
88188325 235349576
50013076 160517960
5780565 4173198
55196573 173603906
137071279 112664407
188488393 185994112
1888820...

output:

125000000 125000000
97496993 178423015
45856924 164377166
33713801 119255966
54677741 122308485
58957116 103308653
70146814 111345876
76543679 108677305
75498690 100747690
72493006 96219007
73690923 98448171
70481335 99284987
68249267 98358599
67933282 99166126
68957359 99436180
69485109 99517799
70...

result:

ok guessed correctly in 52 attempts

Test #33:

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

input:

500000000
76610048 268225174
68710147 76438346
378308723 195696888
156295289 23568855
67251446 9881607
177744923 38833230
232563254 281798767
46768500 152123672
5259975 79875467
18113697 12749342
354947476 3791184
480136063 136521256
398983734 26653812
186456886 13767630
198799084 11594850
8966325 1...

output:

250000000 250000000
125460346 258759242
112291069 133015980
170786865 137901701
177315718 74029790
157300487 60402425
172766850 28997879
172562446 45407408
162637556 51701403
152887496 46234733
146999863 41814976
150686945 41621773
151995684 43316981
153442978 38807885
154069601 36006252
154676731 3...

result:

ok guessed correctly in 65 attempts

Test #34:

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

input:

999999995
731743801 677141913
742525552 289944252
991436166 943359295
331205983 682418988
881688146 610638066
898524283 462974415
631557802 986753329
888571180 136282744
908097116 838269208
997260898 505459799
457825860 762063943
791338673 721048419
658592564 390671604
998283229 242942512
726418506 ...

output:

499999998 499999998
701309392 627397805
803262846 384861923
781889722 515254217
648120945 538405789
722729268 542702086
750863811 524001957
771901744 579818070
760630897 551432220
776055554 564781996
788748143 564245134
784466254 568309660
788647530 577205921
784910258 573621920
787208538 571444750
...

result:

ok guessed correctly in 58 attempts

Test #35:

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

input:

999999996
206437356 822749250
908173415 643702300
67734612 796001920
543342772 498744980
129635531 474263433
884098435 856101927
199746601 939780065
856413579 21995428
931063457 790023882
884239411 549160895
794122221 722869187
197865222 272783491
939536917 229271677
529249739 537214678
907302960 74...

output:

499999998 499999998
348405203 681057051
579521569 779470013
455855838 719569441
446960450 581149932
390943192 527624482
407584060 580672885
386672006 629155647
395452465 604522486
413686608 616304176
423162106 613759033
427191736 621926263
430299949 609198249
433225745 603434929
434802780 600564013
...

result:

ok guessed correctly in 60 attempts

Test #36:

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

input:

999999997
498799184 167352766
928252754 363115847
3961754 107196779
740298397 107559369
979000571 187850244
649542972 136763117
814653384 146641090
664016666 23927073
956707439 57144455
219363236 823618704
687311255 31616855
944069881 317113038
858004819 120236924
920320656 141533184
922601035 43232...

output:

499999999 499999999
499398353 250001086
748088671 260553884
623690302 254665530
666304795 133773463
718896340 150860228
693609681 140228485
711597811 106946721
718489339 49962088
729691338 43206082
726098818 68772791
726046402 55177923
727515828 60755398
732189235 57640357
734980567 55837528
7368117...

result:

ok guessed correctly in 57 attempts

Test #37:

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

input:

999999998
656839358 299419738
443464204 441832667
7382912 209388709
545041016 710838859
240369680 816838184
19089306 756055730
255044241 298909815
68983311 838972930
248067784 12079437
107120761 518080168
472642446 202078300
346394086 280759349
41627382 253927186
774180102 848425069
357732065 437444...

output:

499999999 499999999
630321363 300950974
477584963 334207880
289661849 167764895
376576031 253386238
353614546 312471655
320852113 324723193
252512936 272988158
273585715 299799901
249424976 282308207
231823830 280102030
248919571 290115550
258643504 294272934
253514591 292547035
254776941 296012528
...

result:

ok guessed correctly in 59 attempts

Test #38:

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

input:

999999999
752461264 62849627
548120882 92879711
936464592 967289016
249824960 715452928
929943293 614856593
952319861 204915731
732193932 189037883
387953012 28528075
760993951 69091040
851736730 172106725
94516855 69907097
575731983 68849671
916999262 403472271
740324703 459761470
845039684 2354283...

output:

500000000 500000000
596252639 277793712
464874460 141928468
645445509 167425032
460831797 240054020
565715710 226936860
624328010 209845921
663883133 216523582
641897301 198560311
644801217 182701465
658948833 193224711
651924223 187966531
650832711 179684866
653137285 182899018
651691437 185749059
...

result:

ok guessed correctly in 60 attempts

Test #39:

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

input:

1000000000
574851157 956297383
74756140 859591985
126164635 666390775
365070186 920427883
196564853 858738187
377149421 271649483
23338831 448807321
27176538 832411436
170515526 875842441
14254251 992416728
912951835 85192609
36943797 800208202
34054924 895288888
21377899 584202164
10391037 81532311...

output:

500000000 500000000
527340049 747757565
273523263 779224719
168585834 723459412
205460718 771685459
114255189 879436770
158394703 826664378
147806868 804725095
106898244 817092693
121177055 822168255
105580717 835665421
115887964 829729482
109151292 826981071
106686105 830796671
103978204 827155360
...

result:

ok guessed correctly in 67 attempts

Test #40:

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

input:

1000000000
124049365 773228761
574580318 525518098
507416369 824273005
964021063 522559115
945428042 677109730
560228949 737179817
749147023 758017314
872661251 709386038
837861567 974568442
670705153 875603262
962957230 773910770
119841746 940927005
530194514 988952602
242012219 855793174
58492017 ...

output:

500000000 500000000
294015936 621127943
445806804 630088508
555220487 826834324
633320516 806411519
701053445 846795548
641743465 750195993
672884421 801037717
682830295 782160479
697775514 809005733
696940321 823364169
705948260 824369730
701517334 825841047
702385819 833972663
700345227 832804570
...

result:

ok guessed correctly in 59 attempts

Test #41:

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

input:

1000000000
248721315 636545964
417971216 908101343
273840101 620337430
351606316 901203541
46628538 217326105
45897354 365584473
26632043 991050423
36719830 877462886
69248300 873343365
32753110 630989189
18110139 942168359
12009621 776860231
33312986 852494529
9193064 828265563
120860854 930005415
...

output:

500000000 500000000
274607370 590567414
354207027 805159608
277935218 718043334
283440507 776591283
275381272 749712143
149795026 795463501
73788636 833366817
37977070 851362846
55706859 856220736
62746918 843925256
54809018 849706507
47849853 847870578
42450308 851401539
40701683 850519669
39591036...

result:

ok guessed correctly in 58 attempts

Test #42:

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

input:

1000000000
8426636 404179658
153768704 274453127
333021385 542001274
431206969 14462030
230881009 60232208
61728418 239971947
241252290 887112698
90328609 359307729
888109511 405931553
476256211 266801554
90679435 189840875
348414484 176454400
181567815 185691704
645756393 947650104
115946219 637803...

output:

500000000 500000000
253166340 467512364
253117007 231853214
247467705 351321182
374245320 281886094
313442024 258531819
236211250 284097429
239551280 310178779
203740293 308074740
224999913 316025034
234511884 319157396
229203627 303227720
229081097 295414959
226016654 290139230
227564942 292660166
...

result:

ok guessed correctly in 60 attempts

Test #43:

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

input:

1000000000
716815311 307164877
155458504 581249147
713549037 93752890
13128548 153815955
69457926 523018825
728823832 952098445
977050649 534598998
998431626 149930717
122378679 161980414
66865057 89043776
361486818 43230121
373719246 327416432
435416263 919819056
46122143 667287326
4503246 13592667...

output:

500000000 500000000
684080920 351766986
523152058 347279950
450377614 174808657
321470819 96175560
293204999 127924543
372846393 183736247
410689151 210325240
428986667 213481594
419685016 195776000
415394783 175670436
415293436 162938926
415033450 169115553
414969859 172413959
410827672 173698311
4...

result:

ok guessed correctly in 60 attempts

Test #44:

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

input:

1000000000
497027630 856053249
138008220 804818664
944443619 174836948
899992034 435533950
38008909 813334960
953984872 552049375
512326939 828838004
594468947 995905710
897633587 525026584
37281915 947530876
46270692 801526064
649959835 977496930
790378776 919858142
6108577 886181125
100813920 9836...

output:

500000000 500000000
498608650 749994192
249435394 755284804
343014047 692505883
418431541 699305751
381166426 696415019
417587908 756928712
450818576 870192199
471120568 929221658
464472163 899390621
453702033 891577013
448292076 885229616
451212865 887660004
454165087 882059288
452226285 889563166
...

result:

ok guessed correctly in 57 attempts

Test #45:

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

input:

1000000000
515963705 772239976
981399967 28551128
953382037 700785677
960907908 706171147
766500011 728208274
804134750 926793870
355749962 456384518
837178842 42607141
868163366 960199422
926550212 942916065
952587808 307174157
903268232 899734379
965865308 892347720
997156286 723265528
349615229 5...

output:

500000000 500000000
509773060 749713462
715796414 681887831
864716885 725941155
930419662 702658338
898969021 723244835
922112918 856270249
906459065 788987336
900899256 754790090
904758071 771807290
909941457 779913543
917938102 775470619
911215206 777594608
926496500 779095609
934284972 779657868
...

result:

ok guessed correctly in 61 attempts

Test #46:

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

input:

1000000000
40153281 873223555
290310426 118384943
686299118 855577275
54161308 105305191
138989624 350855818
175740315 509325004
113244414 281082288
11911818 856609674
95077320 780195981
33712143 605371318
257860350 548917495
975544 730137899
385707348 108583160
170161887 76366260
327297798 96416676...

output:

500000000 500000000
304894732 635271001
205132197 395246844
297554625 515495013
229686967 472414664
211279292 440957422
123566029 519974323
168719610 478177774
144613592 498166981
132675710 508942179
113709465 510474904
123920202 511218742
121423434 515328328
124436637 514082975
119919022 511094159
...

result:

ok guessed correctly in 60 attempts

Test #47:

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

input:

1000000000
432211245 314764982
92707841 672229850
326029851 27207614
178759090 167630241
567312318 715553917
425234278 642319858
91447032 575766009
415017356 445447372
221395649 70171175
237052024 108013280
169605742 318311120
7412944 446611967
146634206 193162355
54078145 21214407
200623303 1865061...

output:

500000000 500000000
439006534 261160609
223248305 349607801
246931516 235825103
125379962 159013311
165143466 212349088
184438444 240739489
138154150 276676822
168160472 279817844
182654307 261356000
190750162 252929823
186895788 257174098
172420925 253080661
165291432 249471372
161237935 247757808
...

result:

ok guessed correctly in 73 attempts

Test #48:

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

input:

1000000000
309776591 116856572
729364887 558170590
450416477 80656873
494279124 153296133
757448847 516539526
543315036 61793880
454961447 480463455
843389697 208585970
837277764 275605418
523899400 25061605
606486442 107199541
548219567 2936444
736964733 955896832
542923307 27458377
872017768 21833...

output:

500000000 500000000
417253177 270541111
598859767 297948317
579218776 227214844
453821873 292722275
559644146 203204764
645261538 96711486
601059407 148001901
627386294 137199136
634294014 147108561
642352832 129430664
633418886 135021316
643953281 118658660
638429348 127020080
637825370 125254282
6...

result:

ok guessed correctly in 58 attempts

Test #49:

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

input:

1000000000
578976162 694728094
666153135 361667349
174993556 563583251
240609011 568957588
568656992 832365483
263951574 251109538
669711462 481723864
677170595 707958742
740319747 374121003
461155623 308085743
595876729 594044202
372659277 827332406
799713824 22883244
308407906 826380386
168051738 ...

output:

500000000 500000000
567595248 736292648
724403567 593267353
540793478 604119985
418472903 611824802
468392568 640261097
456956084 614826699
502910186 586068500
518628747 587349282
533192979 568004169
535709709 552450004
539181184 556165978
535521352 562512508
538614334 560056695
536683058 560929664
...

result:

ok guessed correctly in 62 attempts

Test #50:

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

input:

1000000000
170796070 52540735
366447636 210849235
74470273 32702064
636061293 204963023
6564665 8384465
346750418 19812893
107891232 85920843
946654276 50385881
302030466 64176255
64116006 71667292
973754285 12826478
106050675 7916233
239363686 6826573
555157012 9233329
206556268 5382407
948649115 3...

output:

500000000 500000000
377380299 295106774
451221179 141078645
218788939 153826364
333243673 146902222
279712362 134631786
302693790 64459984
269711944 69046350
287529040 75120871
286532926 40212373
278341659 35934129
283077947 42741289
280667207 26948660
279957700 14474233
281258102 14402232
280644557...

result:

ok guessed correctly in 72 attempts

Extra Test:

score: 0
Extra Test Passed