QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#241329#7680. Subwayucup-team987#AC ✓1ms3948kbC++206.4kb2023-11-06 02:25:212023-11-06 02:25:21

Judging History

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

  • [2023-11-06 02:25:21]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3948kb
  • [2023-11-06 02:25:21]
  • 提交

answer

#include<iostream>
#include<cassert>
using namespace std;
#include<iostream>
#include<algorithm>
#include<vector>
using Int=long long;
int sign(Int a){return a>0?1:a<0?-1:0;}
Int sqr(Int a){return a*a;}
struct Rational{
	Int a,b;
	Rational(Int a_=0):a(a_),b(1){}
	Rational(Int a_,Int b_){
		Int g=a_,h=b_;
		while(h){
			Int t=g%h;
			g=h;
			h=t;
		}
		a=a_/g;
		b=b_/g;
		if(b<0)a=-a,b=-b;
	}
	bool operator<(const Rational&r)const{return a*r.b<r.a*b;}
	bool operator==(const Rational&r)const{return a==r.a&&b==r.b;}
};
struct Point{
	Int x,y;
	Point(Int x_=0,Int y_=0):x(x_),y(y_){}
	Point operator-()const{return Point(-x,-y);}
	Point operator+(const Point&p)const{return Point(x+p.x,y+p.y);}
	Point operator-(const Point&p)const{return Point(x-p.x,y-p.y);}
	Point operator*(const Int k)const{return Point(x*k,y*k);}
	bool operator<(const Point&p)const{return x==p.x?y<p.y:x<p.x;}
	bool operator==(const Point&p)const{return x==p.x&&y==p.y;}
};
istream&operator>>(istream&is,Point&p){return is>>p.x>>p.y;}
ostream&operator<<(ostream&os,const Point&p){return os<<p.x<<' '<<p.y;}
struct Line{
	Point p1,p2;
	Line(Point p1_=Point(),Point p2_=Point()):p1(p1_),p2(p2_){}
};
struct Segment:Line{
	Segment(Point p1_=Point(),Point p2_=Point()):Line(p1_,p2_){}
};
struct Circle{
	Point o;
	Int r;
	Circle(Point o_=Point(),Int r_=0):o(o_),r(r_){}
};
using Polygon=vector<Point>;
//function list begin
Point vec(const Line&);
Int norm(const Point&);
Int norm(const Line&);
int argtype(const Point&);//(-pi,0]->-1,(0,pi]->1,(0,0)->0
bool argless(const Point&,const Point&);//sorting points with arg
Int dot(const Point&,const Point&);
Int cross(const Point&,const Point&);
enum{ONLINE_FRONT=-2,CLOCKWISE=-1,ON_SEGMENT=0,COUNTER_CLOCKWISE=1,ONLINE_BACK=2};
int ccw(const Point&,const Point&);
int ccw(const Point&,const Point&,const Point&);
int ccw(const Line&,const Point&);
bool orthogonal(const Point&,const Point&);
bool orthogonal(const Line&,const Line&);
bool parallel(const Point&,const Point&);
bool parallel(const Line&,const Line&);
bool intersect(const Line&,const Point&);
bool intersect(const Line&,const Line&);
bool intersect(const Segment&,const Point&);
bool intersect(const Segment&,const Segment&);
bool intersect(const Line&,const Segment&);
bool intersect(const Segment&,const Line&);
bool intersect(const Circle&,const Point&);
int intersect(const Circle&,const Line&);//overflow, count contacts
int intersect(const Circle&,const Segment&);//overflow, count contacts
bool intersect(const Circle&,const Circle&);
int count_tangent(const Circle&,const Circle&);//count common tangents
Int distance2(const Point&,const Point&);
Rational distance2(const Line&,const Point&);
Rational distance2(const Line&,const Line&);
Rational distance2(const Segment&,const Point&);
Rational distance2(const Segment&,const Segment&);
Rational distance2(const Line&,const Segment&);
Rational distance2(const Segment&,const Line&);
bool is_convex(const Polygon&);
Polygon convex_hull(Polygon,bool=false);
enum{OUT,ON,IN};
int contain(const Polygon&,const Point&);
int contain(const Circle&,const Point&);
int contain(const Circle&,const Segment&);
int convex_contain(const Polygon&,const Point&);//O(log |P|)
Int diameter2(Polygon P);
//function list end
Point vec(const Line&s){return s.p2-s.p1;}
Int norm(const Point&p){return p.x*p.x+p.y*p.y;}
Int norm(const Line&s){return norm(vec(s));}
Int dot(const Point&a,const Point&b){return a.x*b.x+a.y*b.y;}
Int cross(const Point&a,const Point&b){return a.x*b.y-a.y*b.x;}
int ccw(const Point&a,const Point&b)
{
	Int crs=cross(a,b);
	return crs>0?COUNTER_CLOCKWISE
		:crs<0?CLOCKWISE
		:dot(a,b)<0?ONLINE_BACK
		:norm(a)<norm(b)?ONLINE_FRONT
		:ON_SEGMENT;
}
int ccw(const Point&a,const Point&b,const Point&c){return ccw(b-a,c-a);}
int ccw(const Line&s,const Point&p){return ccw(s.p1,s.p2,p);}
bool intersect(const Segment&s,const Segment&t){
	return ccw(s,t.p1)*ccw(s,t.p2)<=0&&ccw(t,s.p1)*ccw(t,s.p2)<=0;
}
int N;
int X[50],Y[50],A[50],K[50];
const int a=10000,b=3;
vector<Point>L[50];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin>>N;
	int maxa=0;
	for(int i=0;i<N;i++)
	{
		cin>>X[i]>>Y[i]>>A[i];
		maxa=max(maxa,A[i]);
		K[i]=a*X[i]+b*Y[i];
	}
	vector<int>k(K,K+N);
	sort(k.begin(),k.end());
	vector<int>mid;
	mid.reserve(N+1);
	mid.push_back(k[0]-1);
	for(int i=1;i<N;i++)assert(k[i-1]+1<k[i]);
	for(int i=0;i<N;i++)
	{
		mid.push_back(k[i]+1);
	}
	for(int i=0;i<mid.size();i++)
	{
		{
			int X=2000;
			for(int x=0;x<maxa;x++)
			{
				//a*X+b*Y==mid[i]
				while((mid[i]-a*X)%b!=0)X++;
				int Y=(mid[i]-a*X)/b;
				L[x].push_back(Point(X,Y));
				X++;
			}
		}
		if(i<k.size())
		{
			int id=0;
			while(K[id]!=k[i])id++;
			for(int x=0;x<A[id];x++)
			{
				L[x].push_back(Point(X[id],Y[id]));
			}
		}
	}
	if(false)
	{//check
		for(int i=0;i<N;i++)
		{
			int cnt=0;
			for(int j=0;j<maxa;j++)
			{
				bool fn=false;
				for(Point p:L[j])if(p==Point(X[i],Y[i]))fn=true;
				if(fn)cnt++;
			}
			assert(cnt==A[i]);
		}
		for(int i=0;i<maxa;i++)
		{
			assert(L[i].size()>=2);
			for(int j=0;j<L[i].size();j++)
			{
				assert(abs(L[i][j].x)<=(int)1e9);
				assert(abs(L[i][j].y)<=(int)1e9);
			}
			for(int j=0;j+1<L[i].size();j++)
			{
				Segment s(L[i][j],L[i][j+1]);
				for(int k=0;k+1<L[i].size();k++)
				{
					if(abs(j-k)<=1)continue;
					Segment t(L[i][k],L[i][k+1]);
					if(intersect(s,t))
					{
						Point p;
						int c=0;
						if(s.p1==t.p1)p=s.p1,c++;
						if(s.p1==t.p2)p=s.p1,c++;
						if(s.p2==t.p1)p=s.p2,c++;
						if(s.p2==t.p2)p=s.p2,c++;
						assert(c==1);
						bool fn=false;
						for(int i=0;i<N;i++)if(p==Point(X[i],Y[i]))fn=true;
						assert(fn);
					}
				}
				for(int k=0;k<maxa;k++)if(k!=i)
				{
					for(int l=0;l+1<L[k].size();l++)
					{
						Segment t(L[k][l],L[k][l+1]);
						if(intersect(s,t))
						{
							Point p;
							int c=0;
							if(s.p1==t.p1)p=s.p1,c++;
							if(s.p1==t.p2)p=s.p1,c++;
							if(s.p2==t.p1)p=s.p2,c++;
							if(s.p2==t.p2)p=s.p2,c++;
							assert(c==1);
							bool fn=false;
							for(int i=0;i<N;i++)if(p==Point(X[i],Y[i]))fn=true;
							assert(fn);
						}
					}
				}
			}
		}
	}
	cout<<maxa<<"\n";
	for(int i=0;i<maxa;i++)
	{
		cout<<L[i].size();
		for(Point p:L[i])cout<<" "<<p.x<<" "<<p.y;
		cout<<"\n";
	}
}

