QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#419293#8708. Portalpaul200826 25ms6292kbC++141.5kb2024-05-23 20:03:232024-05-23 20:03:23

Judging History

This is the latest submission verdict.

  • [2024-05-23 20:03:23]
  • Judged
  • Verdict: 26
  • Time: 25ms
  • Memory: 6292kb
  • [2024-05-23 20:03:23]
  • Submitted

answer

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

#define int long long

const int N=1e5+5;

int gcd(int x,int y)
{
	if(x>y)
		swap(x,y);

	if(x==0)
		return y;

	return gcd(y%x,x);
}

int lcm(int x,int y)
{
	return x/gcd(x,y)*y;
}

int x[N],y[N],val[N];
map <pair <int,int> ,bool> have;
map <pair <int,int> ,int> res;

pair <int,int> topair(int x,int y)
{
	if(x==0)
		return make_pair(0x3f3f3f3f,0);

	if(y==0)
		return make_pair(0,0);

	int GCD=gcd(abs(x),abs(y));
	x /= GCD, y /= GCD;
	if(x<0)
		x=-x, y=-y;
	return make_pair(x,y);
}

signed main()
{
	int n;
	cin >> n;
	if(n<=2)
	{
		printf("-1\n");
		return 0;
	}

	for(int i=1;i<=n;i++)
		scanf("%lld %lld",&x[i],&y[i]);

	for(int i=1;i<n;i++)
		x[i] -= x[n], y[i] -= y[n];
	n--;

	for(int i=1;i<=n;i++)
		have[topair(x[i],y[i])]=true;

	int GCDx=0;
	for(int i=1;i<=n;i++)
		GCDx=gcd(GCDx,abs(x[i]));

	int GCDy=0;
	for(int i=1;i<=n;i++)
		GCDy=gcd(GCDy,abs(y[i]));

	int ans1=GCDx*GCDy;
	for(int i=1;i<=n;i++)
		x[i] /= GCDx, y[i] /= GCDy;

	if(have.size()==1)
	{
		printf("-1\n");
		return 0;
	}

	for(int i=1;i<=n;i++)
	{
		int GCD=gcd(abs(x[i]),abs(y[i]));
		for(int j=1;j<=n;j++)
		{
			if(i==j)
				val[j]=0;
			else
				val[j]=abs((x[i]*y[j]-y[i]*x[j])/GCD);
		}

		int t=0;
		for(int j=1;j<=n;j++)
			t=gcd(t,val[j]);

		res[make_pair(y[i]/GCD,x[i]/GCD)]=t;
	}

	long long ans2=1;
	for(auto x:res)
		ans2=lcm(ans2,x.second);
	printf("%lld\n",ans1*ans2);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 1
Accepted

Test #1:

score: 1
Accepted
time: 1ms
memory: 3656kb

input:

1
1 -1

output:

-1

result:

ok single line: '-1'

Test #2:

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

input:

2
-455833 -283524
427847 159281

output:

-1

result:

ok single line: '-1'

Test #3:

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

input:

2
52420 -46322
-192914 87067

output:

-1

result:

ok single line: '-1'

Test #4:

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

input:

2
52446 -20773
179773 174566

output:

-1

result:

ok single line: '-1'

Test #5:

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

input:

2
-229012 -260770
-174790 -69382

output:

-1

result:

ok single line: '-1'

Test #6:

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

input:

2
-127294 418312
211124 37002

output:

-1

result:

ok single line: '-1'

Test #7:

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

input:

2
-129173 516840
46821 -187136

output:

-1

result:

ok single line: '-1'

Test #8:

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

input:

2
-90088 -7423
234488 19625

output:

-1

result:

ok single line: '-1'

Test #9:

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

input:

2
-48105 256695
15135 -80585

output:

-1

result:

ok single line: '-1'

Test #10:

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

input:

2
-251318 79061
182792 -129183

output:

-1

result:

ok single line: '-1'

Test #11:

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

input:

2
784850 417677
-217245 -460999

output:

-1

result:

ok single line: '-1'

Test #12:

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

input:

2
31270 410692
713271 917276

output:

-1

result:

ok single line: '-1'

Test #13:

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

input:

1
230862 -785444

output:

-1

result:

ok single line: '-1'

Test #14:

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

input:

2
222814 -279784
-73657 59849

output:

-1

result:

ok single line: '-1'

Test #15:

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

input:

2
72171 -104186
201480 105502

output:

-1

result:

ok single line: '-1'

Test #16:

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

input:

2
-17727 -27151
69235 15029

output:

-1

result:

ok single line: '-1'

Test #17:

score: 1
Accepted
time: 1ms
memory: 3660kb

input:

2
-44049 96618
173806 -21489

output:

-1

result:

ok single line: '-1'

Test #18:

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

input:

2
-81268 -53452
329866 -163275

output:

-1

result:

ok single line: '-1'

Subtask #2:

score: 10
Accepted

Dependency #1:

100%
Accepted

Test #19:

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

input:

3
1 1
1 3
3 2

output:

4

result:

ok single line: '4'

Test #20:

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

input:

3
123741 -122828
207774 110184
-33847 97305

output:

55218331445

result:

ok single line: '55218331445'

Test #21:

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

input:

3
-66381 27989
200580 40286
300930 -238824

output:

75745488660

result:

ok single line: '75745488660'

Test #22:

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

input:

3
-212612 305891
-228367 216399
56731 149417

output:

26569291626

result:

ok single line: '26569291626'

Test #23:

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

input:

3
58252 388020
34720 -409605
79321 85296

output:

23928862293

result:

ok single line: '23928862293'

Test #24:

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

input:

3
19556 -29968
-52219 72940
153159 -166846

output:

3924399074

result:

ok single line: '3924399074'

Test #25:

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

input:

3
201002 729262
-242878 -881858
183722 666542

output:

-1

result:

ok single line: '-1'

Test #26:

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

input:

3
-425251 245407
695099 -401393
18815 -10961

output:

-1

result:

ok single line: '-1'

Test #27:

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

input:

3
-74800 392658
-48320 253638
-13280 69678

output:

-1

result:

ok single line: '-1'

Test #28:

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

input:

3
376570 -515419
-67488 -129024
-72636 -138852

output:

6353363484

result:

ok single line: '6353363484'

Test #29:

score: 10
Accepted
time: 1ms
memory: 3928kb

input:

3
-365409 -46168
130463 -388367
-745599 -94238

output:

153937204850

result:

ok single line: '153937204850'

Test #30:

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

input:

3
4925 198059
583262 -155627
573812 -153107

output:

1884923460

result:

ok single line: '1884923460'

Test #31:

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

input:

1
-785465 814199

output:

-1

result:

ok single line: '-1'

Test #32:

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

input:

3
107518 -84340
137659 -15241
359437 347683

output:

4385745738

result:

ok single line: '4385745738'

Test #33:

score: 10
Accepted
time: 1ms
memory: 3920kb

input:

3
-203959 7059
-34097 -218222
96949 -293501

output:

16735132428

result:

ok single line: '16735132428'

Test #34:

score: 10
Accepted
time: 1ms
memory: 5840kb

input:

3
18005 283441
106422 -61165
137635 -175433

output:

652953322

result:

ok single line: '652953322'

Test #35:

score: 10
Accepted
time: 1ms
memory: 5976kb

input:

3
-233201 -63834
105532 -12105
337350 41702

output:

6234493209

result:

ok single line: '6234493209'

Test #36:

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

input:

3
36748 -26399
119775 -223323
224245 -89339

output:

31696939848

result:

ok single line: '31696939848'

Test #37:

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

input:

3
1000000 -110976
-1000000 -1000000
715820 1000000

output:

2474594840320

result:

ok single line: '2474594840320'

Test #38:

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

input:

3
48920 1000000
1000000 -680401
-1000000 -1000000

output:

3664766216920

result:

ok single line: '3664766216920'

Test #39:

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

input:

3
196198 1000000
1000000 -520790
-1000000 -1000000

output:

3426769956420

result:

ok single line: '3426769956420'

Subtask #3:

score: 0
Time Limit Exceeded

Test #40:

score: 0
Time Limit Exceeded

input:

99840
-359536 735499
-710626 400619
-468266 -282389
-192706 43659
204034 -543669
-100576 -749013
-118006 -283125
-341276 405771
560934 835595
-923936 506603
239724 956299
-680746 -737237
286204 982795
-847576 -282389
-949666 986475
996684 -429589
672984 -133717
140954 696491
-879116 -442837
985064 7...

output:


result:


Subtask #4:

score: 0
Runtime Error

Test #59:

score: 29
Accepted
time: 1ms
memory: 3860kb

input:

5
0 0
1 0
-1 0
0 1
0 -1

output:

1

result:

ok single line: '1'

Test #60:

score: 29
Accepted
time: 1ms
memory: 5968kb

input:

100
-30 -13
-22 -19
32 9
-18 -11
50 19
16 5
-50 -17
-46 -21
10 -1
-56 -19
2 -11
-24 -15
-4 -11
-8 -11
4 7
-8 -5
34 9
18 7
20 1
-12 -11
-30 -23
-42 -13
-24 -3
16 11
-16 -7
-24 -21
2 -9
28 11
6 -9
-22 -11
4 -7
28 7
-36 -15
-20 -21
4 11
-8 5
20 5
30 21
58 19
4 -1
-46 -19
-6 3
2 11
46 15
18 -1
-24 -7
-2...

output:

4

result:

ok single line: '4'

Test #61:

score: 29
Accepted
time: 1ms
memory: 3888kb

input:

100
66 27
38 -18
-39 -35
-4 9
-18 -24
24 26
17 6
-4 -26
-46 -6
52 1
17 -15
73 26
31 -10
-46 -27
-4 23
17 -29
-74 -37
-11 -39
-4 2
-11 10
3 -34
3 -41
-39 0
10 -14
31 -3
-18 -10
-25 -30
10 0
-53 -33
-18 -31
38 31
10 -35
24 5
52 22
-60 -32
-11 -32
17 13
-81 -36
3 29
-18 -45
-67 -31
45 23
31 -17
45 30
-...

output:

49

result:

ok single line: '49'

Test #62:

score: 29
Accepted
time: 1ms
memory: 3932kb

input:

100
-36 37
19 49
31 -23
-16 61
-22 -65
40 -23
-48 1
-2 -41
-1 25
15 55
16 -41
-28 -29
30 19
48 19
8 -29
0 37
-8 -59
31 31
11 -47
12 19
15 1
36 -17
-49 -11
-6 73
-5 -23
-31 -11
-46 25
-33 -35
-44 -5
-42 -35
-21 -53
30 -35
1 49
46 -5
35 -29
10 49
-3 55
28 -5
25 -41
12 73
40 31
-54 -17
56 7
27 -17
-17 ...

output:

54

result:

ok single line: '54'

Test #63:

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

input:

100
-13 12
-9 32
15 -40
1 34
5 -18
10 -29
4 1
12 -19
-5 28
-4 33
10 -17
-18 47
3 -28
-13 36
7 -20
3 -4
13 -50
2 27
8 -39
6 -37
8 -15
-7 18
-14 31
-6 -1
-16 45
-12 41
-1 24
-2 -17
-17 40
9 -22
-8 13
6 -1
-5 4
-7 -6
13 -38
15 -52
-3 14
3 20
1 -2
-16 33
2 -9
4 -23
-8 -11
-3 -34
3 8
-3 38
-2 -29
8 9
1 -...

output:

12

result:

ok single line: '12'

Test #64:

score: 29
Accepted
time: 1ms
memory: 3932kb

input:

100
16 -91
-12 21
-19 70
6 -49
-6 0
4 -28
-6 -14
9 -49
-8 -7
8 -49
-6 14
-14 42
-3 0
7 -42
3 -21
-1 0
0 -14
13 -70
9 -63
0 -35
11 -70
-8 14
1 -28
-9 35
1 -14
-3 7
8 -63
7 -35
6 -35
-4 0
-10 21
5 -35
13 -77
4 -49
-13 49
-10 28
1 -35
11 -56
0 -7
-11 14
-5 21
-9 7
0 -28
-6 28
9 -42
-4 14
-3 -7
-7 7
-5 ...

output:

7

result:

ok single line: '7'

Test #65:

score: 0
Runtime Error

input:

9
0 -79
0 43
0 -67
0 -61
0 -5
0 93
0 -65
0 45
0 -51

output:


result:


Subtask #5:

score: 15
Accepted

Dependency #2:

100%
Accepted

Test #97:

score: 15
Accepted
time: 25ms
memory: 4220kb

input:

2000
-141033 500883
-457875 317099
570107 -451327
-258775 83073
-48988 -181339
184246 148615
322139 -358663
205746 -28713
-246818 493221
315791 -439181
243789 -493721
-152335 -120605
-290252 397465
359491 -136925
321141 -96245
-410156 465995
192919 -87583
464977 -450703
99537 240803
-279989 264903
-...

output:

19966

result:

ok single line: '19966'

Test #98:

score: 15
Accepted
time: 21ms
memory: 4240kb

input:

2000
-135598 -90332
173830 142382
-5414 25496
-82528 -67798
40478 -10214
385764 525926
115398 169908
251308 294282
263590 294314
-531578 -666220
442932 537116
-371396 -521102
-245894 -230144
-429180 -568306
23432 -73138
177504 290528
-331520 -358256
169528 111726
17898 170554
409940 496694
13828 -53...

output:

5972

result:

ok single line: '5972'

Test #99:

score: 15
Accepted
time: 1ms
memory: 5920kb

input:

999
358449 23473
312882 20485
244806 16021
-99966 -6587
-527088 -34595
214611 14041
351312 23005
-383250 -25163
541266 35461
499542 32725
350763 22969
-3342 -251
-505677 -33191
91635 5977
23010 1477
186612 12205
236571 15481
-250392 -16451
-35733 -2375
353508 23149
-474384 -31139
607695 39817
369978...

output:

-1

result:

ok single line: '-1'

Test #100:

score: 15
Accepted
time: 1ms
memory: 3752kb

input:

999
184536 -196295
-436851 464755
102474 -108995
459909 -489245
-275688 293305
34794 -36995
-390744 415705
-133983 142555
445527 -473945
-352251 374755
-385245 409855
-124254 132205
172692 -183695
-133560 142105
126162 -134195
-431775 459355
371079 -394745
313551 -333545
-372132 395905
308898 -32859...

output:

-1

result:

ok single line: '-1'

Test #101:

score: 15
Accepted
time: 1ms
memory: 3892kb

input:

999
319017 -174498
336878 -184271
-69208 37927
522590 -285887
-523895 286718
-24582 13509
502874 -275099
181747 -99388
-91309 50020
-462362 253049
-138002 75569
-283222 155029
126680 -69257
331472 -181313
524922 -287163
-431039 235910
-156393 85632
-264778 144937
434504 -237689
473830 -259207
450881...

output:

-1

result:

ok single line: '-1'

Test #102:

score: 15
Accepted
time: 4ms
memory: 3824kb

input:

1000
-17417 -44014
-67007 -169294
-140537 -355054
244555 617810
-51275 -129550
328345 829490
293461 741362
56797 143474
-304013 -768046
184705 466610
359809 908978
-265025 -669550
264733 668786
-243479 -615118
-203123 -513166
-332057 -838894
-206543 -521806
-60851 -153742
-178841 -451822
256183 6471...

output:

495647892

result:

ok single line: '495647892'

Test #103:

score: 15
Accepted
time: 4ms
memory: 3828kb

input:

1000
56959 91431
-84971 -136404
-331591 -532294
5659 9081
-221771 -356004
-256921 -412429
-188901 -303239
-231461 -371559
316499 508061
-217971 -349904
-257871 -413954
-70721 -113529
242779 389721
203449 326586
-157171 -252304
15349 24636
-35001 -56189
-285231 -457874
67599 108511
367419 589801
-236...

output:

227636110

result:

ok single line: '227636110'

Test #104:

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

input:

1000
26329 -26297
-105751 105783
333129 -333097
387209 -387177
329 -297
-224571 224603
-68311 68343
291009 -290977
-337931 337963
-496011 496043
462089 -462057
429849 -429817
-130711 130743
489909 -489877
119149 -119117
-200131 200163
-506151 506183
457149 -457117
102249 -102217
261629 -261597
-3506...

output:

261614080

result:

ok single line: '261614080'

Test #105:

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

input:

1
107644 26211

output:

-1

result:

ok single line: '-1'

Test #106:

score: 15
Accepted
time: 25ms
memory: 6244kb

input:

2000
-483181 -135362
120902 24064
-412531 -99494
248281 7808
391568 85654
-434900 -137287
186379 -16165
-237918 -5538
-178979 -39463
116383 11996
118455 7143
-119819 2177
39381 -8652
286531 117200
-515476 -155072
433170 139776
-686268 -197130
113483 -803
-625355 -175486
618652 160760
-629133 -179889...

output:

3

result:

ok single line: '3'

Test #107:

score: 15
Accepted
time: 25ms
memory: 4236kb

input:

2000
-153446 -476364
-58849 -109096
-64979 -300504
-59262 -73790
72470 331460
-38560 -93304
75104 258470
69518 140774
18199 -34338
50612 295913
-134053 -452725
-112713 -282410
-32113 -126910
90947 290009
-42412 -148636
94286 466304
145398 440980
-5863 -106726
78568 151356
-14920 -148693
-5070 -22968...

output:

3

result:

ok single line: '3'

Test #108:

score: 15
Accepted
time: 25ms
memory: 6292kb

input:

2000
-561515 -300547
-272987 -170363
56834 217598
-241871 -133432
-62733 120307
17642 304180
-406136 -254349
193074 -155474
364670 -130523
-146248 -368154
275334 344334
-396350 -91744
-272100 -136797
-247541 220142
-98888 155114
452867 229039
252322 311461
-202909 306360
-341041 -275524
-91685 63458...

output:

45821

result:

ok single line: '45821'

Test #109:

score: 15
Accepted
time: 25ms
memory: 4224kb

input:

2000
-678600 -801617
-124824 -23261
504424 541290
-226632 -357875
439222 481887
146300 269633
-138228 87691
-397804 -368314
198456 209830
-245638 -450088
21860 96857
61012 -57876
-619482 -699026
437088 293827
-257724 -167618
48290 -91195
-90622 142142
211138 165957
-302988 -269759
232366 231240
4025...

output:

31542

result:

ok single line: '31542'

Test #110:

score: 15
Accepted
time: 22ms
memory: 6244kb

input:

2000
509283 -512882
48560 115371
-413913 58282
152594 50328
-214124 12026
-354159 326905
186967 -31240
-71851 207825
-232071 73747
-494950 455418
-398975 94559
-425588 103142
14494 -149572
394066 -86788
-474904 127359
110674 -202318
-305542 305850
-445681 215550
-190760 201731
-433298 308843
291511 ...

output:

9753

result:

ok single line: '9753'

Test #111:

score: 15
Accepted
time: 25ms
memory: 4276kb

input:

2000
-699722 159002
665794 -176842
295240 -513421
-265278 -7034
-58878 -97094
-345962 465692
-1168 592131
-165186 118288
139308 369517
497798 32412
96896 -658455
163562 -76494
-301552 167847
-26374 -660870
-224248 594081
194854 -555352
-28764 -375995
-5162 -681508
-100156 -332337
19228 347357
307856...

output:

63420

result:

ok single line: '63420'

Test #112:

score: 15
Accepted
time: 25ms
memory: 4216kb

input:

2000
226750 -584546
128372 -201112
197627 -489887
139449 -155797
-92337 106205
237230 -416794
-66845 43113
146162 -368286
-150867 201519
-122893 161657
119595 -233095
-143384 358972
-44369 96485
192394 -341302
-49095 -50997
-162891 162791
198384 -322028
176172 -230480
5882 -2622
207073 -304789
-2551...

output:

7192

result:

ok single line: '7192'

Test #113:

score: 15
Accepted
time: 22ms
memory: 4224kb

input:

1865
-283242 786441
-427198 177357
-860350 598221
736066 -920371
672322 -509491
-711950 -513315
99778 -435123
-190918 249653
303922 -73827
-225302 -631995
-253118 -578355
420930 317389
719682 -936755
-216254 187597
722754 -812851
-697112 -849761
693058 97485
373570 285901
-58494 -603763
341688 11854...

output:

128

result:

ok single line: '128'

Test #114:

score: 15
Accepted
time: 22ms
memory: 4220kb

input:

1866
-413422 371588
-114120 -97828
374870 397076
-760254 495172
431186 -130940
-644526 -780156
-504584 566492
-247745 300888
-505518 586884
-271278 532612
-328942 332676
742266 609828
-657054 -807228
308818 51332
783666 536580
-461294 -8316
-33205 -300280
271973 459184
647074 126916
-98482 -815628
-...

output:

8

result:

ok single line: '8'

Test #115:

score: 15
Accepted
time: 22ms
memory: 6084kb

input:

1865
-238889 499619
361919 752907
482015 -68565
-465185 639019
39647 -609237
-387669 31159
638975 -591029
-153937 1275
253247 855179
-693121 -217141
-711745 424715
267807 721771
-169557 -291401
-247073 480299
-406817 -760789
234135 -248989
661727 -126421
-266417 -792677
-655953 347131
-314337 426347...

output:

4

result:

ok single line: '4'

Test #116:

score: 15
Accepted
time: 22ms
memory: 4152kb

input:

1865
564188 721281
-396178 797173
630894 745973
410251 301047
-346962 -506763
595950 -729867
744046 -301579
95342 -218635
-326546 477685
-574338 352405
562876 565825
164974 379381
287814 -767643
-787106 -787115
736366 653813
-691090 240117
-640914 283125
-752530 -472587
183150 -675851
-727698 -36353...

output:

128

result:

ok single line: '128'

Test #117:

score: 15
Accepted
time: 22ms
memory: 6220kb

input:

1865
531480 805379
734468 -579730
-781052 -745618
448100 -741050
-575836 471638
-263324 -283002
-781052 286574
-383940 -613604
101636 433518
427332 533630
-746236 -401042
-83132 -734722
-583420 -331666
772 168686
-326396 -173202
-464124 -594706
-335776 -591563
-201596 -23730
-824060 415086
-438668 1...

output:

16

result:

ok single line: '16'

Test #118:

score: 15
Accepted
time: 16ms
memory: 4180kb

input:

1772
641287 -670370
572680 194224
-396968 510907
260959 814252
633595 499972
-642824 -702041
-475301 -636404
100432 -714434
281971 387409
-492821 -425912
367264 -321179
-317267 525190
241876 -747644
-250280 -184856
916564 520303
183556 92164
793090 943069
338752 792733
908182 262750
-186047 288994
-...

output:

81

result:

ok single line: '81'

Test #119:

score: 15
Accepted
time: 22ms
memory: 4120kb

input:

1848
-506289 16332
-367281 -154164
111695 -70708
-348337 403916
188847 -106612
719655 291772
-232721 913420
370895 -532276
651407 137804
120655 -280116
-609425 7436
509775 104908
-159921 -529972
424015 -175156
-773293 -572620
-78019 -144520
-562353 803276
-188033 298668
-12535 84272
-691937 -389908
...

output:

32

result:

ok single line: '32'

Test #120:

score: 15
Accepted
time: 21ms
memory: 4184kb

input:

1794
-739390 -567358
-191476 584291
315584 -823165
439433 152480
-523621 662672
-348313 570098
946817 -542986
498482 34382
-662815 -733255
-466279 -200527
-478891 -730987
485360 73748
-177976 155234
-589429 -316996
-547309 7166
285128 392321
-434107 -214828
763352 -314080
281246 -663208
530915 13763...

output:

9

result:

ok single line: '9'

Test #121:

score: 15
Accepted
time: 20ms
memory: 4196kb

input:

1771
653319 840369
770688 -717747
-383481 725943
-836001 -602205
112383 876741
-240921 -685833
-333342 932277
-201717 476949
323082 885567
808596 37011
187488 -587742
-573588 -638043
251658 695376
-437355 -663948
-109809 -164337
-663255 410259
649800 892674
-13959 -128796
738774 -254616
-844776 9606...

output:

81

result:

ok single line: '81'

Test #122:

score: 15
Accepted
time: 20ms
memory: 4064kb

input:

1793
-253678 591131
-354739 601418
-814630 882407
135122 779942
689648 665489
-835177 545933
218957 -11752
-332167 -720340
785064 -287698
838688 898283
393539 801407
713219 585299
120542 106346
696452 672779
301307 341732
-45666 -561865
-425455 -226573
36707 602795
-745369 -99133
5063 222095
-465853...

output:

3

result:

ok single line: '3'

Test #123:

score: 15
Accepted
time: 16ms
memory: 4196kb

input:

1778
764495 -682617
-26020 -268572
784583 703698
-775153 -65883
-509581 321378
626714 380265
-815248 509298
-588490 -800625
403937 589893
-536770 334338
246581 743064
277073 351132
651500 -752601
182753 -144615
-800884 391038
-213418 58533
-774739 137454
266879 -200469
102806 -229179
-747451 -192729...

output:

27

result:

ok single line: '27'

Test #124:

score: 15
Accepted
time: 20ms
memory: 4260kb

input:

1771
-49615 -880989
842681 634602
323633 -806631
-462958 418089
471593 -394908
-835153 -393531
50258 505569
-436774 -447675
59735 -47742
-612805 739758
186581 595236
122429 466203
-293101 -314556
245630 122844
456866 -918645
306866 195015
344045 -526695
433550 -483927
-82420 -605427
-830374 162210
4...

output:

243

result:

ok single line: '243'

Test #125:

score: 15
Accepted
time: 16ms
memory: 4192kb

input:

1745
960793 447774
811456 392991
20248 -501978
-132176 917691
223153 -357150
-330401 832821
592594 130713
640627 904992
-345386 -709338
259846 -26427
872935 -88392
-353000 -148413
461266 387429
217078 836466
-388640 -600474
46492 -272343
-546293 209634
766501 726630
155113 111111
-29567 -603066
5334...

output:

81

result:

ok single line: '81'

Test #126:

score: 15
Accepted
time: 21ms
memory: 4248kb

input:

1849
-600539 185762
70597 -279078
-318523 -865830
-13371 378842
-136891 833018
-715835 -262694
-532331 -379786
-310331 -859686
-646203 461274
-563643 -72774
-270619 59442
164421 -739142
71997 -481516
611781 675674
-35899 345562
-164539 -547590
222149 342490
-379963 497114
-202491 635338
811973 37525...

output:

128

result:

ok single line: '128'

Test #127:

score: 15
Accepted
time: 20ms
memory: 6072kb

input:

1745
869905 649804
-716318 -197978
-685052 343624
-227024 -166853
129241 -195431
-50282 -157925
603847 -283166
-564767 -51008
856945 115375
226927 883084
-535688 806494
121951 175225
-150695 631012
693487 -557744
196309 -461435
-468539 -165947
285976 49837
711010 541819
-319283 -484517
476245 522958...

output:

243

result:

ok single line: '243'

Test #128:

score: 15
Accepted
time: 1ms
memory: 3936kb

input:

3
-65500 1000000
1000000 585378
-1000000 -1000000

output:

2518464259000

result:

ok single line: '2518464259000'

Test #129:

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

input:

3
1000000 246017
-153000 1000000
-1000000 -1000000

output:

2944623601000

result:

ok single line: '2944623601000'

Test #130:

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

input:

3
-1000000 -1000000
834381 1000000
1000000 570721

output:

1118699241299

result:

ok single line: '1118699241299'

Test #131:

score: 15
Accepted
time: 25ms
memory: 4080kb

input:

2000
-301976 21673
151074 262495
699032 241939
-519994 -248624
-439396 -174407
-570166 -260090
251052 167482
-83402 61780
402930 228478
798238 257206
568120 258283
400524 295972
-62714 -116120
-864074 -273371
195422 -17258
-181692 76132
705540 263905
335954 302413
397804 91768
520350 182197
-777196 ...

output:

21162

result:

ok single line: '21162'

Test #132:

score: 15
Accepted
time: 25ms
memory: 4144kb

input:

2000
-401242 316210
-313594 -437773
315782 39399
120499 -489558
-71022 -92404
-217267 -152301
-164236 -477770
-329522 -196977
12479 689981
-363391 367433
197070 -119691
-817537 84947
-406544 347682
458551 76417
422856 67095
-289295 74178
314671 140684
305882 -284407
386402 248504
-385633 63911
41352...

output:

40403

result:

ok single line: '40403'

Test #133:

score: 15
Accepted
time: 25ms
memory: 4140kb

input:

2000
-431246 55797
525944 105440
-55672 -84177
48672 -218589
746644 26351
203114 218717
13692 -141634
-328552 170720
-300522 232202
277728 -237223
431172 -202668
-30578 -90530
-406472 -122995
385300 -34520
25212 70373
-400198 134191
63342 -333799
556122 -83846
-97140 -89674
-475880 91137
-379590 226...

output:

31474

result:

ok single line: '31474'

Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%