QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#932371#10087. ArchaeologyhewanyingAC ✓3ms7044kbC++142.6kb2025-03-12 15:31:362025-03-12 15:31:37

Judging History

This is the latest submission verdict.

  • [2025-03-12 15:31:37]
  • Judged
  • Verdict: AC
  • Time: 3ms
  • Memory: 7044kb
  • [2025-03-12 15:31:36]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
#define db double
#define pb push_back

mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());

int rng(int l,int r){return rd()%(r-l+1)+l;}

const int N=1e5+5;
const db eps=1e-6;
int n;

struct vec{
  db x,y;
  vec(db A=0,db B=0){x=A,y=B;}
  vec operator +(const vec &A) const{return vec(x+A.x,y+A.y);}
  vec operator -(const vec &A) const{return vec(x-A.x,y-A.y);}
  vec operator *(const db &k) const{return vec(x*k,y*k);}
  vec operator /(const db &k) const{return vec(x/k,y/k);}
};
struct Line{
  vec a,b;
  Line(vec A=vec(),vec B=vec()){a=A,b=B;}
}q[N];
vector<Line> L;

int dcmp(db x){return x>eps?1:(x<-eps?-1:0);}

db Dot(vec a,vec b){return a.x*b.x+a.y*b.y;}
db Cro(vec a,vec b){return a.x*b.y-a.y*b.x;}
db Len(vec a){return sqrt(Dot(a,a));}

db Atan(vec a){return atan2(a.y,a.x);}

bool cmp(Line A,Line B){
  db t1=Atan(A.b-A.a),t2=Atan(B.b-B.a);
  if(dcmp(t1-t2)!=0) return t1<t2;
  return dcmp(Cro(B.b-A.a,A.b-A.a))>0;
}

bool chk(Line L,vec p){return dcmp(Cro(p-L.a,L.b-L.a))>=0;}

vec Inter(Line L1,Line L2){
  db len1=Cro(L2.a-L1.a,L2.b-L1.a),len2=Cro(L2.a-L1.b,L2.b-L1.b);
  return L1.b+(L1.a-L1.b)*len2/(len2-len1);
}

vector<vec> Halfcut(vector<Line> L){
  sort(L.begin(),L.end(),cmp);
  int h=1,t=0;
  vector<Line> cur;swap(L,cur);
  for(int i=0;i<(int)cur.size();i++)
    if(!i||dcmp(Atan(cur[i].b-cur[i].a)-Atan(cur[i-1].b-cur[i-1].a))!=0) L.pb(cur[i]);
 
  for(auto i:L){
    while(h<t&&chk(i,Inter(q[t],q[t-1]))) --t;
    while(h<t&&chk(i,Inter(q[h],q[h+1]))) ++h;
    q[++t]=i;
  }
  while(h<t&&chk(q[h],Inter(q[t],q[t-1]))) --t;
  while(h<t&&chk(q[t],Inter(q[h],q[h+1]))) ++h;
  
  vector<vec> res;
  if(h<t) for(int i=h;i<=t;i++) res.pb(Inter(q[i],q[i==t?h:(i+1)]));
  return res;
}

db Sum(vector<vec> p){
  db res=0;
  for(int i=0;i<(int)p.size();i++) res+=Cro(p[i],p[(i+1)%(int)p.size()]);
  return res/2.0;
}

Line Ask(int x,int y){
  cout<<x<<' '<<y<<'\n',cout.flush();
  int qx,qy;cin>>qx>>qy;
  if(x==qx&&y==qy) exit(0);
  
  vec O=vec(qx,qy)-vec(x,y);
  return Line(vec(x,y),vec(x,y)+vec(O.y,-O.x));
}

