QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#703705#800. TrianglesTheZone100 ✓35ms4960kbC++172.0kb2024-11-02 18:17:082024-11-02 18:18:18

Judging History

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

  • [2024-11-02 18:18:18]
  • 评测
  • 测评结果:100
  • 用时:35ms
  • 内存:4960kb
  • [2024-11-02 18:17:08]
  • 提交

answer

#include<bits/stdc++.h>
#include"trilib.h" 
#define is is_clockwise
using namespace std;
int id[40005];
vector<int> p;
int n,m;
inline int pre(int x){return !x?m-1:x-1;}
inline int suf(int x){return x+1==m?0:x+1;}
void mfy(int x,int k){
    int pr=x,su=x;
    while (is(p[pre(pr)],p[pr],k)==1) pr=pre(pr);
    while (is(p[suf(su)],p[suf(suf(su))],k)==1) su=suf(su);
    if (pr==su){
        p.insert(p.begin()+pr+1,k);
    }
    else{
        pr=suf(pr);
        if (pr<=su){
            p.erase(p.begin()+pr,p.begin()+su+1);
            p.insert(p.begin()+pr,k);
        }
        else{
            p.erase(p.begin()+pr,p.end());
            p.erase(p.begin(),p.begin()+su+1);
            p.emplace_back(k);
        }
    }
}
void ins(int x){
    m=p.size();
    if (is(x,p[0],p[1])==1)
        return mfy(0,x),void();
    if (is(x,p[m-1],p[0])==1)
        return mfy(m-1,x),void();
    int l=1,r=m-2;
    while (l<r){
        int mid=(l+r)>>1;
        if (is(p[0],p[mid+1],x)==1) r=mid;
        else l=mid+1;
    }
    if (is(p[l],p[l+1],x)==1)
        mfy(l,x);
}
int main(){
    n=get_n();
    for (int i=1;i<=n;++i) id[i]=i;
    // shuffle(id+1,id+1+n,mt19937(20060430));

    shuffle(id+1,id+1+n,mt19937(time(0)));
    if (!is(id[1],id[2],id[3])) p={id[1],id[2],id[3]};
    else p={id[1],id[3],id[2]};
    for (int i=4;i<=n;++i) ins(id[i]);
    give_answer(p.size());
    return 0;
}

































































































































































































































































































Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 15
Accepted

Test #1:

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

input:

3
-843737031 -842526876
951189384 673353567
-450418999 301219510

output:

3

result:

ok single line: '3'

Test #2:

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

input:

50
4 -2
1 -1
7 49
11 121
9 81
144 -12
-121 11
-25 5
15 225
-49 7
-4 -16
196 -14
-144 12
225 -15
16 256
-13 -169
-14 -196
-8 -64
16 -4
-1 -1
81 -9
1 1
14 196
-196 14
169 -13
8 64
2 4
-15 -225
-225 15
12 144
49 -7
5 25
-64 8
-2 -4
-9 -81
13 169
121 -11
25 -5
-5 -25
-16 4
-12 -144
64 -8
-81 9
-169 13
-...

output:

4

result:

ok single line: '4'

Test #3:

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

input:

50
979124700 -992338349
736374129 734005658
981535490 990865445
-484962537 480422077
-745993272 -748185625
484344794 483931970
-232248914 246030679
-495828121 -497357556
-985814105 -991789434
726694781 730510441
494073302 -491398783
995428232 979904299
749643391 -744013975
248096177 -226384053
-7333...

output:

6

result:

ok single line: '6'

Test #4:

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

input:

46
-199572371 -192785393
989316110 995023728
-789787221 789411221
585957279 -592169437
-582511265 -589750301
-393949582 383032275
-588028366 -591946851
184826022 180434314
998267190 981171313
790204542 -784542306
-988578027 -986833362
-188687082 -183079314
-998815006 -988281872
595132299 -583827520
...

output:

7

result:

ok single line: '7'

Test #5:

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

input:

49
906487856 -953143052
-950934234 -936109651
907154460 975915376
939336319 -914418242
909713554 -911204211
-958765776 -998030591
-959130523 983660999
-942130131 918163279
-926159764 -959435700
-926678580 -951154248
-933502466 -977094402
952097226 922181470
901641247 980225866
-953169715 972540573
-...

output:

12

result:

ok single line: '12'

Test #6:

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

input:

48
243704557 243886225
741847703 742103409
576063232 578812957
-498765984 -494103894
495343325 499055782
495476618 -491751137
409983641 -416089526
-664447792 660953507
-245087552 246165432
-826135529 833057762
581493502 -582519609
327418991 -332503244
80282745 76301615
659700427 -658751059
-41519058...

output:

4

result:

ok single line: '4'

Test #7:

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

input:

44
-994107271 -994905012
991415950 996505441
89845701 -90430171
-363238163 -355859143
-358356759 354953422
-726711842 723711747
-539596442 -541192768
-453177351 -450712641
723241883 -720964778
88096691 81873292
-810047251 -814675705
-994340831 999890026
-180812074 -180764320
-90003513 87174498
45208...

output:

4

result:

ok single line: '4'

Test #8:

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

input:

4
-156549926 -924331297
955370154 119779694
-452637503 -80094304
-187786111 -615328472

output:

3

result:

ok single line: '3'

Test #9:

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

input:

5
-75664414 161433563
821735079 -912616013
-513074987 465623614
-694785438 491460381
806554797 588032912

output:

3

result:

ok single line: '3'

Test #10:

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

input:

6
-641940720 496207435
-124301057 395882339
-550907508 -199725552
-540857797 -159323091
812898562 -619072241
833107948 -452674388

output:

5

result:

ok single line: '5'

Test #11:

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

input:

7
-640171411 -194312902
-841925336 987730324
190043513 -997888031
-818099011 526395621
765098899 -53534033
-519211010 -921903684
749848805 -765518967

output:

6

result:

ok single line: '6'

Test #12:

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

input:

41
380701988 922855772
115265816 624206110
564093844 411574277
-881538381 877200345
-412242344 761745352
945378293 361681623
-904879934 723204845
147880866 -864247586
249024489 -903829852
647589504 -337594157
-518799399 962924076
-850010913 -667767542
163811403 -918456106
-782725002 677956952
223484...

output:

10

result:

ok single line: '10'

Test #13:

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

input:

50
10288942 718800125
-175163671 461348938
-41894187 -188359
361416452 814866862
-483015165 -241162435
688227119 884275048
831652063 485653071
-941435430 716061694
-696492422 292554600
938287584 -761488546
-104687634 -842116647
-569400512 304221855
725171537 257303412
988305163 -45647344
394973454 -...

output:

10

result:

ok single line: '10'

Test #14:

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

input:

34
508290826 15791597
-683720904 -330140838
-811686172 184593566
-887666516 -913521430
-39370660 999925559
-967813073 -855716713
-793030200 640771945
-829134725 -264199529
394959900 -192044348
63343986 42357788
-905654596 376500150
-967662318 158907537
-484425551 624422121
526116315 747079394
-80594...

output:

8

result:

ok single line: '8'

Test #15:

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

input:

49
906143424 417169195
-925069021 40048162
-866308184 -925743164
-957951867 997958323
941169873 880398412
-488065615 -450400835
-288753034 443881249
588383809 -706787880
-952293324 -270851338
-488333825 -210747813
-395352158 91150279
-734516663 -993983984
-263663678 -42897283
-200748493 922344223
47...

output:

7

result:

ok single line: '7'

Test #16:

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

input:

41
75942247 161303090
464585911 600316395
-240652531 482431296
-351550559 361796156
77204917 66670756
204025250 960347706
427356139 667233091
-166970684 562345318
-277739048 442110952
-129868129 602530769
384357399 333625295
-55844442 682324303
353211801 800183789
-92805683 642519265
129835356 88133...

output:

40

result:

ok single line: '40'

Test #17:

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

input:

41
334913690 314675657
570375516 790105979
557755636 525763654
52252985 226231479
278966199 261856430
33026870 337395481
56215814 52477716
446447694 420162673
723567924 684553149
531156355 815327553
30121161 750239361
-46802607 666941363
-110657144 165826886
416329025 895235285
112473551 105073437
1...

output:

31

result:

ok single line: '31'

Test #18:

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

input:

50
11922187 895057064
120652951 156530544
0 0
-489132581 709818172
67494755 842433770
-184220660 313596394
344763311 578941054
40203088 52087198
-112036480 669197362
-323108145 834029658
-40603997 41892396
234121951 684499738
80525837 104385197
-250193124 473233095
320693057 420070901
-44265520 9479...

output:

43

result:

ok single line: '43'

Test #19:

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

input:

41
145091339 853626695
-334823894 333424328
-134733591 133384177
0 0
-268170428 266770009
200691857 176193616
35392433 388720616
10768105 867159573
-284092763 533272989
79691023 154523482
133872430 117454732
-48304426 800569565
400149569 351794686
481979638 646995521
532845451 469578068
219912994 85...

output:

32

result:

ok single line: '32'

Test #20:

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

input:

50
-222291945 779232450
-68568560 349327520
84768797 673756988
369864461 449840862
74862189 147270091
326126660 378112566
-337563402 742106475
166608554 416555061
337416175 467260186
312177887 369572032
27445091 722785664
-266136132 701401452
-122436054 707791201
-47202536 355355692
-98677084 576377...