这程序好像有点Bug,我给组数据试试?

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3600kb

input:

3
1 2 1
2 1 2
3 3 2

output:

2
7 2001 -6666665 1 2 2000 -6663331 2 1 2001 -6663332 3 3 2002 -6663330
6 2004 -6676665 2003 -6673331 2 1 2004 -6673332 3 3 2005 -6673330

result:

ok ok Sum L = 13

Test #2:

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

input:

1
1 1 1

output:

1
3 2001 -6666666 1 1 2000 -6663332

result:

ok ok Sum L = 3

Test #3:

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

input:

1
1 1 50

output:

50
3 2001 -6666666 1 1 2000 -6663332
3 2004 -6676666 1 1 2003 -6673332
3 2007 -6686666 1 1 2006 -6683332
3 2010 -6696666 1 1 2009 -6693332
3 2013 -6706666 1 1 2012 -6703332
3 2016 -6716666 1 1 2015 -6713332
3 2019 -6726666 1 1 2018 -6723332
3 2022 -6736666 1 1 2021 -6733332
3 2025 -6746666 1 1 2024 ...

result:

ok ok Sum L = 150

Test #4:

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

input:

50
662 -567 48
728 -120 7
307 669 27
-885 -775 21
100 242 9
-784 -537 41
940 198 46
736 -551 30
-449 456 16
-945 382 18
-182 810 49
213 187 44
853 245 48
617 -305 19
-81 261 3
617 208 8
-548 -652 6
-888 -667 14
-371 -812 43
202 -702 10
-668 -725 5
961 -919 33
-870 -697 50
428 810 29
560 405 7
348 -3...

