QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#412252#800. Trianglessichengzhou55 57ms7472kbC++142.4kb2024-05-16 11:03:532024-05-16 11:03:54

Judging History

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

  • [2024-05-16 11:03:54]
  • 评测
  • 测评结果:55
  • 用时:57ms
  • 内存:7472kb
  • [2024-05-16 11:03:53]
  • 提交

answer

#include<iostream>
#include<bits/stdc++.h>
#include "trilib.h"
using namespace std;
const int N=4e4+4;
int n;
int pre[N],nxt[N];
bool vis[N];
/*
bool is_clockwise(int a,int b,int c)
{
    bool ret;
    printf("%d %d %d\n",a,b,c);
    scanf("%d",&ret);
    return ret;
}
int get_n()
{
    int ret;
    scanf("%d",&ret);
    return ret;
}
void give_answer(int x)
{
    printf("%d\n",x);
}*/
void del(int x)
{
    if(is_clockwise(pre[x],x,nxt[x])==0)
    {
        nxt[pre[x]]=nxt[x];
        pre[nxt[x]]=pre[x];
        vis[x]=0;
        del(pre[x]);
        del(nxt[x]);
    }
}
vector<int> work(vector<int> a)
{
    int n=a.size();
    if(n<=2)
    {
        return a;
    }
    if(n==3)
    {
        if(is_clockwise(a[0],a[1],a[2]))
        {
            return a;
        }else{
            swap(a[1],a[2]);
            return a;
        }
    }
    int x=rand()%n,y=rand()%n;
    if(y==x)
    {
        y=(x+1)%n;
    }
    x=a[x];y=a[y];
    vector<int>b,c;
    b.push_back(x);b.push_back(y);
    c.push_back(x);c.push_back(y);
    for(int i:a)
    {
        if(i==x||i==y)
        {
            continue;
        }
        if(is_clockwise(x,y,i))
        {
            b.push_back(i);
        }else{
            c.push_back(i);
        }
    }
    if(b.size()<0.4*a.size()||c.size()<0.4*a.size())
    {
        b.clear();c.clear();
        return work(a);
    }
    a.clear();
    b=work(b);c=work(c);
    int pb=0,pc=0;
    for(int i=0;i<b.size();i++)
    {
        if(b[i]==y)
        {
            pb=i;
        }
    }
    for(int i=0;i<c.size();i++)
    {
        if(c[i]==x)
        {
            pc=i;
        }
    }
    vector<int>d;
    for(int i=pb;b[i]!=x;i=(i+1)%b.size())
    {
        d.push_back(b[i]);
    }
    for(int i=pc;c[i]!=y;i=(i+1)%c.size())
    {
        d.push_back(c[i]);
    }
    b.clear();c.clear();
    int sz=d.size();
    for(int i=0;i<sz;i++)
    {
        pre[d[i]]=d[(i+sz-1)%sz];
        nxt[d[i]]=d[(i+1)%sz];
        vis[d[i]]=1;
    }
    del(x);
    del(y);
    vector<int>ret;
    for(int i=0;i<sz;i++)
    {
        if(vis[d[i]])
        {
            ret.push_back(d[i]);
        }
    }
    d.clear();
    return ret;
}
int main()
{
    srand(time(0));
    int ans=0;
    n=get_n();
    vector<int>a;
    for(int i=1;i<=n;i++)
    {
        a.push_back(i);
    }
    give_answer(work(a).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: 3836kb

input:

3
-843737031 -842526876
951189384 673353567
-450418999 301219510

output:

3

result:

ok single line: '3'

Test #2:

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

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: 0
Accepted
time: 0ms
memory: 3852kb

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: 0
Accepted
time: 0ms
memory: 3804kb

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: 0
Accepted
time: 0ms
memory: 3876kb

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: 0
Accepted
time: 0ms
memory: 3880kb

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: 0
Accepted
time: 1ms
memory: 3852kb

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: 0
Accepted
time: 0ms
memory: 3844kb

input:

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

output:

3

result:

ok single line: '3'

Test #9:

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

input:

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

output:

3

result:

ok single line: '3'

Test #10:

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

input:

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

output:

5

result:

ok single line: '5'

Test #11:

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

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: 0
Accepted
time: 0ms
memory: 3856kb

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: 0
Accepted
time: 0ms
memory: 4136kb

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: 0
Accepted
time: 0ms
memory: 3944kb

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: 0
Accepted
time: 0ms
memory: 3948kb

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: 0
Accepted
time: 0ms
memory: 3860kb

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: 0
Accepted
time: 0ms
memory: 3848kb

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: 0
Accepted
time: 0ms
memory: 3872kb

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: 0
Accepted
time: 0ms
memory: 3872kb

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: 0
Accepted
time: 0ms
memory: 3884kb

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: 0
Accepted
time: 0ms
memory: 4148kb

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: 0
Accepted
time: 0ms
memory: 4152kb

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: 0
Accepted
time: 0ms
memory: 3880kb

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: 0
Accepted
time: 0ms
memory: 4152kb

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: 0
Accepted
time: 0ms
memory: 3864kb

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: 0
Accepted
time: 0ms
memory: 4152kb

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: 0
Accepted
time: 0ms
memory: 3880kb

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: 0
Accepted
time: 0ms
memory: 4148kb

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: 0
Accepted
time: 0ms
memory: 4156kb

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: 0
Accepted
time: 0ms
memory: 3844kb

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: 0
Accepted
time: 0ms
memory: 3880kb

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: 0
Accepted
time: 0ms
memory: 3880kb

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

input:

3
245265397 -871413877
-469512512 140244186
40126988 -948387520

output:

3

result:

ok single line: '3'

Test #34:

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

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: 0
Accepted
time: 0ms
memory: 4228kb

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: 0
Accepted
time: 1ms
memory: 3932kb

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: 0
Accepted
time: 1ms
memory: 3904kb

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: 0
Accepted
time: 0ms
memory: 4012kb

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: 0
Accepted
time: 1ms
memory: 3996kb

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: 0
Accepted
time: 0ms
memory: 3872kb

input:

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

output:

4

result:

ok single line: '4'

Test #41:

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

input:

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

output:

5

result:

ok single line: '5'

Test #42:

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

input:

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

output:

5

result:

ok single line: '5'

Test #43:

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

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: 0
Accepted
time: 1ms
memory: 3960kb

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: 0
Accepted
time: 1ms
memory: 3968kb

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: 0
Accepted
time: 1ms
memory: 4176kb

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: 0
Accepted
time: 0ms
memory: 4168kb

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: 0
Accepted
time: 1ms
memory: 3968kb

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: 0
Accepted
time: 1ms
memory: 4192kb

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: 0
Accepted
time: 0ms
memory: 4252kb

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: 0
Accepted
time: 1ms
memory: 4208kb

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: 0
Accepted
time: 1ms
memory: 3896kb

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: 0
Accepted
time: 1ms
memory: 3932kb

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: 0
Accepted
time: 1ms
memory: 3936kb

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: 0
Accepted
time: 1ms
memory: 4160kb

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: 0
Accepted
time: 1ms
memory: 3952kb

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: 0
Accepted
time: 1ms
memory: 3912kb

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: 0
Accepted
time: 1ms
memory: 4224kb

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: 0
Accepted
time: 0ms
memory: 3920kb

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: 0
Accepted
time: 1ms
memory: 3952kb

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: 0
Accepted
time: 1ms
memory: 3932kb

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: 0
Accepted
time: 1ms
memory: 3928kb

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: 0
Accepted
time: 1ms
memory: 3928kb

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: 0
Accepted
time: 1ms
memory: 4224kb

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

input:

3
202743412 -900665896
-7529153 844561295
-77700924 -745992259

output:

3

result:

ok single line: '3'

Test #66:

score: 0
Accepted
time: 26ms
memory: 5232kb

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: 0
Accepted
time: 19ms
memory: 5520kb

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: 0
Accepted
time: 22ms
memory: 5944kb

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: 0
Accepted
time: 24ms
memory: 6060kb

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: 0
Accepted
time: 22ms
memory: 5136kb

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: 0
Accepted
time: 22ms
memory: 5900kb

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: 0
Accepted
time: 0ms
memory: 3872kb

input:

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

output:

4

result:

ok single line: '4'

Test #73:

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

input:

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

output:

4

result:

ok single line: '4'

Test #74:

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

input:

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

output:

4

result:

ok single line: '4'

Test #75:

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

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: 0
Accepted
time: 22ms
memory: 5568kb

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: 0
Accepted
time: 19ms
memory: 5784kb

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: 0
Accepted
time: 22ms
memory: 5256kb

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: 0
Accepted
time: 26ms
memory: 6936kb

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: 0
Accepted
time: 27ms
memory: 6728kb

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: 0
Accepted
time: 27ms
memory: 6408kb

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: 0
Accepted
time: 26ms
memory: 5980kb

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: 0
Accepted
time: 27ms
memory: 5924kb

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: 0
Accepted
time: 22ms
memory: 5360kb

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: 0
Accepted
time: 22ms
memory: 5180kb

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: 0
Accepted
time: 24ms
memory: 7472kb

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: 0
Accepted
time: 23ms
memory: 6064kb

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: 0
Accepted
time: 17ms
memory: 4984kb

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: 0
Accepted
time: 22ms
memory: 5364kb

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: 0
Accepted
time: 24ms
memory: 7260kb

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: 0
Accepted
time: 22ms
memory: 5656kb

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: 0
Accepted
time: 19ms
memory: 5584kb

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: 0
Accepted
time: 24ms
memory: 7284kb

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: 0
Accepted
time: 22ms
memory: 5580kb

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: 0
Accepted
time: 24ms
memory: 6044kb

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: 0
Accepted
time: 24ms
memory: 5700kb

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: 0
Wrong Answer

Test #97:

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

input:

3
498999289 500164826
0 0
-501000711 1000000000

output:

3

result:

ok single line: '3'

Test #98:

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

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: 0
Accepted
time: 1ms
memory: 4184kb

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: 0
Accepted
time: 3ms
memory: 4264kb

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: 0
Accepted
time: 2ms
memory: 4460kb

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: 0
Accepted
time: 11ms
memory: 4984kb

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: 0
Accepted
time: 9ms
memory: 4480kb

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
Wrong Answer
time: 57ms
memory: 6184kb

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:

Too many queries!!!!@QingyuSecretT0ken123456J0fdj1n2410Bfnf
32316

result:

wrong answer 1st lines differ - expected: '32316', found: 'Too many queries!!!!@QingyuSecretT0ken123456J0fdj1n2410Bfnf'

Subtask #5:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%