output:

3

result:

ok single line: '3'

Test #21:

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

input:

50
199759673 522548127
141466143 478564812
-127935176 566933066
-53425330 541884108
155232258 188230107
194814733 548671151
499933623 501042533
-332891006 727412234
101363088 147246160
124979969 655266558
92192035 235440385
-422003444 869427378
-2738584 282258205
1835322 88234069
373493757 509483171...

output:

3

result:

ok single line: '3'

Test #22:

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

input:

50
-745793301 831971251
-281529044 400230556
-685584785 357037077
-860152609 565515261
-1000000000 500575585
-371618700 417831109
-484251935 246978035
-660752788 731212136
-647007878 919784005
-435632943 607374227
-333388972 500093208
-692184601 735913040
-823245814 494037010
-676265223 458097291
-3...

output:

4

result:

ok single line: '4'

Test #23:

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

input:

50
-52986533 666799687
-415883008 494867287
-68948753 417898919
-55485546 663770536
182360552 440506257
-26179651 640857578
-106632231 363756924
-666491078 400396910
333508922 499553584
-481507523 290745965
-265079621 307141276
211925222 351784316
21395107 223727778
222052615 517586050
82342312 1387...

output:

7

result:

ok single line: '7'

Test #24:

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

input:

50
-288957968 767654042
570878259 400627174
-232776947 715179510
-142858033 248912901
-86150821 154400533
285003774 601255067
-95480950 552028576
-306920579 564607215
142613049 700815737
-127192257 490281531
428065259 501180576
28851388 244720896
-41606987 753365553
-46247722 329917979
158421125 599...

output:

14

result:

ok single line: '14'

Test #25:

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

input:

50
385229206 499242519
77168996 99321119
-614770794 499660888
95386106 394372329
-248283514 648600960
137461380 636187542
114219607 577041005
87982226 165354055
-538452143 436860628
0 0
-76172782 937604870
-307598025 749982809
231814013 700060140
308386167 600099635
154295026 199041493
-474929414 53...

output:

26

result:

ok single line: '26'

Test #26:

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

input:

50
1000000000 499532034
372921644 345168862
642370333 638305849
660140873 887338443
467839743 591020626
398249448 460647402
805372888 780404295
314992192 456409180
569207391 764044171
696254670 580595373
910799536 601713074
391955606 314054186
468274808 613444458
715435970 710361873
303840525 242168...

output:

4

result:

ok single line: '4'

Test #27:

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

input:

50
0 0
429739518 499481602
82152703 702552059
-117388152 241047639
255177055 490019690
-152056476 390518571
17129514 738167219
193538584 615936374
168874163 642447194
-234831965 516381302
246607858 381651962
-418355102 927244335
-236747382 692495133
-9304943 521461846
155680523 377425750
-258195452 ...

output:

3

result:

ok single line: '3'

Test #28:

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

input:

50
199494148 222915499
309082003 558170152
133228317 622978064
622237300 805811539
-56456218 295751682
131340166 146533734
525338562 555628593
13971362 86525185
200909450 638622536
750235080 749448026
325797349 679070639
250675662 249680092
655086451 720442164
141829362 523686628
397336013 648268153...

output:

8

result:

ok single line: '8'

Test #29:

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

input:

50
-480507287 465053312
-848070799 692177892
-696578647 890227154
-777727178 690639363
-767931913 633994149
-794639700 673649954
-750884528 600286190
-432930865 480305350
-331761765 476840525
-324091179 375120875
-280932593 406463028
-377461830 356334103
-666307977 809306004
0 0
-581325073 584796248...

output:

7

result:

ok single line: '7'

Test #30:

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

input:

50
108290559 620245706
-53018360 264258816
-199607021 199186949
56593496 517633372
-198807920 801019705
70654498 200288650
401246479 399656101
-264223034 644948570
-498803840 500546081
-100212633 99457302
-299751482 299785994
-38213282 564722663
186861587 320193571
61890917 783234126
201303652 19961...

output:

20

result:

ok single line: '20'

Test #31:

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

input:

50
0 -1000000000
1 -999999999
2 -999999996
3 -999999991
4 -999999984
5 -999999975
6 -999999964
7 -999999951
8 -999999936
9 -999999919
10 -999999900
11 -999999879
12 -999999856
13 -999999831
14 -999999804
15 -999999775
16 -999999744
17 -999999711
18 -999999676
19 -999999639
20 -999999600
21 -99999955...

output:

50

result:

ok single line: '50'

Test #32:

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

input:

50
49 -999997599
48 -999997696
47 -999997791
46 -999997884
45 -999997975
44 -999998064
43 -999998151
42 -999998236
41 -999998319
40 -999998400
39 -999998479
38 -999998556
37 -999998631
36 -999998704
35 -999998775
34 -999998844
33 -999998911
32 -999998976
31 -999999039
30 -999999100
29 -999999159
28 ...

output:

50

result:

ok single line: '50'

Subtask #2:

score: 20
Accepted

Dependency #1:

100%
Accepted

Test #33:

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

input:

3
245265397 -871413877
-469512512 140244186
40126988 -948387520

output:

3

result:

ok single line: '3'

Test #34:

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

input:

500
-7 -49
16 256
3969 -63
-74 -5476
4761 -69
-163 -26569
-6889 83
14641 -121
441 -21
-147 -21609
-158 -24964
58 3364
-19321 139
-27225 165
529 -23
44 1936
69 4761
6400 -80
-3481 59
113 12769
15376 -124
71 5041
-676 26
-108 -11664
2601 -51
-65 -4225
23409 -153
-1369 37
100 10000
160 25600
-25 5
-29 ...

output:

4

result:

ok single line: '4'

Test #35:

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

input:

499
972093273 972274403
-781887272 782697721
25981716 25028038
214174649 216187465
-675381318 674283120
-729388736 727193630
-889458523 -890500738
-402782444 -405164219
377460608 376732994
-270129588 -269203057
-376687268 -377237427
-972253541 -972806837
997663509 999795088
-619741192 -619592590
675...

output:

7

result:

ok single line: '7'

Test #36:

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

input:

491
-766738155 -765834673
-765259574 766567323
-882258128 883614133
232128076 -231032867
-395226627 -394824687
463709337 465082944
858177750 858908078
115393636 -115075644
929694957 929117655
-486126547 486382657
-835928994 835034749
-882930523 881491500
509932947 510636661
837086370 -835956832
-487...

output:

4

result:

ok single line: '4'

Test #37:

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

input:

499
-643869078 643494841
-837133457 835961571
-642401253 -643806650
837434834 836346614
160181436 -160939574
-836349418 836298269
803247927 -804584938
-29351876 30938935
31309919 -32084886
-645117306 643759864
-611367453 612150646
514933982 -515369471
806214884 -805281219
-674327830 -675458349
99709...

output:

7

result:

ok single line: '7'

Test #38:

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

input:

496
644738292 -644780296
-193220713 193364655
531733130 532214208
-402871280 -402720916
394906456 394369752
450916202 451192460
-402537191 402434098
-628358193 -628813982
926702080 -927275374
-878462284 878869826
104523846 104428055
258030102 257707330
-104314016 -104293445
-346536955 346372687
-491...

output:

4

result:

ok single line: '4'

Test #39:

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

input:

496
-169129028 -169313810
338507099 -338181476
669163759 668791321
652753255 653028384
7289163 -7809384
-991144279 991691713
-515391066 -515464000
-886709779 887071849
362289928 -362630233
975719366 975480154
-790316534 -789578352
434914423 -435109897
709481253 -709475410
-596696403 596502794
-70134...

output:

4

result:

ok single line: '4'

Test #40:

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

input:

4
-968204299 842205208
969152323 -180436988
432981964 626383858
-205067281 -314202259

output:

4

result:

ok single line: '4'

Test #41:

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

input:

5
-859767274 85849308
225243392 686508612
-727984800 394316057
-850734280 -997912571
486465626 683315768

output:

5

result:

ok single line: '5'

Test #42:

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

input:

6
17707397 -42236658
-103769658 -965203106
-970377170 292758023
-928241944 -316910301
774404091 -496485688
-3668021 -235871185

output:

5

result:

ok single line: '5'

Test #43:

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

input:

7
295612974 -918508129
319885194 -408283716
995658644 -742521196
-494476782 -960257132
691261992 -787718942
984866308 -757933966
869757975 31723528

output:

5

result:

ok single line: '5'

Test #44:

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

input:

500
986829006 -222214483
-470137477 677154039
-11104807 766257097
573824328 -405117060
-289088046 763747835
285517569 -519989723
-779353013 403072972
-18350622 -778981781
111718415 495330868
-440458854 -574940393
898595195 -222652794
175803087 -244814622
735654801 969704483
-694375944 413112869
-285...

output:

16

result:

ok single line: '16'

Test #45:

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

input:

484
-265200044 376747204
306529423 -89320965
882361819 545695880
663531115 193521462
-284901509 211620829
962341643 -693588434
-298787542 -929287554
909689260 765101817
-398583282 -942810745
643414177 -783946023
772529042 565626589
-493864099 -869550081
-188295481 407077500
485206028 -903895974
8513...

output:

18

result:

ok single line: '18'