output:

50
101 2000 -9936860 -981 -193 2002 -9943526 -945 382 2002 -9822951 -926 671 2000 -9752662 -888 -667 2002 -9634000 -885 -775 2002 -9624108 -870 -697 2002 -9574030 -825 381 2002 -9422952 -784 -537 2001 -9283870 -683 731 2000 -8942602 -668 -725 2000 -8894058 -579 -437 2002 -8603770 -558 825 2002 -8532...

result:

ok ok Sum L = 3743

Test #5:

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

input:

50
-772 697 1
-756 -909 1
659 923 1
850 471 1
260 -24 1
473 -639 1
-575 393 1
-466 197 1
333 -637 1
-192 -890 1
103 546 1
749 -723 1
-573 613 1
214 -138 1
277 928 1
266 291 1
911 275 1
-680 -67 1
69 190 1
-197 -795 1
684 618 1
729 -115 1
-658 -229 1
-595 -470 1
898 -172 1
401 81 1
133 685 1
223 400 ...

output:

1
101 2002 -9245970 -772 697 2001 -9242636 -756 -909 2002 -9194242 -680 -67 2000 -8933400 -666 -82 2002 -8893415 -658 -229 2001 -8863562 -595 -470 2001 -8653803 -575 393 2000 -8582940 -573 613 2002 -8582720 -571 -716 2001 -8574049 -532 838 2001 -8442495 -530 890 2000 -8432443 -466 197 2001 -8223136 ...