int main(){
  cin>>n;
  L.pb(Line(vec(0.5,0.5),vec(n+0.5,0.5)));
  L.pb(Line(vec(n+0.5,0.5),vec(n+0.5,n+0.5)));
  L.pb(Line(vec(n+0.5,n+0.5),vec(0.5,n+0.5)));
  L.pb(Line(vec(0.5,n+0.5),vec(0.5,0.5)));
  
  while(1){
    vector<vec> p=Halfcut(L);
    vec sq=vec();
    for(vec i:p) sq=sq+i;
    sq=sq/(int)p.size();
    int x=(int)sq.x+rng(0,1),y=(int)sq.y+rng(0,1);
    x=min(max(x,1),n),y=min(max(y,1),n);
    L.pb(Ask(x,y));
  }
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1
1 1

output:

1 1

result:

ok guessed correctly in 1 attempt

Test #2:

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

input:

2
2 2
1 2

output:

1 1
1 2

result:

ok guessed correctly in 2 attempts

Test #3:

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

input:

2
2 2

output:

2 2

result:

ok guessed correctly in 1 attempt

Test #4:

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

input:

2
2 1
1 2
1 1

output:

1 2
2 1
1 1

result:

ok guessed correctly in 3 attempts

Test #5:

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

input:

2
2 1
2 1
1 1
2 2
2 1

output:

1 2
1 2
2 2
1 1
2 1

result:

ok guessed correctly in 5 attempts

Test #6:

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

input:

4
1 3
2 3
1 4
1 4
1 4

output:

2 3
2 2
2 4
2 3
1 4

result:

ok guessed correctly in 5 attempts

Test #7:

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

input:

8
7 4
2 7
8 6
8 7
1 4
5 2
8 7

output:

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

result:

ok guessed correctly in 7 attempts

Test #8:

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

input:

15
9 6
13 2
13 11
13 8

output:

8 9
8 4
11 5
13 8

result:

ok guessed correctly in 4 attempts

Test #9:

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

input:

30
27 16
30 16
23 28
22 10
16 13
14 19
7 3
30 4
24 19
30 1
9 15
22 30
23 17

output:

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

result:

ok guessed correctly in 13 attempts

Test #10:

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

input:

60
26 42
24 36
8 53
44 43
8 54
51 47
58 54
14 20
21 60
4 35
6 54
14 58
4 49
5 56
10 57
12 59
38 57
41 55
1 59
12 2
50 55
27 60
8 40
8 53
11 3
8 9
4 45
12 54

output:

31 30
31 45
13 43
10 52
15 50
11 50
12 53
13 55
15 51
14 53
14 52
14 52
14 52
14 52
13 52
13 52
12 53
12 52
13 53
13 54
12 53
12 53
13 54
13 54
13 54
13 54
13 53
12 54

result:

ok guessed correctly in 28 attempts

Test #11:

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

input:

120
61 21
89 72
10 85
32 79
102 26
97 12
6 26
32 48
48 14
101 75
95 117
101 58
106 110
103 10
69 26
8 6
81 109
68 17
119 96
57 37

output:

61 61
60 31
90 30
69 46
52 52
60 49
65 48
59 41
56 40
55 37
55 38
54 39
55 38
55 39
56 39
57 38
56 37
56 38
56 37
57 37

result:

ok guessed correctly in 20 attempts

Test #12:

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

input:

239
70 39
48 6
5 16
127 210
143 58
159 44
7 75
154 66
101 2
18 14
120 20
193 35
181 21
141 225
151 17
24 2
68 24
210 49
154 7
128 3
122 33

output:

120 121
120 60
50 91
75 41
73 61
108 44
126 37
117 39
117 46
120 41
117 42
120 39
121 35
121 33
121 34
122 34
122 34
121 34
122 34
121 34
122 33

result:

ok guessed correctly in 21 attempts

Test #13:

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

input:

477
197 90
59 393
309 423
205 351
42 422
31 334
77 36
401 43
8 248
88 31
56 200
4 239
89 32
15 247
13 45
76 360
24 207
20 267
41 242

output:

239 240
239 120
106 129
137 199
159 227
81 256
41 270
52 264
71 262
58 256
57 248
50 245
46 244
47 242
44 242
43 241
43 242
43 242
41 242

result:

ok guessed correctly in 19 attempts

Test #14:

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

input:

954
563 324
119 445
924 485
538 256
200 258
63 191
716 742
163 49
804 173
324 620
838 33
350 116
209 139
472 78
175 209
113 147
777 73
115 78
281 71
170 553
64 56
140 220
45 5
206 547
5 48
146 17
928 49
375 125

output:

477 477
477 238
256 201
408 306
453 283
390 168
359 105
372 163
368 131
377 125
377 140
381 133
379 131
377 131
377 128
376 130
375 126
375 127
376 126
376 125
376 125
376 126
375 126
376 125
375 126
376 126
375 126
375 125

result:

ok guessed correctly in 28 attempts

Test #15:

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

input:

1908
1309 661
1686 1017
824 906
1495 273
416 1624
721 331
1475 542
453 164
706 9
1627 455
1894 165
1778 318
169 811
357 183
392 13
1546 56
1497 111
1616 349

output:

955 955
1432 955
1711 1044
1617 784
1689 392
1652 591
1590 578
1558 571
1542 570
1582 440
1594 440
1612 386
1622 360
1618 374
1614 365
1612 360
1614 353
1616 349

result:

ok guessed correctly in 18 attempts

Test #16:

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

input:

3815
3677 2978
2089 3746
1500 2675
211 2516
1210 2920
3041 1865
3174 3741
1983 3656
514 1447
1047 3605
8 2593
2765 3801
547 3555
1927 990
541 3591
3629 1628
2260 3462
1587 3422
983 3713
858 3807
3588 3103
72 3755
972 3456
3539 2854
2507 3435
3723 3384
3663 2950
2064 3399
3166 3636
2144 3504
1062 298...

output:

1908 1908
2862 1909
2622 2882
2028 2776
1731 2711
1549 3328
1675 3094
1801 3286
1849 3391
1831 3338
1743 3386
1695 3387
1719 3388
1702 3425
1710 3404
1700 3405
1703 3393
1706 3400
1705 3403
1705 3407
1704 3408
1706 3409
1705 3408
1704 3407
1704 3407
1704 3407
1704 3407
1704 3407
1704 3407
1705 3409
...

result:

ok guessed correctly in 32 attempts

Test #17:

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

input:

7630
6905 2125
3117 6976
869 7439
3029 7330
743 6078
6949 6020
5207 6903
6605 6368
6721 7345
3328 7169
416 6943
6339 7572
4559 7168
6516 6701
5799 5512
6091 7038
5369 7568
6629 4725
7546 6913
4931 7294
7136 7485
5518 7025
341 446
5493 6777

output:

3815 3815
5723 3815
5853 5400
4964 4845
5636 6228
5072 5512
5360 5858
5303 6178
5467 6329
5516 6582
5494 6731
5435 6559
5447 6680
5437 6723
5468 6778
5466 6745
5480 6765
5479 6771
5488 6769
5492 6772
5492 6775
5493 6776
5494 6778
5493 6777

result:

ok guessed correctly in 24 attempts

Test #18:

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

input:

15259
13763 4728
12328 10109
12879 14465
12199 14578
13334 9840
14870 9793
1061 1511
13966 14946
15085 11327
14664 12037
13343 14619
15051 13181
14364 13808
11735 9159
13980 13900
6059 10879
11922 14836
14084 5092
14013 14325
14641 13758
15238 13582
13518 14020
470 13224
12887 14839
1436 14303
12798...

output:

7631 7630
11445 7631
12485 11396
12837 13332
12218 13721
12019 13167
13671 13903
12855 13584
13177 13795
13300 13716
13351 13670
13528 13778
13592 13816
13632 13879
13671 13815
13710 13820
13690 13819
13684 13840
13686 13828
13691 13835
13695 13834
13699 13836
13700 13838
13698 13838
13698 13839
136...

result:

ok guessed correctly in 36 attempts

Test #19:

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

input:

30518
28246 24913
12353 2909
26824 11904
20723 24754
27576 15695
29354 1434
27220 16990
27046 4266
27826 8899
28692 1361
27802 20884
27756 6488
27788 17720
30035 2399
7490 24667
27620 7153
29812 16624
29163 2109
23697 29885
28983 13978
13198 20397
26411 1704
28736 11081
28838 10951
15837 7328
26551 ...

output:

15260 15260
22889 15260
19311 13958
25279 7433
22747 10931
24039 12057
26146 10139
25168 11092
26656 10609
27702 10341
28029 10067
27577 10179
27698 10121
28116 10160
28499 10170
28322 10168
28277 10137
28339 10142
28400 10129
28371 10136
28398 10140
28377 10141
28371 10139
28379 10138
28386 10137
2...

result:

ok guessed correctly in 33 attempts

Test #20:

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

input:

61036
7249 41099
7137 56314
15546 8350
7449 58523
11761 19590
9296 49474
6495 12704
9906 60676
4429 34504
6590 24720
4296 7316
2749 26835
1364 55356
5200 56191
659 59061
2181 52549
56369 43539
36511 11708
477 26099
3737 4783
2422 35900
5138 53861
913 4242
1671 59828
2400 47370
2070 49620
778 18189
4...

output:

30519 30518
15260 30518
19367 45978
17455 38500
10072 40867
8161 37285
9607 39218
6498 38675
6734 39120
3029 39608
4964 39335
4663 39122
4599 39043
3288 39247
3377 39265
2819 39338
2601 39366
2853 39361
2977 39362
2909 39362
2926 39352
2880 39351
2894 39353
2922 39348
2909 39350
2891 39351
2880 3935...

result:

ok guessed correctly in 38 attempts

Test #21:

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

input:

122071
58954 91743
97717 16560
46022 102564
112743 28922
100337 93744
98642 22719
83217 117866
55689 26391
26808 66041
108109 111698
51710 96963
71885 118967
109179 114987
118192 96714
39724 100777
121806 116688
117023 112252
46603 99561
74896 118270
90355 115111
91770 86724
116573 92831
73773 10908...

output:

61037 61036
61037 91553
61037 76294
54979 82033
86806 97293
104472 106918
95301 102256
92668 103801
90002 102066
88832 99674
89480 100761
88864 101835
88612 102479
88891 103013
89053 102739
88945 102465
88974 102832
88993 103080
88965 103034
88945 103120
88957 103204
88955 103162
88971 103163
88967 ...

result:

ok guessed correctly in 36 attempts

Test #22:

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

input:

244141
92644 1814
234781 64041
209588 126925
226638 55258
158890 195840
132896 8373
203752 44617
3317 243656
25944 44766
230281 193666
233650 60073
93520 7692
240879 110279
62810 21082
184223 61362
232808 38903
175034 219622
220702 238873
215781 60947
135728 5009
192606 36379
190694 196411
210505 16...

output:

122071 122072
122071 61037
183103 53669
182598 80539
213560 71552
206349 79061
187981 70190
187261 65133
178965 61256
175742 58521
177289 59667
178403 59996
178530 58488
178296 59477
177761 60273
178003 59950
178144 59311
178056 59593
178077 59772
178125 59845
178156 59701
178163 59629
178156 59661
...

result:

ok guessed correctly in 37 attempts

Test #23:

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

input:

488282
93798 474884
275239 337733
201738 9984
283105 427924
331572 111920
21138 167363
392134 452337
369066 176401
95718 206680
482427 257476
156714 221228
218356 24895
302500 268116
317532 315254
204689 304796
403557 107920
454249 250587
133958 153171
112574 37669
85216 276475
87297 165238
282866 1...

output:

244142 244142
244141 366213
266501 312895
134022 202457
200552 257829
221408 250280
183867 222783
202458 237109
207849 232065
201121 223076
204323 228436
202666 226190
203260 222031
204155 222526
203256 224769
202951 225533
203850 225527
204306 225530
204363 225132
204383 224940
204135 224994
204004...

result:

ok guessed correctly in 43 attempts

Test #24:

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

input:

976563
798000 654268
17217 310062
576941 365432
830472 371488
627147 338093
897879 204133
203434 97821
772219 20398
895330 18356
871277 285841
930255 885338
383085 583852
28719 611197
138610 265017
461647 206912
765558 194643
953717 116336
828999 65707
288053 599436
112107 851709
823591 405098
54939...

output:

488282 488283
732424 488282
610353 488283
703203 244955
637930 383383
710806 294383
755841 272951
739887 250763
752679 217834
767513 197469
769220 207042
763708 215418
761430 217943
757971 216132
756214 213851
754491 215873
755029 214099
755619 213294
755672 212328
755558 212796
755479 213000
755837...

result:

ok guessed correctly in 38 attempts

Test #25:

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

input:

1953125
451850 34788
1133815 1870054
742079 1721279
578850 1594068
139082 1476069
40434 388904
165759 797354
157260 512380
238322 948139
151845 1734196
1442444 1339464
6148 747112
40815 677753
1336208 30021
191468 39945
60751 630785
59361 887541
204550 297476
77468 1062844
26899 1819006
7215 251150
...

output:

976564 976563
976563 488282
976564 732423
391201 873211
559300 1006979
276030 1124172
246694 1020883
221529 972738
273004 944243
135992 962265
118345 973510
196466 968724
156868 972197
134918 974633
149537 967710
151257 964748
139541 964583
133265 964636
133162 963444
129713 963416
130504 963921
128...

result:

ok guessed correctly in 48 attempts

Test #26:

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

input:

3906250
1158174 2062772
1430432 536796
1856297 3548370
4223 1612564
1129596 520
866364 572967
13041 1776834
251511 1006996
342464 580050
205860 2743273
494865 3534583
326391 1789936
56115 2533974
208590 1259079
227715 934975
366020 1227715
121103 1388521
270574 964042
136117 2783562
14823 756217
258...

output:

1953126 1953126
976564 1953126
920505 980182
943556 1476200
472143 1479550
635790 1331940
691489 1213132
567696 1237413
504838 1190131
489422 1171686
389145 1199507
346281 1213805
320869 1221145
307713 1224744
290448 1220873
282211 1218397
289618 1218022
285547 1217694
284919 1215716
285353 1216706
...

result:

ok guessed correctly in 42 attempts

Test #27:

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

input:

7812500
6179712 5324527
5325790 3310401
4137706 1182591
6358789 4073384
3854207 1342480
157376 3702126
1321251 2225073
7424409 5632217
2516635 1301478
2637827 265959
1090449 1611642
2920907 1483058
5505157 1964060
5233264 2505342
3672016 4088378
4645492 4173449
855592 1199378
2535587 4798251
5558147...

output:

3906251 3906250
5859376 3906251
4986962 3556444
6587018 1782970
6380433 2495135
5490167 2642839
4933627 2985579
4613458 3155575
4570736 3430378
4484832 3409827
4735440 3152659
4602096 3239009
4556010 3251038
4681296 3119866
4744003 3054450
4723934 3087181
4700112 3103969
4683885 3099541
4679749 3107...

result:

ok guessed correctly in 47 attempts

Test #28:

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

input:

15625000
6826322 3483216
8398902 9325874
1387003 151010
2865901 2688621
845839 14016339
1716338 6097364
12717575 270860
418678 3347405
2657267 9788962
12118625 13186359
3924940 2738092
12330103 1037528
7003817 1499272
1180531 6401589
4104165 2198092
2191852 1716245
1073182 3689457
3656166 13940586
4...

output:

7812501 7812500
7812500 3906251
7812500 5859375
3842325 6587568
4462170 5379273
2097619 5709097
1044017 5925184
1565200 5810732
1138573 5246124
1341935 5533037
1430486 5695170
1611291 5551815
1694088 5465450
1741443 5435840
1849932 5549560
1834696 5514103
1739265 5454289
1690248 5424174
1715528 5439...

result:

ok guessed correctly in 45 attempts

Test #29:

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

input:

31250000
3933736 12627397
26670854 17175966
13656105 8513163
789566 10327720
30285180 29263086
28645077 21540041
9979681 1228954
19386530 22533495
16699897 13565988
15408938 10813794
5107462 14819371
6032382 14313831
16328193 17264283
24445525 5979144
22855008 1187236
6540212 25579077
17195202 37154...

output:

15625000 15625001
7812500 15625001
11718750 15625001
12999206 7800963
10793016 7761574
10901181 11794436
12331471 13107287
12323584 11427890
11994093 12401083
12905769 12026612
13372972 11898148
13157271 11999898
13046507 12041988
13218185 12469737
13189426 12295163
13115846 12148791
13136222 122085...

result:

ok guessed correctly in 53 attempts

Test #30:

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

input:

62500000
51943776 46352566
55651698 34158528
19325256 21269178
30926988 61817694
6525521 51301054
8355993 61461479
59331155 61645999
46107363 62051934
61014514 54439165
6549297 53516159
35402897 59611872
59949380 60778591
8318668 60489952
53217467 61374180
5740572 60727995
36398985 62220394
4014071 ...

output:

31250000 31250000
46875001 31250001
54687501 31250000
52923469 25714034
46891424 44005334
44077406 53446913
42656319 58067188
44357982 59873101
44149943 61601336
45079629 61308799
44761700 60808706
44418439 61210480
44569572 61312975
44502128 61366680
44537148 61371610
44522104 61090491
44515584 617...

result:

ok guessed correctly in 73 attempts

Test #31:

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

input:

125000000
48801570 86425063
44740394 113970598
26523684 118220347
4745888 26177022
112013735 80740407
6066430 89116766
39371441 117378946
1349140 101200325
85036293 121534700
6499760 106479117
5556648 111680494
8765613 122654955
27272456 118549288
1066715 124588811
10453500 24612943
15586252 5670576...

output:

62500000 62500001
62500000 93750001
32693463 96285566
44717641 111725934
19283790 110322141
32280871 105614392
24344275 103083756
27506035 105811542
23999106 111062251
25039376 111465436
24763873 110339696
23616893 115139618
23071583 117799504
23151761 117997298
22860482 119308928
23008306 118649830...

result:

ok guessed correctly in 61 attempts

Test #32:

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

input:

250000000
78273938 150852172
199961094 33220827
19213750 16176146
207257606 233862786
174057943 141552908
88188325 159538849
87606189 160517960
56060373 10376026
90865985 60989720
28651548 21945771
11113389 69968589
44445437 173725924
59588420 129819156
48698472 78857673
4556712 73954591
119297891 3...

output:

125000001 125000001
62500000 125000001
79191845 106278284
43984660 48030940
64297835 75077312
73314187 89490508
73321124 97729411
69617853 104818457
71329487 101226253
82520310 99222225
77816164 98886390
73925194 99681046
72611706 100452933
72027905 100867660
69976653 99913031
68950313 99438752
6928...

result:

ok guessed correctly in 59 attempts

Test #33:

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

input:

500000000
489219677 27863746
110539880 289561968
177371277 126453602
87467779 66814833
428505760 87855079
177744923 52318482
331715632 281798767
196480612 17727257
12115787 315192238
46970400 118751246
40831208 20828770
146419190 41933776
41618988 28343386
278188689 20030819
468577194 75679235
35597...

output:

250000001 250000000
375000001 250000001
251486368 136821282
175337153 78857859
122832960 52641718
149046135 66077721
153140024 32739275
164606303 55026970
169031532 38078325
164597535 44798645
163846948 49978645
157232078 42061977
153873715 37792303
150935654 38535547
152432193 38978587
153152014 38...

result:

ok guessed correctly in 60 attempts

Test #34:

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

input:

999999995
788301912 677141913
705704333 887832573
991436166 429598994
374619759 310345948
672013954 405260291
786617717 347787288
331205983 582594510
807406772 814412970
748127542 784485084
778310424 594397760
968722640 456367707
891566271 475904766
898356522 531165367
282919498 939876045
237241848 ...

output:

499999999 499999999
749999998 499999998
677294411 750468089
783812926 709976524
665834147 582465597
670388130 542638767
792494162 544738412
722465616 538810858
752934195 560178743
757298089 573040912
776177791 573456682
782582663 571354055
787645752 569420162
791624612 572667363
792328479 577859948
...

result:

ok guessed correctly in 62 attempts

Test #35:

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

input:

999999996
908173415 764070580
532981838 796001920
543342772 782655152
129635531 540866817
453118856 55314429
291990243 493929915
67265135 772180353
108939290 435975181
553878792 217590449
341515739 551222088
39307330 624074984
344326035 112311132
312404453 246935202
252415321 660662525
893989452 728...

output:

499999999 499999998
749999998 499999998
689238139 764742286
530645665 700133482
452544125 699064361
531102173 548595921
477745021 599063488
458513274 655344567
436949254 643087372
454808307 615114132
445919445 606169422
435638772 623474974
436557558 611052937
438918802 602532096
434692880 607096305
...

result:

ok guessed correctly in 61 attempts

Test #36:

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

input:

999999997
411164400 435245363
283750396 534392125
797031077 750494521
592919084 205021912
791863964 150656314
817082115 99437335
330885265 880362700
368402615 532535
509216999 41948676
938667793 204119487
614060943 26196479
830065468 92213569
975054624 48063021
848755299 20192352
990092000 24502614
...

output:

500000000 499999999
250000001 500000000
351901400 549067039
566302853 309096918
639276570 178114151
728051716 102510112
770117747 54132437
748408108 80786161
734760758 69450456
730106447 55427052
731007621 74878489
731789313 63233995
732938529 63435457
735220649 56866429
736273780 51046758
736834461...

result:

ok guessed correctly in 68 attempts

Test #37:

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

input:

999999998
62024328 597353824
494371032 177769611
660190668 441832667
114096692 209388709
253834622 816838184
847585407 87364439
125281308 298909815
550728551 851329386
81364536 384523764
662340154 189663206
433039492 9014808
444613319 40354867
326251930 975220546
103444693 537864401
86045102 5216275...

output:

500000000 499999999
250000000 499999999
234886732 259610037
361630131 290107318
319324987 216302394
271320180 347845893
296463457 283992885
272310187 279526987
283552166 330892537
283653943 357782987
274797346 322192622
267839519 303268310
264299518 293702126
265737866 298181155
265219346 299939116
...

result:

ok guessed correctly in 58 attempts

Test #38:

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

input:

999999999
752461264 323805037
124978271 606205798
881207559 367474976
787186403 30637576
758439788 715452928
163111927 128324639
504394905 76259694
874905429 98446608
861673367 302904611
924900659 161107643
570127027 44803745
825283813 186684144
554787886 1385888
476654363 24758247
832981267 2024355...

output:

500000001 500000000
750000001 500000000
548847404 324499274
652092349 376278808
634433097 185960678
635197958 279524277
597320494 268876444
607937814 228979610
631823261 219140635
639974860 223382871
647970072 211940117
649127744 198384202
656028157 194758739
657123310 187524522
654027394 186031175
...

result:

ok guessed correctly in 65 attempts

Test #39:

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

input:

1000000000
574851157 956297383
275140178 426277621
41073496 542585660
70441360 735398877
877739009 405582648
294708628 917373414
377149421 930401308
273767792 916163933
219164217 810367825
108740096 873842933
48363182 990445909
426304914 961973765
184399054 895418983
912951835 85575367
54846204 7426...

output:

500000001 500000000
500000000 750000001
277819636 751181324
139393671 770546549
69853352 780471260
89390482 649627823
153408518 656634908
126886341 727270589
117188835 767799147
128574160 769139746
112291941 803258728
104340942 820362276
107559975 823537638
103537796 832447155
108620432 825929514
10...

result:

ok guessed correctly in 63 attempts

Test #40:

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

input:

1000000000
952213223 676158930
534823457 953212334
560228949 845643961
630355986 468004498
825037842 433896637
830465548 674392455
461945071 976133678
126589303 976490810
922565180 877015063
640794198 847262545
960511766 668499358
58492017 995001607
570301167 986540797
761664575 899045539
237840271 ...

output:

500000001 500000001
750000001 500000001
711061616 754631566
562289408 814058413
561702675 692589048
616894546 683344138
678522041 760550560
697758536 800387819
669276020 781596987
690063696 802597689
691340493 815911963
700024668 824838513
693961012 816691796
698569785 826561737
700728795 831148145
...

result:

ok guessed correctly in 61 attempts

Test #41:

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

input:

1000000000
248721315 636545964
694872177 840643291
27456904 620337430
28368697 882842073
30825425 217326105
131857506 839576851
79394826 922896928
46047405 834710700
350303180 678458344
938993157 947225224
2109741 937342465
96912833 962770699
70913159 429800497
82810953 974208537
11827496 901705242
...

output:

500000001 500000000
250000001 500000001
291982248 783881363
207877310 721508458
115591098 854755598
135925886 795890334
113485436 825451562
49841345 834466660
24816579 831339586
35711740 826613211
42424096 835664658
42004522 849548809
44428644 856589976
43313081 852869222
43660900 854689278
40222855...

result:

ok guessed correctly in 69 attempts

Test #42:

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

input:

1000000000
8426636 404179658
153768704 363334229
263720645 588351342
200963729 395963369
895858146 346607620
315569128 392261317
162512610 71569484
396315832 233126489
590280107 153490878
700592226 43778073
109306650 65996629
12848508 856853887
343893102 942594134
28571999 510373456
32124009 8146260...

output:

500000000 500000000
250000000 500000000
284308859 242998683
271703903 364176482
132064318 399179948
198258665 375605370
234288001 417586526
232872477 358403651
246382257 345340443
250072990 334803115
235748391 298933530
224938717 279409953
226103944 286602660
231502489 292774740
227800084 293788858
...

result:

ok guessed correctly in 66 attempts

Test #43:

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

input:

1000000000
716815311 307164877
654942201 581249147
780305865 466500530
713549037 154382951
152212438 371102459
69457926 523018825
86631277 132098296
728823832 952098445
738360661 534598998
923223503 531360808
724307411 29628578
93982557 976488329
788328414 362349470
954597351 11685498
49765443 44791...

output:

500000000 500000001
750000000 500000001
664526586 558497722
635845541 443295647
455106711 222007789
367538954 119414656
405714183 200911894
352616666 135847314
381637329 162531421
395116311 176193012
401694810 183097900
407814221 168647602
404554015 176120321
407239201 179043584
408795584 174543886
...

result:

ok guessed correctly in 62 attempts

Test #44:

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

input:

1000000000
497027630 856053249
674852462 815186781
54251550 767218539
61347330 300010494
223953402 606171863
654960713 968458146
192790145 758768991
28641863 947530876
682887365 746247880
377503095 827547398
586906921 51772898
56758381 585234629
933749315 752567352
319246693 997213385
39758540 79717...

output:

500000000 500000000
500000000 750000001
749927708 751237427
624889057 750703571
583170474 720310262
523527604 771868280
486348816 878503054
458876840 907472128
439598937 955934282
448803388 929752044
443176311 919448131
453107492 908040528
448658255 902339013
452760399 894032820
452475032 899197318
...

result:

ok guessed correctly in 61 attempts

Test #45:

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

input:

1000000000
515963705 772239976
695086671 28551128
683887603 444813788
831218382 729875083
859905065 804768721
851519780 804422554
975470765 906785693
517485738 194953717
965002488 295780264
162633495 135064339
913397844 860271149
998523398 892347720
923998491 366663141
616820242 969481109
946811967 ...

output:

500000000 500000000
500000000 750000001
500000000 625000000
762702148 664434476
852680237 681020276
811870778 764095421
913741668 763778715
924669571 811948193
910458219 790584263
953495217 767295824
925080171 771400860
911795742 780336819
926089309 782022467
930677454 777411219
923436132 776742839
...

result:

ok guessed correctly in 64 attempts

Test #46:

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

input:

1000000000
344850519 873223555
128371146 118384943
772338042 303954411
169791144 89788964
687181345 834655431
183790819 318363882
201613398 846233135
76214360 350855818
379173458 991625299
151108373 997233288
47316314 21748578
51198875 719708544
187945291 155636024
113399925 390417956
101180971 9094...

output:

500000001 500000000
500000000 750000001
206021941 723913103
264444525 551061407
151718961 456090226
223749984 504990254
239658556 458090377
211076608 484511696
168400533 488403338
156761911 504591521
142707783 513406609
133823407 510409341
121212725 513187405
128021265 511828351
123044354 510555010
...

result:

ok guessed correctly in 62 attempts

Test #47:

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

input:

1000000000
432211245 314764982
271923179 672229850
45697258 130528599
825695096 575766009
610426027 484220110
215664318 769800724
337681982 171401355
993957344 32194357
47437819 53295122
212101075 53749697
201774044 85171232
50477809 131113774
98953386 945670106
123064657 222120534
13870561 19582230...

output:

500000000 500000000
500000001 250000001
203270577 270503166
87244493 161916649
114265230 255910259
169902020 242231584
118817688 325829820
145702613 281432551
175312483 267968609
169541346 255844365
171709068 247815685
192551965 244766956
178244617 244873046
172752431 246001178
164349280 244765809
1...

result:

ok guessed correctly in 63 attempts

Test #48:

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

input:

1000000000
320237317 15520840
989265839 673052610
763216874 42659259
126770784 210628264
87841554 693159913
650804117 153383712
554962360 174614208
971224294 227199239
60247803 38120572
824585230 141668194
114786336 62618017
187866126 55696465
54357432 312623070
606486442 331416337
622948457 1206230...

output:

500000001 500000000
500000000 250000001
724471551 233143587
815534168 121505695
723695035 113005002
719473008 183673605
664338340 152918335
624566341 165965552
645549491 150696142
638329501 139467668
645139058 115446263
641848341 118973255
641508531 104532992
640098883 116978666
639649715 126230826
...

result:

ok guessed correctly in 54 attempts

Test #49:

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

input:

1000000000
34594522 889589819
354044926 978002750
306421965 634213850
244017324 251109538
316331389 481723864
713766531 707958742
670493837 365879131
299653035 888054703
449803801 3140362
788797458 827332406
578431134 338929306
762035869 990778680
2748693 22883244
618794727 671037058
392545559 16362...

output:

500000001 500000001
250000001 500000000
345004396 752096734
273445537 632865951
263053870 567684541
397197980 551058571
463884289 536621258
489900769 525036045
522587649 566968756
504337848 545031981
517748192 557660062
530013707 554082591
539841835 558050530
534670500 556203418
537266007 557119861
...

result:

ok guessed correctly in 62 attempts

Test #50:

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

input:

1000000000
366447636 166481173
47090769 463360922
636061293 118132117
336281695 118397252
89490904 34782369
346750418 53459261
810556737 245605037
702825123 8460251
220862400 26966798
161377504 20431071
46988138 24831629
999402284 49204762
834657801 16991873
74381142 13086168
148171362 12704609
4451...

output:

500000001 500000000
500000001 250000001
245327299 290135362
365237104 253892947
307557780 126950682
240682032 140119415
256168344 63191836
288235415 80280391
303249700 37762521
288501616 29139049
282152555 18032656
279230567 13960772
280830656 18935670
281596719 22130582
281240102 17745004
281252454...

result:

ok guessed correctly in 71 attempts

Extra Test:

score: 0
Extra Test Passed