Test #46:

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

input:

500
153301710 -495174451
77064566 -460028219
436429153 -650099901
-50305927 9909920
-981419329 -453241254
-151886934 76938516
12518009 499257580
293190798 -596280376
438868316 182580929
747435943 -32315464
202750628 634258679
-146805509 -13236819
979434505 -711726067
-333000534 -959996292
409186950 ...

output:

16

result:

ok single line: '16'

Test #47:

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

input:

500
-126001882 742967359
-554372668 324616887
-734400440 -728469666
-585200596 -904471617
-546455194 -895152135
211012467 -76769665
683807334 -16348250
-919515020 -596505816
-938931680 130347172
-679866494 605528436
7355111 542519107
-735811860 685528621
-464310080 73606412
494321859 -720232514
9194...

output:

16

result:

ok single line: '16'

Test #48:

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

input:

499
118957282 104861194
-334000936 542805921
191751010 898695440
-345148174 530366763
-86108606 813880474
-88459018 80639316
192878806 171430337
288211167 258276627
357136327 321709396
9641044 915247171
218794368 194964513
427902515 653116846
66168950 57920573
541141193 495296974
-92875767 84722497
...

output:

495

result:

ok single line: '495'

Test #49:

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

input:

496
17315810 44492096
-19908212 935124395
-467381706 441801969
-238504740 698611360
106930932 91738156
-142441476 803846247
-9901759 7503208
-376820573 544803666
484560024 470340920
-446549635 465808949
129880812 899817933
-371258735 298178573
155323538 134184900
309065624 687042440
245127961 763799...

output:

490

result:

ok single line: '490'

Test #50:

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

input:

500
362942016 588871884
-309881029 275818935
307580429 339387541
-246187023 793156928
-107147299 93285195
54411476 57909625
-474251908 427915237
387639362 431293872
-245333498 217087030
-16768241 14257967
-388570643 664506711
-331951875 715898702
-217078909 191539931
127015397 852388675
434935547 48...

output:

492

result:

ok single line: '492'

Test #51:

score: 20
Accepted
time: 1ms
memory: 3996kb

input:

500
162292371 828374339
494846926 512661925
71671679 69464061
122972896 120357149
399359703 605265065
-455627509 483362242
-160286271 873937157
-124321036 127256784
357162201 645520744
-139253773 894162425
-428808442 453653741
-355686818 373521464
-88878800 90329963
30094921 949595764
-464580852 572...

output:

492

result:

ok single line: '492'

Test #52:

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

input:

500
206113671 206134731
899970298 900114286
561226687 561372603
450576406 451027228
595815733 596015712
255894103 256215977
309458415 309797788
534246708 534872705
533737553 534163082
481020511 481286897
447780699 447816739
365812348 366085192
324307324 324673631
272304673 272512866
604203730 604363...

output:

3

result:

ok single line: '3'

Test #53:

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

input:

500
-756046579 756011949
-710299085 710220521
-353052378 352988488
-542839633 542714253
-478067703 478016884
-783220882 783219710
-462638722 462568486
-719761103 719626470
-209075469 209074322
-535376895 535269767
-527890552 527862530
-713806720 713743033
-775083885 775057831
-709903618 709806885
-5...

output:

3

result:

ok single line: '3'

Test #54:

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

input:

500
-160633216 325003809
-5645137 755546038
63715454 511412683
239548943 480464277
211107882 161498307
173964728 245451130
152711933 262543040
37248124 729675037
-83879696 375726604
470496041 446855996
-123644723 333597066
352212023 298733351
60137546 339034645
-250143092 499488222
0 0
306506839 371...

output:

8

result:

ok single line: '8'

Test #55:

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

input:

500
524136093 339248732
210848164 156939277
389636624 297962771
215528673 417062656
234140291 490454573
185567779 588550814
-5053272 287646441
-55268191 360382648
-45553631 957646240
-132909456 242007790
218643419 415679913
-384068713 325268014
-27111462 314397867
-29663941 1000000000
-214176146 367...

output:

22

result:

ok single line: '22'

Test #56:

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

input:

500
40256067 39722644
230072384 411430014
-177828761 845854504
-172959038 610863758
-60261231 128234395
-260657357 480718133
-135497039 891872203
-137544409 850839272
-41778580 659462421
51118785 492846305
-500090160 575501021
-72966862 458771862
70243892 409448495
65093608 63829097
-267318955 81315...

output:

63

result:

ok single line: '63'

Test #57:

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

input:

500
-16392211 679346897
266136136 762949674
333466178 694746277
-455102661 516838819
-91752557 88485605
-61285137 603999267
-466144387 505523997
-191500712 554850180
-183199836 177797073
152898511 876696392
-232791585 233953776
50594748 977946159
221249694 408882924
389651018 637581000
-134420509 83...

output:

177

result:

ok single line: '177'

Test #58:

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

input:

500
263507839 263307701
493132924 492304202
493888890 493852110
360018951 359812090
584413881 583905514
256458247 256436055
389812244 389313248
953737111 953706690
619361973 618945256
590501945 590336131
685513244 685218780
147228395 147109932
380995872 380478239
398733698 398297531
644381451 643737...

output:

4

result:

ok single line: '4'

Test #59:

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

input:

500
62813671 299627582
-194844460 482229304
71424981 203060640
223767575 539883545
539748604 807116535
267638693 647428835
-121041409 315419415
120152426 628915891
-75513052 245328264
619913208 919084954
14476575 56625555
292341680 567303765
651340967 890125653
144174475 376483225
35951046 443318007...

output:

5

result:

ok single line: '5'

Test #60:

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

input:

500
-318628279 466144567
333218800 333136137
-314617627 434333825
-218212031 456369719
-215122320 436346214
133382704 148152033
-419450843 267978298
14277339 317062825
145502466 207417547
88908115 733607243
-146030275 153387231
-9471927 21484297
-293010063 208170196
-140232872 462947941
228767114 34...

output:

8

result:

ok single line: '8'

Test #61:

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

input:

500
-233102779 632547733
26156463 341592014
273282649 651183127
-68257982 210228204
288661167 742742064
114677843 816561897
346811624 351929287
161522572 326672344
587452572 609483610
-183936665 818883383
-69599799 662652700
-97772779 811894942
-153942744 725733210
337641501 439259268
70911390 28001...

output:

11

result:

ok single line: '11'

Test #62:

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

input:

500
116076928 476699860
-122821306 681620018
-221165331 664561007
219401085 722408300
-10698476 494898071
353593288 639456402
392200994 609418942
-286762858 890807530
344203174 503943176
-272767529 845521138
188816880 462282917
373410055 588728049
-613887 401356395
18248 658962263
113626711 20803821...

output:

14

result:

ok single line: '14'

Test #63:

score: 20
Accepted
time: 1ms
memory: 3948kb

input:

500
0 -1000000000
1 -999999999
2 -999999996
3 -999999991
4 -999999984
5 -999999975
6 -999999964
7 -999999951
8 -999999936
9 -999999919
10 -999999900
11 -999999879
12 -999999856
13 -999999831
14 -999999804
15 -999999775
16 -999999744
17 -999999711
18 -999999676
19 -999999639
20 -999999600
21 -9999995...

output:

500

result:

ok single line: '500'

Test #64:

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

input:

500
499 -999750999
498 -999751996
497 -999752991
496 -999753984
495 -999754975
494 -999755964
493 -999756951
492 -999757936
491 -999758919
490 -999759900
489 -999760879
488 -999761856
487 -999762831
486 -999763804
485 -999764775
484 -999765744
483 -999766711
482 -999767676
481 -999768639
480 -999769...

output:

500

result:

ok single line: '500'

Subtask #3:

score: 20
Accepted

Dependency #2:

100%
Accepted

Test #65:

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

input:

3
202743412 -900665896
-7529153 844561295
-77700924 -745992259

output:

3

result:

ok single line: '3'

Test #66:

score: 20
Accepted
time: 3ms
memory: 4148kb

input:

15000
2594 6728836
1000000 -1000
-9186961 3031
-390625 625
15366400 -3920
-7935489 2817
760384 -872
4427 19598329
3532 12475024
-2002225 1415
-1409 -1985281
6175225 -2485
-3539 -12524521
1042441 -1021
4369 19088161
-7795264 2792
-5349969 2313
1098 1205604
-717409 847
-173 -29929
1500625 -1225
139427...

output:

4

result:

ok single line: '4'

Test #67:

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

input:

14996
-577707456 577748431
-978961956 -978971399
-129371032 129375008
-198673502 -198610362
-355422873 -355506978
415681243 -415579378
951596905 -951553154
-548964736 -549011175
-311105254 310989585
-929292695 929336825
-607744674 607751165
-397317610 -397319184
449589895 -449612926
-965900033 -9659...

output:

9

result:

ok single line: '9'

Test #68:

score: 20
Accepted
time: 3ms
memory: 4332kb

input:

14996
-698857589 -698882409
-935405264 -935401948
77564291 -77554289
-991501133 -991519596
529941641 -529872499
148992365 148944197
-917734877 917740757
-541433700 -541450621
-553702814 -553694382
-389342828 -389358430
304123098 -304132471
867824717 -867870774
135112228 135109327
781797906 -78183899...

output:

8

result:

ok single line: '8'