result:

ok ok Sum L = 101

Test #6:

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

input:

50
-56 747 3
993 -490 4
930 -139 1
-298 -330 1
938 -351 5
-973 100 5
-472 44 4
345 628 5
481 -91 4
789 581 5
457 -29 4
871 -799 1
692 994 4
699 854 2
893 -33 1
-483 256 3
-962 -540 2
846 -893 1
830 609 5
845 -383 2
-552 -966 1
-544 -51 1
564 186 4
-615 -675 1
618 -911 3
-561 -302 4
-293 667 3
-334 -...

output:

5
101 2000 -9996337 -999 330 2002 -10003003 -973 100 2001 -9913233 -962 -540 2000 -9873873 -888 -613 2002 -9633946 -842 381 2000 -9472952 -792 -625 2002 -9313958 -637 -801 2001 -8794134 -615 -675 2002 -8724008 -561 -302 2002 -8543635 -552 -966 2002 -8514299 -544 -51 2001 -8483384 -483 256 2002 -8283...

result:

ok ok Sum L = 396

Test #7:

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

input:

50
600 997 5
-893 -204 3
408 443 1
-560 -748 7
-647 161 6
-285 -980 1
87 -582 7
-48 -721 7
997 285 2
-189 -728 8
525 222 4
-324 816 9
760 317 3
753 -480 10
-813 -921 3
-325 -875 8
-747 816 10
-627 605 7
775 786 6
136 -54 2
274 948 10
216 -113 7
924 68 3
101 576 8
60 -501 2
898 801 8
-767 -974 10
-99...

output:

10
101 2002 -9946879 -982 -212 2001 -9943545 -980 753 2000 -9932580 -972 -312 2002 -9913645 -893 -204 2000 -9643537 -813 -921 2002 -9384254 -805 -304 2001 -9353637 -767 -974 2000 -9224307 -747 816 2002 -9162517 -660 -335 2002 -8873668 -647 161 2000 -8823172 -627 605 2002 -8762728 -560 -748 2000 -853...

result:

ok ok Sum L = 791

Test #8:

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

input:

50
24 -889 49
117 418 49
25 524 44
980 -416 43
-494 357 41
-287 -285 46
151 574 41
-289 68 49
-515 -540 41
-367 -178 47
-887 151 45
197 -272 47
714 724 45
-737 94 49
810 830 47
808 -695 41
537 -637 49
-142 -167 44
-749 -631 47
445 -444 42
801 910 43
59 363 42
-912 466 50
-649 -479 48
-958 -511 49
88...

output:

50
101 2001 -9996324 -998 343 2000 -9992990 -958 -511 2001 -9863844 -912 466 2002 -9712867 -887 151 2000 -9623182 -868 -114 2001 -9563447 -786 -384 2002 -9293717 -749 -631 2000 -9163964 -737 94 2000 -9123239 -649 -479 2001 -8833812 -615 809 2002 -8722524 -588 -138 2002 -8633471 -515 -540 2000 -83838...

result:

ok ok Sum L = 4818

Test #9:

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

input:

50
151 -171 50
-367 -951 50
808 569 50
150 -618 50
27 -476 50
-846 729 50
549 -456 50
50 646 50
294 -70 50
-571 104 50
128 -265 50
913 -700 50
267 -965 50
896 846 50
-2 713 50
21 679 50
-515 975 50
168 180 50
-369 -98 50
676 115 50
643 -779 50
920 -237 50
-324 450 50
149 -378 50
-882 -602 50
-126 -7...