Test #69:

score: 20
Accepted
time: 3ms
memory: 4332kb

input:

14999
-345644351 345539552
305492518 -305531270
-212698631 -212821884
839368682 839241048
-876326809 -876410559
962704971 -962869480
-808428600 -808369041
-351545633 351610511
570915654 570912907
749894484 749924834
43161501 -42992426
-206685715 206660387
734421371 734305927
-660413997 660272247
660...

output:

12

result:

ok single line: '12'

Test #70:

score: 20
Accepted
time: 3ms
memory: 4208kb

input:

14996
-144009037 144030586
105349320 105348033
404352008 -404355929
-999429254 -999413513
83198393 83196795
749224612 749231463
-343530478 -343536511
-181104997 -181107484
-443569104 443562356
-927928132 -927934497
595854727 -595862608
98935936 -98954025
717223395 717210831
-689738259 689753785
-906...

output:

4

result:

ok single line: '4'

Test #71:

score: 20
Accepted
time: 3ms
memory: 4248kb

input:

14996
544645285 -544656906
515833072 -515837453
-7733574 7728707
503036581 -503043389
523047343 523042531
-560119510 -560113253
-322204720 -322198161
-550243200 550248207
-915148611 -915130055
-328333282 -328331951
755619614 755619649
-685216404 -685224027
252850270 252836493
-904998158 905006477
20...

output:

4

result:

ok single line: '4'

Test #72:

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

input:

4
710055496 493266648
831616275 494889852
-623363924 336182255
-356142010 -53085219

output:

4

result:

ok single line: '4'

Test #73:

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

input:

5
-856577222 604781651
-536943324 935731259
796077003 945734623
-548736958 740810612
428552471 110554635

output:

4

result:

ok single line: '4'

Test #74:

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

input:

6
-660334633 -671601169
-843445781 -755046931
88261006 -504940531
-430931748 -326578122
718272283 598685360
-843052595 501209

output:

4

result:

ok single line: '4'

Test #75:

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

input:

7
14872360 -742940643
819342281 -550934376
983504100 458446260
-988139921 825294153
-756697118 460401326
-793613434 -650067241
-295005809 442564839

output:

5

result:

ok single line: '5'

Test #76:

score: 20
Accepted
time: 3ms
memory: 4144kb

input:

15000
813242646 -295597989
528399895 -176444054
-172280579 -719578653
479472697 235780470
-597548766 -754867893
522975814 -948866771
385614914 722896056
732837181 643802367
223428812 -374594534
176646495 986891124
-534373892 707751683
-185971700 787047068
198153430 848673504
-344997754 -721203661
-3...

output:

29

result:

ok single line: '29'

Test #77:

score: 20
Accepted
time: 3ms
memory: 4336kb

input:

14991
-596809528 531728022
-521787606 -85076455
595142258 375515928
-276573632 207652742
-980160424 -179639119
-30231033 -363021046
662293158 489613596
16168238 444722283
-576844276 -52990295
-816517656 344813627
846930169 361050153
302865568 -912191744
-559892159 156326842
-447770033 682096494
7074...

output:

28

result:

ok single line: '28'

Test #78:

score: 20
Accepted
time: 3ms
memory: 4336kb

input:

14999
738653895 408419288
-105748008 -166102615
-876871046 94943390
-96826007 198924297
-866017154 -123626236
659820333 -253037286
444623484 -640476698
380205443 -843561287
-984372468 -934119395
798121751 -172348718
649417435 -857433013
-896798211 973712060
661746388 -605544117
-81216392 -516142633
...

output:

25

result:

ok single line: '25'

Test #79:

score: 20
Accepted
time: 3ms
memory: 4328kb

input:

14999
-397047858 -891360945
336945148 -837174257
-654914285 -570891966
-808577240 925663928
608010243 275312163
677988759 710518362
21424310 712198895
-792437267 -831546678
320861386 -160252280
-17436368 199769895
338081657 497784626
652388536 270384414
-289776730 -669188683
266466867 -413773217
314...

output:

20

result:

ok single line: '20'

Test #80:

score: 20
Accepted
time: 3ms
memory: 4284kb

input:

14999
-85882001 937999497
340826560 308473309
326516933 696230814
323172654 699827916
87349399 66538928
331497489 690853263
195489319 162869516
-137852611 893345101
-152201733 120858295
-97560897 928227284
-63442793 956345402
333196427 689013989
-337503584 299185028
-448385357 573109968
-8241969 997...

output:

14993

result:

ok single line: '14993'

Test #81:

score: 20
Accepted
time: 7ms
memory: 4356kb

input:

14991
-320281168 292336762
-161459239 134140450
171272875 864335290
-276215176 246121705
376930215 661139487
-52208855 38717165
-176823077 148457695
-420408192 592070409
358618109 322551751
477801423 544121717
502750290 510777194
376429522 661680826
-408782803 605929272
85271978 64125816
165493772 1...

output:

14984

result:

ok single line: '14984'

Test #82:

score: 20
Accepted
time: 7ms
memory: 4400kb

input:

15000
438441006 583880619
-307394142 725968789
-338520160 303460657
-203931071 169459239
474830142 537681932
-280814365 752631241
433841019 589479890
-278905293 754526491
-170247851 857441217
106099168 923307728
429813029 418660295
-270949067 234192713
423501907 411031318
50153567 969617846
49466760...

output:

14991

result:

ok single line: '14991'

Test #83:

score: 20
Accepted
time: 7ms
memory: 4420kb

input:

14996
466852058 538330726
488043152 510598380
149298758 870589809
115831789 900282818
449407228 559972879
487365861 511524053
-33496236 983556699
331887186 692328814
-465162581 454085191
-75333448 57003776
-449497727 564164937
277777239 748051429
-273076199 239599980
261795677 220414411
72279121 531...

output:

14995

result:

ok single line: '14995'

Test #84:

score: 20
Accepted
time: 3ms
memory: 4268kb

input:

15000
556807999 556977239
181590045 181635092
295869244 296065564
429658420 430061152
386263852 386521101
309809373 309995460
384122800 384168706
713756036 713797469
594167679 594553374
831036856 831093832
130460083 130546210
452391197 452419723
784633688 784662817
357312996 357590835
62818899 62876...

output:

3

result:

ok single line: '3'

Test #85:

score: 20
Accepted
time: 3ms
memory: 4200kb

input:

15000
-432943854 664971687
-357023565 711931123
-92692886 441777293
-211262712 573427454
165002192 200419206
48115895 213741931
152826304 330833633
240307804 372193852
-594006499 946748761
-237364532 439099318
-163488770 662381496
-378242529 760079465
-72108963 153493355
203603326 320149900
-1008166...

output:

5

result:

ok single line: '5'

Test #86:

score: 20
Accepted
time: 3ms
memory: 4332kb

input:

15000
406235860 653075503
4969329 740569167
143254966 189948820
-225044032 318160419
-123261017 154158685
156801008 334930183
180841811 820417816
-223190896 309453538
84736672 711589600
504261792 470739590
31295855 551859386
588198626 434116096
291778700 579603207
162998845 310365179
526329103 42983...

output:

25

result:

ok single line: '25'

Test #87:

score: 20
Accepted
time: 3ms
memory: 4156kb

input:

15000
-107399412 728483476
42577046 166843586
39209562 412144627
49606197 242449619
111625064 727680237
-69599090 566655373
-167726774 572567684
-151408167 587601415
4915370 626917771
-195286597 431640119
79712227 475074962
219875663 774542852
56867969 433499363
-179481119 382596419
-61189782 413352...

output:

122

result:

ok single line: '122'

Test #88:

score: 20
Accepted
time: 4ms
memory: 4276kb

input:

15000
11399595 841930660
-349931525 612984447
-134071238 601296634
-232012622 501499857
32800467 905649244
-101041435 658823664
426671259 535760682
280792998 585283243
-178388612 741598971
-327280525 535102008
-95902936 140028001
-86300174 456537105
176883497 793301918
-256178206 548120758
45917644 ...

output:

608

result:

ok single line: '608'

Test #89:

score: 20
Accepted
time: 4ms
memory: 4284kb

input:

15000
-130164555 290758780
129512512 854475431
253276667 641329322
-417557836 396336735
193560198 309188699
-299576426 721425813
-132561730 117031569
114977129 836508119
-226827671 254587432
71509992 851838699
44047848 353608375
-75645189 792080016
-173182284 625016685
-28788489 433299117
-349154310...

output:

3020

result:

ok single line: '3020'

Test #90:

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

input:

15000
-501730999 669687594
-746758360 507948551
-484686258 833045447
-520898631 604364145
-372315356 703290545
-484188443 845997329
-460256214 910406132
-710385629 528152013
-514049834 356693450
-536383333 894004704
-750244357 607394257
-537641027 620061566
-952152508 644595264
-281116146 214060766
...

output:

4

result:

ok single line: '4'

Test #91:

score: 20
Accepted
time: 3ms
memory: 4324kb

input:

15000
-1336060 913853485
-8332250 151726830
-57323180 838728672
31620124 885608812
-160774178 621945044
-79373846 850358828
-8765683 288252218
-325054680 555026810
-293020854 625464518
108192460 544321759
14353625 562597878
103927776 812117463
-275722495 317288880
46337008 233641804
-68717771 771049...