output:

50
101 2000 -9607269 -882 -602 2002 -9613935 -851 279 2000 -9503054 -846 729 2002 -9492604 -841 601 2001 -9472732 -604 -168 2001 -8683501 -571 104 2001 -8573229 -544 307 2001 -8483026 -515 975 2000 -8382358 -501 927 2002 -8342406 -474 780 2002 -8252553 -369 -98 2002 -7903431 -367 -951 2001 -7894284 ...

result:

ok ok Sum L = 5050

Test #10:

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

input:

50
4 5 34
1 -5 24
-4 -4 32
-3 3 28
0 -1 21
1 -4 25
0 0 30
0 -4 42
-3 -2 44
-5 -3 37
4 -1 46
5 2 20
2 2 37
-2 5 35
-2 -1 39
2 4 32
-4 -3 42
0 3 32
3 5 47
-4 1 2
5 -1 17
-5 -4 5
-2 2 29
-5 1 11
2 -5 43
4 4 14
-5 0 9
0 -5 17
5 1 27
-3 0 24
-1 4 16
5 0 50
3 -2 18
1 -2 6
2 -1 29
-1 3 38
1 5 36
-3 1 28
-3...

output:

50
101 2001 -6686671 -5 -4 2000 -6683337 -5 -3 2000 -6683336 -5 0 2000 -6683333 -5 1 2000 -6683332 -4 -4 2001 -6683337 -4 -3 2001 -6683336 -4 1 2001 -6683332 -3 -3 2002 -6683336 -3 -2 2002 -6683335 -3 -1 2002 -6683334 -3 0 2002 -6683333 -3 1 2002 -6683332 -3 3 2002 -6683330 -3 5 2002 -6683328 -2 -5 ...

result:

ok ok Sum L = 3974

Test #11:

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

input:

50
2 0 2
2 -3 2
4 1 2
-3 -3 2
-5 1 2
5 3 2
-5 -3 2
-3 -2 2
2 -1 2
2 3 2
4 4 1
1 -4 1
5 -1 2
-4 1 2
3 -2 1
-1 2 2
5 -5 2
-2 1 2
-5 -1 2
-2 -1 2
-1 -2 2
5 5 1
0 -2 2
1 1 1
2 2 2
3 5 2
-2 -4 1
-3 5 1
4 2 2
-4 -4 2
-3 2 1
5 0 2
-2 -2 2
-4 4 1
-2 5 2
2 5 1
3 -5 2
-4 5 2
-5 5 2
-2 4 2
-5 -5 2
-2 2 2
-3 -4...

output:

2
101 2001 -6686672 -5 -5 2000 -6683338 -5 -3 2000 -6683336 -5 -1 2000 -6683334 -5 1 2000 -6683332 -5 5 2000 -6683328 -4 -4 2001 -6683337 -4 1 2001 -6683332 -4 4 2001 -6683329 -4 5 2001 -6683328 -3 -4 2002 -6683337 -3 -3 2002 -6683336 -3 -2 2002 -6683335 -3 0 2002 -6683333 -3 2 2002 -6683331 -3 5 20...

result:

ok ok Sum L = 188

Test #12:

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

input:

50
4 3 49
-5 -3 49
0 -3 50
-2 -4 49
-5 -5 50
4 0 49
-1 -2 49
-2 0 49
1 2 50
-1 -5 50
-5 -1 50
-5 5 49
2 0 50
-2 -3 50
-4 -5 50
0 -2 50
-5 4 50
-1 1 49
-1 -4 49
-3 -1 49
1 -3 50
-4 1 50
0 5 50
1 -2 50
-1 5 50
4 2 50
4 -3 49
1 -4 49
-1 -1 49
-3 -5 50
4 -4 50
3 2 49
3 -3 49
0 2 50
-3 -4 49
5 -1 49
-3 5...

output:

50
101 2001 -6686672 -5 -5 2000 -6683338 -5 -3 2000 -6683336 -5 -1 2000 -6683334 -5 4 2000 -6683329 -5 5 2000 -6683328 -4 -5 2001 -6683338 -4 1 2001 -6683332 -4 4 2001 -6683329 -3 -5 2002 -6683338 -3 -4 2002 -6683337 -3 -1 2002 -6683334 -3 5 2002 -6683328 -2 -4 2000 -6673337 -2 -3 2000 -6673336 -2 0...

result:

ok ok Sum L = 5027

Test #13:

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

input:

50
114 514 30
115 514 41
116 514 6
117 514 49
118 514 10
119 514 49
120 514 1
121 514 7
122 514 3
123 514 4
124 514 1
125 514 12
126 514 15
127 514 16
128 514 34
129 514 24
130 514 49
131 514 43
132 514 25
133 514 12
134 514 26
135 514 13
136 514 12
137 514 15
138 514 7
139 514 25
140 514 5
141 514 ...

output:

49
101 2000 -6286153 114 514 2002 -6292819 115 514 2000 -6282819 116 514 2001 -6282819 117 514 2002 -6282819 118 514 2000 -6272819 119 514 2001 -6272819 120 514 2002 -6272819 121 514 2000 -6262819 122 514 2001 -6262819 123 514 2002 -6262819 124 514 2000 -6252819 125 514 2001 -6252819 126 514 2002 -6...

result:

ok ok Sum L = 3651

Test #14:

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

input:

50
191 981 19
191 980 41
191 979 20
191 978 14
191 977 2
191 976 49
191 975 40
191 974 3
191 973 20
191 972 6
191 971 13
191 970 4
191 969 4
191 968 47
191 967 32
191 966 11
191 965 34
191 964 30
191 963 3
191 962 16
191 961 24
191 960 30
191 959 34
191 958 31
191 957 24
191 956 29
191 955 42
191 95...

output:

49
101 2002 -6035735 191 932 2001 -6032401 191 933 2001 -6032400 191 934 2001 -6032399 191 935 2001 -6032398 191 936 2001 -6032397 191 937 2001 -6032396 191 938 2001 -6032395 191 939 2001 -6032394 191 940 2001 -6032393 191 941 2001 -6032392 191 942 2001 -6032391 191 943 2001 -6032390 191 944 2001 -6...

result:

ok ok Sum L = 3651

Test #15:

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

input:

50
-123 456 47
-122 457 35
-121 458 25
-120 459 35
-119 460 30
-118 461 33
-117 462 21
-116 463 31
-115 464 21
-114 465 35
-113 466 20
-112 467 17
-111 468 25
-110 469 3
-109 470 29
-108 471 35
-107 472 4
-106 473 44
-105 474 4
-104 475 28
-103 476 49
-102 477 9
-101 478 39
-100 479 9
-99 480 21
-98...

output:

50
101 2000 -7076211 -123 456 2002 -7082877 -122 457 2000 -7072876 -121 458 2001 -7072875 -120 459 2002 -7072874 -119 460 2000 -7062873 -118 461 2001 -7062872 -117 462 2002 -7062871 -116 463 2000 -7052870 -115 464 2001 -7052869 -114 465 2002 -7052868 -113 466 2000 -7042867 -112 467 2001 -7042866 -11...

result:

ok ok Sum L = 3756

Test #16:

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

input:

50
321 -525 46
322 -526 14
323 -527 16
324 -528 38
325 -529 22
326 -530 24
327 -531 48
328 -532 5
329 -533 7
330 -534 30
331 -535 25
332 -536 2
333 -537 13
334 -538 1
335 -539 33
336 -540 8
337 -541 9
338 -542 2
339 -543 29
340 -544 17
341 -545 41
342 -546 39
343 -547 9
344 -548 47
345 -549 47
346 -...

output:

50
101 2000 -5597192 321 -525 2002 -5603858 322 -526 2000 -5593859 323 -527 2001 -5593860 324 -528 2002 -5593861 325 -529 2000 -5583862 326 -530 2001 -5583863 327 -531 2002 -5583864 328 -532 2000 -5573865 329 -533 2001 -5573866 330 -534 2002 -5573867 331 -535 2000 -5563868 332 -536 2001 -5563869 333...

result:

ok ok Sum L = 3762

Test #17:

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

input:

50
-444 -555 23
-445 -556 32
-446 -557 36
-447 -558 29
-448 -559 4
-449 -560 25
-450 -561 29
-451 -562 5
-452 -563 9
-453 -564 28
-454 -565 35
-455 -566 26
-456 -567 22
-457 -568 39
-458 -569 13
-459 -570 50
-460 -571 37
-461 -572 14
-462 -573 26
-463 -574 49
-464 -575 23
-465 -576 44
-466 -577 2
-4...

output:

50
101 2002 -8317271 -493 -604 2001 -8313937 -492 -603 2002 -8313936 -491 -602 2000 -8303935 -490 -601 2001 -8303934 -489 -600 2002 -8303933 -488 -599 2000 -8293932 -487 -598 2001 -8293931 -486 -597 2002 -8293930 -485 -596 2000 -8283929 -484 -595 2001 -8283928 -483 -594 2002 -8283927 -482 -593 2000 ...

result:

ok ok Sum L = 3711

Test #18:

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

input:

50
-142 0 48
-143 1 22
-144 2 45
-145 3 9
-146 4 36
-147 5 46
-148 6 26
-149 7 26
-150 8 9
-151 9 19
-152 10 22
-153 11 14
-154 12 8
-155 13 20
-156 14 41
-157 15 47
-158 16 22
-159 17 50
-160 18 3
-161 19 12
-162 20 15
-163 21 32
-164 22 46
-165 23 45
-166 24 3
-167 25 27
-168 26 33
-169 27 17
-170...

output:

50
101 2001 -7306618 -191 49 2000 -7303284 -190 48 2001 -7303285 -189 47 2002 -7303286 -188 46 2000 -7293287 -187 45 2001 -7293288 -186 44 2002 -7293289 -185 43 2000 -7283290 -184 42 2001 -7283291 -183 41 2002 -7283292 -182 40 2000 -7273293 -181 39 2001 -7273294 -180 38 2002 -7273295 -179 37 2000 -7...

result:

ok ok Sum L = 3861

Test #19:

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

input:

12
1000 1000 50
1000 -1000 50
1000 999 50
999 1000 50
999 -1000 50
-999 1000 50
1000 -999 50
-999 -1000 50
-1000 1000 50
-1000 -1000 50
-1000 -999 50
-1000 999 50

output:

50
25 2002 -10007667 -1000 -1000 2001 -10004333 -1000 -999 2001 -10004332 -1000 999 2001 -10002334 -1000 1000 2001 -10002333 -999 -1000 2002 -10004333 -999 1000 2002 -10002333 999 -1000 2002 -3344333 999 1000 2002 -3342333 1000 -1000 2000 -3334333 1000 -999 2000 -3334332 1000 999 2000 -3332334 1000 ...

result:

ok ok Sum L = 1250

Test #20:

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

input:

4
1000 1000 50
1000 -1000 50
-1000 1000 50
-1000 -1000 50

output:

50
9 2002 -10007667 -1000 -1000 2001 -10004333 -1000 1000 2001 -10002333 1000 -1000 2000 -3334333 1000 1000 2000 -3332333
9 2005 -10017667 -1000 -1000 2004 -10014333 -1000 1000 2004 -10012333 1000 -1000 2003 -3344333 1000 1000 2003 -3342333
9 2008 -10027667 -1000 -1000 2007 -10024333 -1000 1000 2007...

result:

ok ok Sum L = 450

Extra Test:

score: 0
Extra Test Passed