output:

4

result:

ok single line: '4'

Test #92:

score: 20
Accepted
time: 3ms
memory: 4292kb

input:

15000
-290867963 836492760
-47808223 122424845
-511036574 736821953
-525693694 642225341
-122411194 231988875
-283762451 795554551
-326582362 332464309
-422380944 261382864
-626643396 297737101
-411476796 654083478
-652493699 423240970
-592390079 361561687
-733507793 331321862
-804794516 474907572
-...

output:

4

result:

ok single line: '4'

Test #93:

score: 20
Accepted
time: 3ms
memory: 4204kb

input:

15000
-121080748 148219279
-979388048 745973329
-358886906 651863007
-591285664 820921021
-497991727 636622577
-789786197 806362919
-513402323 588469393
-548732069 860688738
-607594784 869159851
-647333705 739660938
-464885611 570232196
-748526498 704347040
-721465347 634221951
-472696200 802663121
...

output:

5

result:

ok single line: '5'

Test #94:

score: 20
Accepted
time: 3ms
memory: 4288kb

input:

15000
90323213 713821352
-141669345 193020175
114456360 769377988
51331251 227284136
-250133371 391754975
-35077142 643830954
-275306978 361274473
-9576354 20037263
-106715203 518127382
-50326325 159492626
-102794945 564363654
415034805 643995404
360802733 884877976
14923649 145570174
288892263 8537...

output:

19

result:

ok single line: '19'

Test #95:

score: 20
Accepted
time: 6ms
memory: 4332kb

input:

15000
0 -1000000000
1 -999999999
2 -999999996
3 -999999991
4 -999999984
5 -999999975
6 -999999964
7 -999999951
8 -999999936
9 -999999919
10 -999999900
11 -999999879
12 -999999856
13 -999999831
14 -999999804
15 -999999775
16 -999999744
17 -999999711
18 -999999676
19 -999999639
20 -999999600
21 -99999...

output:

15000

result:

ok single line: '15000'

Test #96:

score: 20
Accepted
time: 6ms
memory: 4356kb

input:

15000
14999 -775029999
14998 -775059996
14997 -775089991
14996 -775119984
14995 -775149975
14994 -775179964
14993 -775209951
14992 -775239936
14991 -775269919
14990 -775299900
14989 -775329879
14988 -775359856
14987 -775389831
14986 -775419804
14985 -775449775
14984 -775479744
14983 -775509711
14982...

output:

15000

result:

ok single line: '15000'

Subtask #4:

score: 20
Accepted

Test #97:

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

input:

3
498999289 500164826
0 0
-501000711 1000000000

output:

3

result:

ok single line: '3'

Test #98:

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

input:

122
-135326308 856066522
-88326696 904066294
-353311117 441507355
-176561051 159964959
-88434983 79851007
397766606 578255587
-103992077 888097153
194293623 185454709
195268652 797975052
299007352 286809990
-229443984 759548192
-263934443 240109169
-404993259 370300463
490741999 475479289
-123667348...

output:

121

result:

ok single line: '121'

Test #99:

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

input:

178
-10518957 10030339
-396577929 397502614
-354781959 632233830
-281457444 696316408
344017930 735726622
220693114 856918991
-241311839 239328630
-95047326 92798774
282407306 796482891
74131237 83289310
470219345 541757867
452805360 627255661
31909720 35677649
-37709503 906709611
346219561 39591212...

output:

178

result:

ok single line: '178'

Test #100:

score: 20
Accepted
time: 1ms
memory: 4052kb

input:

1724
435674967 569734141
-344223292 664794715
-371182565 636678076
-59380815 947913711
265677747 744373156
-431055657 573450807
64708196 57849142
-140934693 869383073
488788510 511916672
418946398 587517529
16220609 14001831
432304161 573332280
165312888 152492955
426760030 579230072
-115003278 8945...

output:

1724

result:

ok single line: '1724'

Test #101:

score: 20
Accepted
time: 1ms
memory: 4016kb

input:

1100
172141224 162926453
-129742135 903504912
-138847862 894710752
434251089 427318806
385178810 376249510
-32778561 28627008
-352618914 682197217
-124303061 908741673
-396971795 374472836
-392911675 640833898
304243004 663526969
438289585 517977228
192808494 183114268
-1050787 975564667
-442530480 ...

output:

1100

result:

ok single line: '1100'

Test #102:

score: 20
Accepted
time: 3ms
memory: 4200kb

input:

7604
344487273 646600702
-518930288 500151075
52125135 940464104
-5588256 3892993
-169734063 871183114
178214687 820412440
132590346 865042064
238696099 759232524
-481597137 552776352
-1076022 986810978
120775550 876391248
26381090 963422465
380843851 605960794
248726367 748872324
-287065564 7592190...

output:

7604

result:

ok single line: '7604'

Test #103:

score: 20
Accepted
time: 2ms
memory: 3976kb

input:

5273
-294028765 709996963
-205420737 799978394
456624977 584338139
463857567 576489643
-313748261 689407920
-395562316 601477782
128923185 903092890
-277370073 727243217
-337040355 664788200
-292898864 711171615
428883164 614006198
194199760 844071801
23353499 18625022
-258215740 746868884
180108932...

output:

5272

result:

ok single line: '5272'

Test #104:

score: 20
Accepted
time: 24ms
memory: 4744kb

input:

32317
-237187362 483833038
-201759621 848171215
300520727 250775195
30061742 981065412
410166728 625028467
48768023 968366905
10221009 5287286
-361078045 316666973
332612689 284893749
-222568096 174558210
447312093 421837582
-415262375 380421739
302943829 745169983
61437871 959313553
-43871384 97517...

output:

32316

result:

ok single line: '32316'

Test #105:

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

input:

6
666756564 668566198
0 0
-333243436 499213296
166714395 1000000000
333096851 333498115
220870883 353572786

output:

5

result:

ok single line: '5'

Test #106:

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

input:

6
516060012 518525684
0 0
500732558 1000000000
750692466 666349426
250641212 500782157
1000000000 332728079

output:

5

result:

ok single line: '5'

Test #107:

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

input:

6
-715666952 442384255
-750449397 666015713
-499403819 1000000000
-249026204 500106636
0 0
-1000000000 332646804

output:

5

result:

ok single line: '5'

Test #108:

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

input:

6
154336691 188058821
1000000000 666141970
501648357 332968552
0 0
667499672 1000000000
334145828 500727904

output:

5

result:

ok single line: '5'

Test #109:

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

input:

6
498734119 1000000000
-251037445 332876405
-501265881 665829221
250154255 500184857
-69341346 663798009
0 0

output:

5

result:

ok single line: '5'

Test #110:

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

input:

6
-249429260 499878130
-500618712 1000000000
-750169917 667985057
0 0
-1000000000 333791081
-423987992 441135671

output:

5

result:

ok single line: '5'

Test #111:

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

input:

6
-332582928 500725139
166933730 1000000000
667417072 665597070
0 0
273901801 374457591
333874158 331964553

output:

5

result:

ok single line: '5'

Test #112:

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

input:

6
749513925 750358345
0 0
733397885 734233471
249966058 250696070
499439211 500652752
1000000000 1000000000

output:

5

result:

ok single line: '5'

Test #113:

score: 20
Accepted
time: 35ms
memory: 4768kb

input:

39928
-476522026 551730387
224891540 171577343
-113877659 929569975
-203353341 150152890
198921935 147744261
308438536 742910689
-53655745 31604487
158140984 112034902
201777750 846235753
-193199635 141108786
-334309834 727379072
-430696847 394152056
124242704 912018484
257601588 794029365
-19506951...

output:

39928

result:

ok single line: '39928'

Test #114:

score: 20
Accepted
time: 32ms
memory: 4776kb

input:

39941
240554968 185062872
447645732 417276294
-491125898 517132655
368128061 682261344
473988500 545175998
-122366979 82607281
481654798 467242405
81278725 949027035
147955699 896869442
-285790435 770058648
-430695864 394168061
126271619 914556205
41396791 23515280
-228685763 825407987
49571329 9712...

output:

39940

result:

ok single line: '39940'

Test #115:

score: 20
Accepted
time: 35ms
memory: 4900kb

input:

39926
-142378555 98621088
-325394629 735660926
327699106 275018065
-489696976 528039827
481194989 470881153
24931815 13296058
473246909 543185134
488791191 518478648
94595699 61053528
483527197 527202941
469748725 548407248
70518821 952546153
-500692532 500047646
157977796 884285698
-343722772 29115...

output:

39926

result:

ok single line: '39926'

Test #116:

score: 20
Accepted
time: 35ms
memory: 4912kb

input:

39955
261822639 204158512
-475550649 460358621
-335602958 715847304
266887451 790691711
-63556883 38627155
403937398 358055405
432204044 393564249
398775140 351802869
78622062 951499945
16332118 992224256
205017926 848703710
493950199 516752397
456420322 426063705
-92587743 59701729
347057311 292241...

output:

39954

result:

ok single line: '39954'

Test #117:

score: 20
Accepted
time: 35ms
memory: 4920kb

input:

39948
462511423 433979231
-473759331 453767275
-90598582 57900980
-320836324 265121526
423067024 608652338
488614734 473989701
-235144749 179576796
30889537 16474888
-469825001 447865050
423913411 607558876
-135921489 92959954
162433501 880044726
-481886992 535515410
219280475 163092447
185556733 13...

output:

39948

result:

ok single line: '39948'

Test #118:

score: 20
Accepted
time: 31ms
memory: 4824kb

input:

39983
-297064710 750481437
-472950080 536181826
-444511696 411997270
234261119 178799352
371473860 686934082
-328163255 272851468
29611810 989922085
-138402537 896981374
348436732 712949934
-412186078 619857557
-234639058 178835702
355330018 705278839
-223873725 822231072
470199227 448163968
-132808...

output:

39982

result:

ok single line: '39982'

Test #119:

score: 20
Accepted
time: 31ms
memory: 4900kb

input:

39999
75496842 47039832
268243441 790263429
30326832 984735456
-209669325 842079603
468860646 450257755
-474556765 544678664
155310598 109887433
-73188123 45051470
-315251144 259448235
-25109934 985436228
465071348 444590709
-227486014 825757660
425276434 615632566
-75408940 951773738
-316891291 261...

output:

39999

result:

ok single line: '39999'

Test #120:

score: 20
Accepted
time: 31ms
memory: 4828kb

input:

39966
-163562797 887570254
-105289983 69753861
316787630 736177558
-424002630 619416642
278293061 775555590
-335677512 722718140
-410851185 371250307
335110822 281461499
397700443 645367200
23746931 984704027
-368688286 686029690
291511428 235468877
-264416222 209605430
191576248 140448137
220059596...

output:

39965

result:

ok single line: '39965'

Test #121:

score: 20
Accepted
time: 31ms
memory: 4952kb

input:

40000
164228817 114985033
470748168 442975934
-336897893 283090565
501649401 495570574
-76907883 952105469
285554518 769815118
-245981358 808246389
-421168036 381951796
-157346877 110863194
408576437 360647764
-421337820 382168352
438723154 593256356
-165288741 117570705
104381865 931130775
-4345879...

output:

40000

result:

ok single line: '40000'

Test #122:

score: 20
Accepted
time: 35ms
memory: 4824kb

input:

39990
155519328 475998776
-58248659 958804308
-411516034 369786577
115278403 76353352
-331286101 276719047
-427341681 597918147
477136725 550499188
477733800 549595294
385624593 670236436
282451482 224954270
-300906959 744481559
485206154 467723441
-64431703 39006106
-493711877 497579395
-470151737 ...

output:

39989

result:

ok single line: '39989'

Test #123:

score: 20
Accepted
time: 35ms
memory: 4848kb

input:

39997
226617428 173560892
-320556655 264836397
471111895 454190254
264188489 790822331
45661284 974137511
-150280752 895727317
289885314 235510068
74138909 954414758
-466803809 442826425
-415780873 374304072
-333695708 722693864
270657108 216100042
316145407 262922546
-260622808 204042831
-449636278...

output:

39997

result:

ok single line: '39997'

Test #124:

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

input:

3
501045942 499523716
-498954058 1000000000
0 0

output:

3

result:

ok single line: '3'

Test #125:

score: 20
Accepted
time: 35ms
memory: 4912kb

input:

39980
-39942614 980609689
470007724 449308195
239446951 183644802
305522947 745838282
139201766 95340251
-27238919 14761249
-36598780 982703796
136595125 902516229
367476169 317270113
78504625 947555550
437202182 403037894
366540041 679148063
-60418084 967131140
-41339481 979724095
-292345754 236815...

output:

39979

result:

ok single line: '39979'

Test #126:

score: 20
Accepted
time: 35ms
memory: 4912kb

input:

39997
-16309717 986093591
-83329153 940687543
-367918842 317509199
-171512782 122626967
-62288761 955915408
-297295153 240893874
337200697 726317718
130392034 89057956
500079898 512522189
96155602 945192821
-38393064 21657089
71456613 44093433
-382261600 658588025
133324946 91430850
-198617954 14634...

output:

39997

result:

ok single line: '39997'

Test #127:

score: 20
Accepted
time: 31ms
memory: 4912kb

input:

39991
-431941480 599692834
354931089 703773824
432774548 397117393
-61963457 959355841
60641466 36499250
40875374 979973653
-72174850 44622201
236544140 824002659
-385696623 340908027
-363348582 314671479
-126827889 910637042
-23976613 984354508
-63253242 38327227
446825562 415846224
347954504 29562...

output:

39990

result:

ok single line: '39990'

Test #128:

score: 20
Accepted
time: 31ms
memory: 4908kb

input:

39994
-486084514 473101573
-316048747 260656229
-154021934 894671567
213378080 158873752
-359958997 308486699
-184370095 868666035
-357804880 306068798
114519846 920868235
-500243129 499283923
-39886773 22643981
-490055656 520686617
45516494 971120918
248159525 803970138
108653093 71167746
278330877...

output:

39994

result:

ok single line: '39994'

Test #129:

score: 20
Accepted
time: 35ms
memory: 4908kb

input:

39996
-1945954 994620804
308293896 251856285
-328026775 716637702
-444234988 413893740
-266536769 780750206
238364407 182775808
-71240600 949821952
169430016 120909913
-466503468 445687869
-283882022 227214054
-361461824 679259713
-115845374 915911464
473993040 451831499
-206426457 153117554
1454637...

output:

39995

result:

ok single line: '39995'

Test #130:

score: 20
Accepted
time: 35ms
memory: 4912kb

input:

39996
-482076936 539453255
474276406 461607331
-230992264 825780972
-344104046 294564779
-356993066 698533502
-209025590 845769259
-350582684 705596098
486168124 532274692
-136203335 907726958
495782286 497997205
-12666546 6255940
352475851 703638720
435883070 604282001
-497884599 501682365
-3849412...

output:

39996

result:

ok single line: '39996'

Test #131:

score: 20
Accepted
time: 35ms
memory: 4900kb

input:

39997
-240259695 185725748
178277378 869705176
-477010805 461001091
-113079502 927795361
76361402 47584549
179403937 129593876
188255222 137357251
-320901293 267034601
252456811 802119721
-443462250 412910579
381475460 666042195
-361945186 312302574
402916134 360553156
348168698 703796147
-410220724...

output:

39996

result:

ok single line: '39996'

Test #132:

score: 20
Accepted
time: 35ms
memory: 4828kb

input:

39999
-75428217 46872579
-452904755 583998410
175132576 128711150
313705679 264574184
166156016 884490313
-208335849 156077079
-124837074 915489894
271490156 220200923
-77111814 48091872
-34805875 979493589
-7815198 3530007
-329194121 729064565
-375638531 678500567
67589149 41979837
-147460247 89750...

output:

39999

result:

ok single line: '39999'

Test #133:

score: 20
Accepted
time: 31ms
memory: 4816kb

input:

39999
-263411287 207360111
462924986 438209614
113453111 932691882
-424620876 602316018
297646595 241622949
-368587575 670256971
-460699210 436758163
325952198 739173257
-43454630 967667050
-332325383 278582770
-333298178 709782026
394643855 661435840
247690882 191997675
428574217 619301747
36515089...

output:

39998

result:

ok single line: '39998'

Test #134:

score: 20
Accepted
time: 35ms
memory: 4856kb

input:

40000
-258676586 791774157
121835745 919842433
-158649637 111156577
473825412 448310193
-39113338 22026446
-88629000 56128787
441244190 589303068
-349980366 295132795
438550608 399425784
-138553652 900769354
169639420 880111697
349079785 292638440
296499815 237223526
-224881858 169223198
429813489 3...

output:

40000

result:

ok single line: '40000'

Test #135:

score: 20
Accepted
time: 35ms
memory: 4960kb

input:

40000
130927778 370193535
-291520891 770455734
280001175 222189113
396636955 643261964
186643405 135173087
-138743386 910099794
339994428 284544948
-396554476 353908114
350490620 296095592
381967466 331999783
467362647 549878001
-448475692 587690552
425172181 384919733
-19379792 10138824
-149177660 ...

output:

39999

result:

ok single line: '39999'

Test #136:

score: 20
Accepted
time: 33ms
memory: 4892kb

input:

40000
0 -1000000000
1 -999999999
2 -999999996
3 -999999991
4 -999999984
5 -999999975
6 -999999964
7 -999999951
8 -999999936
9 -999999919
10 -999999900
11 -999999879
12 -999999856
13 -999999831
14 -999999804
15 -999999775
16 -999999744
17 -999999711
18 -999999676
19 -999999639
20 -999999600
21 -99999...

output:

40000

result:

ok single line: '40000'

Test #137:

score: 20
Accepted
time: 29ms
memory: 4896kb

input:

40000
39999 599920001
39998 599840004
39997 599760009
39996 599680016
39995 599600025
39994 599520036
39993 599440049
39992 599360064
39991 599280081
39990 599200100
39989 599120121
39988 599040144
39987 598960169
39986 598880196
39985 598800225
39984 598720256
39983 598640289
39982 598560324
39981 ...

output:

40000

result:

ok single line: '40000'

Test #138:

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

input:

3
-501234190 500430970
-1000000000 1000000000
0 0

output:

3

result:

ok single line: '3'

Test #139:

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

input:

4
499771969 1000000000
0 0
28518402 454412207
-500228031 499881577

output:

3

result:

ok single line: '3'

Test #140:

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

input:

4
0 0
499023316 1000000000
-500976684 334023216
-2122600 667096763

output:

4

result:

ok single line: '4'

Test #141:

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

input:

4
477095091 857280784
500162000 1000000000
0 0
1000000000 500538197

output:

3

result:

ok single line: '3'

Test #142:

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

input:

4
0 0
-1000000000 1000000000
-334144747 334882859
-666482290 667123366

output:

4

result:

ok single line: '4'

Test #143:

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

input:

4
-360622458 416044990
0 0
-500944967 1000000000
-1000000000 498758363

output:

3

result:

ok single line: '3'

Test #144:

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

input:

5
-333353838 1000000000
0 0
333411456 333095112
666646162 666342384
-228359263 834298497

output:

4

result:

ok single line: '4'

Test #145:

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

input:

5
-499961627 499219178
-166646994 1000000000
166508671 666853827
500038373 333118382
0 0

output:

5

result:

ok single line: '5'

Test #146:

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

input:

5
-7199036 492423520
332995720 499120241
-333541510 499214749
-667004280 1000000000
0 0

output:

4

result:

ok single line: '4'

Test #147:

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

input:

5
-166976784 667176663
-667343361 1000000000
-333833786 498369580
0 0
332656639 333032330

output:

5

result:

ok single line: '5'

Test #148:

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

input:

5
-500829558 333154465
-499047927 1000000000
-585024775 906675747
-1000000000 666745477
0 0

output:

4

result:

ok single line: '4'

Test #149:

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

input:

9
499343506 1000000000
251326028 498651885
-145833 521586947
-250282156 166627564
-500656494 334110625
-1824984 667608612
247790313 833430299
0 0
-251107225 500966204

output:

8

result:

ok single line: '8'

Test #150:

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

input:

10
149722174 600927596
318794413 463998272
0 0
-50688620 400164240
549854924 1000000000
500543564 499327491
349597600 800708087
250373917 249205918
-249920795 199989105
750079205 749270857

output:

9

result:

ok single line: '9'

Test #151:

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

input:

6
-44208376 149388352
-500006620 666300692
0 0
-249954236 332759055
-749194033 1000000000
250805967 500729147

output:

5

result:

ok single line: '5'

Test #152:

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

input:

10
333331451 332673043
-627288 1000000000
-333271707 166803103
-666668549 333817624
0 0
166887440 666177148
-334290436 667161249
-500992588 500553731
-167643049 833588243
175720081 182721017

output:

9

result:

ok single line: '9'

Test #153:

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

input:

9
-501380507 598790967
166618795 332330144
-167702598 199784777
-667311414 799889708
0 0
-167386266 1000000000
-334758220 399295242
332688586 666948329
-16576273 836251165

output:

8

result:

ok single line: '8'

Test #154:

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

input:

7
333218119 250366522
83555324 500624313
-333776453 333645933
0 0
-166264292 750170918
-417102754 1000000000
-666781881 668023131

output:

7

result:

ok single line: '7'

Test #155:

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

input:

9
-633622203 643128891
-1000000000 199176102
-141666900 334059370
-427256250 1000000000
-713455344 600918092
-570467924 800338517
-856874870 400444507
-284200955 667286527
0 0

output:

8

result:

ok single line: '8'

Test #156:

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

input:

4
666516553 667104701
0 0
333033353 1000000000
1000000000 333915935

output:

4

result:

ok single line: '4'

Test #157:

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

input:

16
401405695 499062823
-399625033 500679173
100717055 124640874
-200240455 249672836
600374967 749824339
-100276917 124719967
500974536 624082434
0 0
-233682643 625409104
-66844762 750613757
266677993 1000000000
301450439 374427636
-299690964 374803980
99730627 875477644
433299234 875376440
20123594...

output:

16

result:

ok single line: '16'

Test #158:

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

input:

13
-334646080 332516611
332377013 284692463
190051956 428508487
166873874 141937048
47693331 571415481
-667622987 666685274
0 0
-167844525 166522999
-238553692 856992209
-382362730 1000000000
-501429716 499129325
-525118465 833307095
-95490073 714415285

output:

13

result:

ok single line: '13'

Test #159:

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

input:

20
32246731 819295961
-120892914 638400869
108998412 909699614
187112929 1000000000
-197643215 547488292
572002234 443880740
-142817469 90434814
264331446 888811012
286963001 221585877
418493010 666326988
495547812 554810405
-351051246 365502492
429620378 332652571
143148320 110424608
-427997766 273...

output:

20

result:

ok single line: '20'

Test #160:

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

input:

22
272364674 429045246
-91824098 1000000000
-273725886 199555326
-727635326 532841997
90788970 715566244
-364863073 800553772
-300575 857724632
-637120856 599844823
-273860506 867269795
0 0
-455787268 733721268
-364730304 266060260
-455738353 332596320
181471704 572519729
-182508204 132996786
181627...

output:

22

result:

ok single line: '22'

Test #161:

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

input:

95
-82236326 561665245
-225281600 814692502
-449034140 558371841
-445356940 464487025
225994115 727743612
312495690 273886765
21842577 922405756
-347525606 675525432
112353730 97536646
328730243 628721062
467196703 412019250
489090975 431687988
-60973012 1000000000
246648590 707894308
-408478109 605...

output:

94

result:

ok single line: '94'

Subtask #5:

score: 25
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #162:

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

input:

3
-939478740 -216685188
181403097 -282175086
326773466 -864001777

output:

3

result:

ok single line: '3'

Test #163:

score: 25
Accepted
time: 6ms
memory: 4788kb

input:

40000
-160528900 12670
5536 30647296
-12344 -152374336
60497284 -7778
-8139609 2853
-4659 -21706281
-5403 -29192409
-176677264 13292
133471809 -11553
11715 137241225
-96721 311
139736041 -11821
117353889 -10833
-826281 909
-16129 127
-1770 -3132900
4525 20475625
-6705 -44957025
-13124 -172239376
134...

output:

4

result:

ok single line: '4'

Test #164:

score: 25
Accepted
time: 7ms
memory: 4828kb

input:

40000
-211534208 -211498153
-451960806 -451953388
-718708877 -718738871
-698308226 698359804
-271862896 271851733
583635862 -583651412
-121486665 -121410986
412898661 412895617
-739079369 739094227
51797970 51813022
469759527 -469806436
976995293 977007470
695817330 695821016
-366949326 366991202
94...

output:

11

result:

ok single line: '11'

Test #165:

score: 25
Accepted
time: 7ms
memory: 4792kb

input:

39999
469526600 -469539093
-302765865 -302768914
857733923 857726654
-755235745 755235105
220784573 -220784863
344385141 -344375201
-671710519 -671704474
84136899 -84147968
-985967998 985973910
-506190748 506171460
664248015 664260170
-722948846 722942501
946535791 -946549514
-218294934 218293265
-8...

output:

7

result:

ok single line: '7'

Test #166:

score: 25
Accepted
time: 7ms
memory: 4788kb

input:

39991
-336126761 336209942
-342689668 342630021
-504293578 -504300111
-929414561 -929430491
390423241 -390402851
159342547 -159392518
56340351 56315978
-229830856 -229832622
662657872 -662657900
421881999 -421798454
819899546 -819912153
-570474632 -570487866
3241699 3205231
-286301388 286311643
9537...

output:

9

result:

ok single line: '9'

Test #167:

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

input:

39996
360836005 -360831170
217814288 -217818122
646763053 -646763560
382331390 -382328703
454844777 454837937
870681872 -870682207
-341928752 -341925505
-879785274 879779179
-791976264 -791974742
193010373 193015163
-667357400 667360945
416636016 416632441
-228618219 228618955
-465246484 465241123
7...

output:

4

result:

ok single line: '4'

Test #168:

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

input:

40000
42594899 -42594944
-680496018 680498394
70497355 -70491140
208095917 208095381
-138799572 138797393
-524596139 524590526
197094055 197092961
650193687 -650199697
761196139 761192732
803592936 -803590246
-330892275 -330895079
719996544 -719995159
673498735 -673498518
850690035 850698360
-322393...

output:

4

result:

ok single line: '4'

Test #169:

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

input:

4
-294119361 -320170795
-436701729 -775471908
-888421109 773071995
-366658584 775017680

output:

4

result:

ok single line: '4'

Test #170:

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

input:

5
-475006887 228865587
-803113001 386095840
-268207204 -712033847
21671438 -450021717
10751681 109930438

output:

4

result:

ok single line: '4'

Test #171:

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

input:

6
-681117166 -983157923
-445399802 324530797
625818950 926000187
-779900599 -447548688
-416985605 947993024
780301402 -763094157

output:

5

result:

ok single line: '5'

Test #172:

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

input:

7
503590168 -555045245
106584503 976732735
418218896 -839379277
518344820 452513354
366520035 330278976
1377031 132314587
-533313732 -374129030

output:

5

result:

ok single line: '5'

Test #173:

score: 25
Accepted
time: 8ms
memory: 4784kb

input:

39999
-243175287 -173472061
-80664077 -820596260
889290148 -459449204
-227581461 554590897
-950098301 -621595715
-907613960 -639106668
967468079 315509221
-930059646 -753547406
611151583 963923781
-905853149 615459611
782746716 170224335
-222332245 -939748586
-783875892 925325398
-60954723 507794144...

output:

27

result:

ok single line: '27'

Test #174:

score: 25
Accepted
time: 8ms
memory: 4768kb

input:

39996
374166793 675671460
-930079400 429833499
105445982 77243547
845710186 -515937106
-554043931 -419562888
499669647 -820329847
-741929941 42511490
135575210 982467926
-231736176 338445165
558400658 821633538
-134714705 -833185889
657662721 170683505
-904867388 964550740
-871499249 -952721179
-921...

output:

26

result:

ok single line: '26'

Test #175:

score: 25
Accepted
time: 8ms
memory: 4792kb

input:

40000
-123977978 -755949393
-751487274 -117199585
-508746046 -26650604
-308506410 -735254988
899367120 -626966871
555032235 -694015536
-22354949 -371868190
-271300893 -985978879
-327221891 -9854687
-557403708 582810750
669541319 239656116
-832295541 785021364
-963329279 -994141534
-101893386 6371529...

output:

26

result:

ok single line: '26'

Test #176:

score: 25
Accepted
time: 8ms
memory: 4784kb

input:

39984
318361287 -574860364
-149346434 -183262620
342483723 544357795
-895871464 -643089873
-500723865 -890786591
-346283570 397520261
825810266 531801734
370151540 871814378
816384435 172757926
-602791166 178137922
-213744016 319384311
-617905418 -892002043
-952679715 559133199
909596039 -98005242
7...

output:

28

result:

ok single line: '28'

Test #177:

score: 25
Accepted
time: 32ms
memory: 4908kb

input:

39996
265272320 208280330
486157748 515433484
260500805 203619049
116505293 916471594
270177842 213103443
-120282825 80275360
76103403 47150500
-84974653 950768062
-34922794 19267606
-300009782 242769092
-388871265 662866266
306381688 249746460
466528228 443342240
111180712 920692408
-342964906 7151...

output:

39987

result:

ok single line: '39987'

Test #178:

score: 25
Accepted
time: 35ms
memory: 4916kb

input:

39999
-423611935 388207527
343880865 292443534
-492465425 488750180
-464863968 558556623
-488460040 521873907
276367257 784301764
494340201 490609877
-439819002 409557972
350562407 706830228
397164614 354070303
217573798 164894510
-334227983 718328890
-191754707 857293624
104458752 68992866
13191676...

output:

39999

result:

ok single line: '39999'

Test #179:

score: 25
Accepted
time: 35ms
memory: 4820kb

input:

39991
391651896 654798091
40697309 23321632
-308205789 752821211
407331409 635980588
250683127 803682459
324886530 729397018
95353831 935827316
-246131300 193408343
-163020948 888955862
15267802 989528419
-99065557 65375462
274615473 219441210
189617329 139629636
156548314 111062368
-431135899 61160...

output:

39988

result:

ok single line: '39988'

Test #180:

score: 25
Accepted
time: 31ms
memory: 4892kb

input:

39999
149741055 104315098
-162075654 885092564
276583170 777785497
-353275017 300041813
471083582 451165738
-395486128 348698198
-445939719 585533594
-333455000 720676445
87247668 55342561
-325557440 729178482
259319493 202992620
319570494 733389186
-105023412 931121616
368390232 318606304
439214992...

output:

39994

result:

ok single line: '39994'

Test #181:

score: 25
Accepted
time: 7ms
memory: 4768kb

input:

40000
-108806784 108820021
-615872298 616099894
-928929864 928940496
-212601217 212680776
-185404711 185460599
-482988098 483172213
-605844400 605888885
-720134348 720261578
-540174606 540511805
-442719694 442863638
-170631890 170734979
-554628732 554720913
-488932267 489012992
-318907032 319115309
...

output:

3

result:

ok single line: '3'

Test #182:

score: 25
Accepted
time: 7ms
memory: 4780kb

input:

40000
321230139 277117106
534510211 165175125
361687627 693264811
526908599 835850993
619491685 280849326
444772179 585580932
170509719 47009607
125396675 136866457
97431357 164473674
624021556 481912294
72529484 151534075
543865382 430936932
710096948 575974220
373243791 932349174
614428165 5688420...

output:

6

result:

ok single line: '6'

Test #183:

score: 25
Accepted
time: 8ms
memory: 4792kb

input:

40000
3507220 588812096
34355714 190648660
-170170807 361652237
71080374 150066280
-40576075 188066370
-27603373 272942236
126803290 864313846
462863115 498669791
-194597839 465693468
345531502 682192462
-20676265 608671698
85773941 812123354
-35293185 887807408
-83305139 139507142
-35297696 7574807...

output:

34

result:

ok single line: '34'

Test #184:

score: 25
Accepted
time: 8ms
memory: 4788kb

input:

40000
-196255862 217931238
-26118906 464444021
-188349409 501387817
385961750 455872827
-185332444 601620735
4088556 158587791
-131434275 387993889
366757153 644538108
211200435 528566553
-284653306 369922976
34792079 722401201
116776923 212502762
128099949 470670120
230880447 363518350
-45611780 58...

output:

200

result:

ok single line: '200'

Test #185:

score: 25
Accepted
time: 10ms
memory: 4700kb

input:

40000
-22616430 790180406
-262997375 400517889
-326308904 606422597
-284874604 438223040
-176521518 547008901
55666553 806333405
28524231 231495486
27035135 132225217
-201123714 743599318
-153111938 380673843
146730253 198657798
91399357 377806697
344203956 513635271
136146301 594464361
-63633085 20...

output:

1170

result:

ok single line: '1170'

Test #186:

score: 25
Accepted
time: 12ms
memory: 4904kb

input:

40000
-312604471 283983752
-47220208 43037965
-406297999 603340023
-103802427 542042347
7482386 993388273
218837846 799114891
-305065549 635970806
412075678 572225568
43193239 171824669
-165626420 440412749
-134186589 881665169
-322493820 428191472
-217615706 413076731
-126733654 591415210
369954682...

output:

6840

result:

ok single line: '6840'

Test #187:

score: 25
Accepted
time: 7ms
memory: 4788kb

input:

40000
-359887052 518700015
285587160 873802745
-117391012 393535867
329026730 888951838
234863869 491052700
22210067 662819000
-103918751 567700497
421022197 863796159
-94310284 513505657
241618452 839168287
31097250 401287203
-341142995 371225858
374653269 787161671
-131647766 134439414
145405797 4...

output:

3

result:

ok single line: '3'

Test #188:

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

input:

40000
745474288 744863524
370276579 369744917
681877439 681421637
338877444 338143542
267692217 266856224
246544767 246319532
704212234 703814399
191020229 190481502
447226270 446912568
637731978 637289720
278761474 277977662
353219393 353215471
642332589 641649194
815253922 815150479
574793598 5740...

output:

5

result:

ok single line: '5'

Test #189:

score: 25
Accepted
time: 7ms
memory: 4788kb

input:

40000
-339902588 442160406
-201581840 102307098
90231689 521615690
-19980963 928176478
155074817 360044650
87511388 861520810
-271411880 492846431
-103032141 764129385
-129732912 759890767
46167552 763111356
-3112094 931469198
427912706 269203497
53773819 245708609
-82618447 794284422
-359185014 363...

output:

8

result:

ok single line: '8'

Test #190:

score: 25
Accepted
time: 7ms
memory: 4828kb

input:

40000
-393608967 349006179
-29750877 840516543
-77155445 309968418
-34201364 682827411
-325589719 531221093
-510596680 595213563
-119686155 801156892
-496315182 619239982
-77093613 68558230
-235278664 408928959
133443614 708646414
-331868563 356891738
-167996669 878701363
-578373330 631347911
-18467...

output:

11

result:

ok single line: '11'

Test #191:

score: 25
Accepted
time: 8ms
memory: 4704kb

input:

40000
220135744 776841895
96408123 588763463
94983607 255036889
216162801 328359689
144039631 338935727
183925751 548999035
351891169 375451599
130786920 125266735
-99150050 307991841
51835226 352364301
382928200 347992958
223515117 763543648
269820775 729513217
478103561 487633164
226617298 5754562...

output:

15

result:

ok single line: '15'

Test #192:

score: 25
Accepted
time: 33ms
memory: 4908kb

input:

40000
0 -1000000000
1 -999999999
2 -999999996
3 -999999991
4 -999999984
5 -999999975
6 -999999964
7 -999999951
8 -999999936
9 -999999919
10 -999999900
11 -999999879
12 -999999856
13 -999999831
14 -999999804
15 -999999775
16 -999999744
17 -999999711
18 -999999676
19 -999999639
20 -999999600
21 -99999...

output:

40000

result:

ok single line: '40000'

Test #193:

score: 25
Accepted
time: 33ms
memory: 4908kb

input:

40000
39999 599920001
39998 599840004
39997 599760009
39996 599680016
39995 599600025
39994 599520036
39993 599440049
39992 599360064
39991 599280081
39990 599200100
39989 599120121
39988 599040144
39987 598960169
39986 598880196
39985 598800225
39984 598720256
39983 598640289
39982 598560324
39981 ...

output:

40000

result:

ok single line: '40000'