QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#55504#4865. Symmetry: ConvexJunoWA 194ms34484kbC++173.9kb2022-10-14 10:25:482022-10-14 10:25:49

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-14 10:25:49]
  • 评测
  • 测评结果:WA
  • 用时:194ms
  • 内存:34484kb
  • [2022-10-14 10:25:48]
  • 提交

answer

#include <bits/stdc++.h>
#define sz(x) ((int)x.size())
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define fi first
#define se second
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;

#ifdef LOCAL
#define dmp(...) _dmp(#__VA_ARGS__, __VA_ARGS__)
#else
#define dmp(...) (__VA_ARGS__)
#endif
template<class T> using vt=vector<T>;
template<class T> using vvt=vt<vt<T>>;
template<class TA,class TB> void chmax(TA&a,TB b){if(a<b)a=b;}
template<class TA,class TB> void chmin(TA&a,TB b){if(b<a)a=b;}
template<class TA,class TB>
ostream& operator<<(ostream& os,const pair<TA,TB>& p){
	return os<<"{"<<p.fi<<","<<p.se<<"}";
}
template<class T> ostream& operator<<(ostream& os,const vt<T>& v){
	os<<"{";for(auto& e:v)os<<e<<",";return os<<"}";
}
template<class TH> void _dmp(const char *sdbg, TH h){cout<<sdbg<<"="<<h<<endl;}
template<class TH, class... TA> void _dmp(const char *sdbg, TH h, TA...a){
while(*sdbg!=',')cout<<*sdbg++;cout<<"="<<h<<","; _dmp(sdbg+1, a...);
}

const ll INF=9e18;

struct point {
	using T=ll;
	T x,y;
	point(){}
	point(T x,T y):x(x),y(y){}
	bool operator==(point b)const{return x==b.x&&y==b.y;}
	point operator+(point b)const{return point(x+b.x,y+b.y);}
	point operator-(point b)const{return point(x-b.x,y-b.y);}
	T operator*(point b)const{return x*b.x+y*b.y;}
	T operator/(point b)const{return x*b.y-y*b.x;}
	bool operator<(point b)const{return y==b.y?x<b.x:y<b.y;}
	inline int sgn(){return y<0||(y==0&&x<0);}
	inline ll norm(){return x*x+y*y;}
};

int n;
point v[300010];

pll a[600010];
int pr[600010];

vector<pair<pll,ll>> ans;

void manacher() {
	int len=2*n+1;
	int p=-1,r=-1;
	for(int i=0;i<len;i++) {
		if(i<=r)pr[i]=min(pr[2*p-i],r-i);
		else pr[i]=0;
		while(i-pr[i]-1>=0&&i+pr[i]+1<len&&a[i-pr[i]-1]==a[i+pr[i]+1])pr[i]++;
		if(r<i+pr[i])r=i+pr[i],p=i;
	}
}

bool is_palindrome(int l,int r) {
	int m=(l+r)/2;
	m=m*2+1;
	if((r-l)%2)m++;
	return m-pr[m]<=2*l+1;
}

void add_perpen_line(int i,int j) {
	point d=v[i]-v[j];
	ll a=2*d.x;
	ll b=2*d.y;
	ll c=-(v[i].x*v[i].x-v[j].x*v[j].x)-(v[i].y*v[i].y-v[j].y*v[j].y);
	ans.pb({{a,b},c});
}

void add_line(int i,int j) {
	point d=v[i]-v[j];
	d.y=-d.y;
	swap(d.x,d.y);
	ll a=d.x;
	ll b=d.y;
	ll c=v[i].x*v[j].y-v[j].x*v[i].y;
	ans.pb({{a,b},c});
}

bool has_equal_sides(int i) {
	int j=(i-1+n)%n;
	int k=(i+1)%n;
	return (v[j]-v[i]).norm()==(v[k]-v[i]).norm();
}

pll get_prod(int i,int j,int k) {
	return {(v[k]-v[j])*(v[i]-v[j]),(v[k]-v[j])/(v[i]-v[j])};
}

void MAIN() {
	cin>>n;
	for(int i=0;i<n;i++) {
		cin>>v[i].x>>v[i].y;
	}
	v[n]=v[0];

	for(int i=0;i<n;i++) {
		int j=(i-1+n)%n;
		int k=(i+1)%n;
		a[2*i]={INF,INF};
		a[2*i+1]=get_prod(j,i,k);
	}
	a[2*n]={INF,INF};

	manacher();

	map<pll,vector<int>> mp;
	pll a1=get_prod(0,1,2);
	mp[a1]={1};

	for(int i=2;i<n;i++) {
		ans.clear();
		pll a0=get_prod(i,0,1);
		pll ai=get_prod(i-1,i,0);
		if(mp.count(a0)) {
			vector<int>& lst=mp[a0];
			for(int j:lst) {
				pll ak;
				if(j+1==i)ak=get_prod(j,j+1,0);
				else ak=get_prod(j,j+1,j+2);
				if(ai==ak&&(j==1||is_palindrome(1,j-1))&&(i<=j+2||is_palindrome(j+2,i-1))) {
					if(j%2||has_equal_sides(j/2)) {
						add_perpen_line(0,j);
					}
				}
			}
		}
		if(ai==a0&&is_palindrome(1,i-1)) {
			add_perpen_line(0,i);
		}
		if(ai==a1&&(i==2||is_palindrome(2,i-1))&&(v[i]-v[0]).norm()==(v[1]-v[0]).norm()) {
			if(i%2)add_line(0,(i+1)/2);
			else add_perpen_line(i/2,i/2+1);
		}
		cout<<sz(ans)<<'\n';
		for(auto& it:ans) {
			cout<<it.fi.fi<<' '<<it.fi.se<<' '<<it.se<<'\n';
		}

		pll p=get_prod(i-1,i,i+1);
		if(!mp.count(p)) {
			mp[p]={i};
		} else {
			mp[p].pb(i);
		}
	}
}

int main() {
	ios::sync_with_stdio(false);cin.tie(0);

	int T;cin>>T;
	for(int tt=1;tt<=T;tt++) {
		MAIN();
	}
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 3ms
memory: 7760kb

input:

3
4
0 0
1 0
1 1
0 1
3
0 0
3 0
1 1
4
-1000000000 -1000000000
1000000000 -1000000000
1000000000 1000000000
-1000000000 1000000000

output:

1
-2 -2 2
4
-2 0 1
-2 -2 2
0 -2 1
1 -1 0
0
1
-4000000000 -4000000000 0
4
-4000000000 0 0
-4000000000 -4000000000 0
0 -4000000000 0
2000000000 -2000000000 0

result:

ok 3 test cases (3 test cases)

Test #2:

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

input:

1
4
0 0
1 0
2 2
1 2

output:

0
0

result:

ok 1 test cases (1 test case)

Test #3:

score: 0
Accepted
time: 83ms
memory: 7660kb

input:

100000
3
0 0
137 967
-137 967
3
613 141
-613 141
0 0
3
0 0
165 58
-165 58
3
971 78
-971 78
0 0
3
627 119
-627 119
0 0
3
-252 233
0 0
252 233
3
0 0
193 11
-193 11
3
73 4
-73 4
0 0
3
0 0
464 613
-464 613
3
0 0
559 461
-559 461
3
0 0
760 61
-760 61
3
0 0
196 865
-196 865
3
386 825
-386 825
0 0
3
0 0
14...

output:

1
548 0 0
1
2452 0 0
1
660 0 0
1
3884 0 0
1
2508 0 0
1
-1008 0 0
1
772 0 0
1
292 0 0
1
1856 0 0
1
2236 0 0
1
3040 0 0
1
784 0 0
1
1544 0 0
1
576 0 0
1
1760 0 0
1
-1796 0 0
1
-3624 0 0
1
-376 0 0
1
-1484 0 0
1
988 0 0
1
28 0 0
1
3612 0 0
1
1196 0 0
1
164 0 0
1
1460 0 0
1
-1708 0 0
1
-1192 0 0
1
236 0...

result:

ok 100000 test cases (100000 test cases)

Test #4:

score: 0
Accepted
time: 96ms
memory: 7688kb

input:

10000
4
170 161
271 406
-271 406
-170 161
6
289 21
1110 317
1939 1184
-1939 1184
-1110 317
-289 21
38
-6784 4727
-6207 3806
-5861 3357
-5837 3328
-5714 3192
-5479 2933
-4682 2141
-4467 1929
-3773 1260
-3154 778
-2808 557
-1856 322
-1811 311
-1610 268
-713 77
713 77
1610 268
1811 311
1856 322
2808 55...

output:

0
1
680 0 0
0
0
0
1
1156 0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
-27136 0 0
0
0
0
0
0
0
0
1
-27136 0 0
0
0
0
0
0
0
0
0
0
1
-3996 0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
-16072 0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
-16072 0 0
1
-652 0 0
0
1
37...

result:

ok 10000 test cases (10000 test cases)

Test #5:

score: 0
Accepted
time: 101ms
memory: 7892kb

input:

1000
314
46083 29898
46580 30642
47116 31453
47426 31924
47556 32123
48163 33066
48250 33202
48644 33831
48678 33886
48756 34013
49159 34681
49399 35082
49902 35924
50395 36779
50574 37126
50643 37265
50911 37818
51302 38632
51615 39301
51950 40032
52331 40871
52634 41562
52653 41606
52655 41611
528...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
184332 0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

result:

ok 1000 test cases (1000 test cases)

Test #6:

score: 0
Accepted
time: 135ms
memory: 8700kb

input:

100
1300
-107115 35842
-106336 35343
-105957 35102
-105776 34987
-104828 34386
-104561 34217
-104263 34030
-103904 33805
-103053 33277
-102454 32906
-102117 32699
-101193 32140
-100252 31573
-99601 31184
-99166 30925
-99090 30880
-98743 30675
-98012 30246
-97561 29985
-97125 29734
-96838 29569
-9591...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 100 test cases (100 test cases)

Test #7:

score: 0
Accepted
time: 159ms
memory: 11836kb

input:

10
36250
2650050 772825
2650918 773332
2651132 773457
2652053 773995
2652373 774182
2653001 774549
2653066 774587
2653526 774856
2654256 775283
2655027 775734
2655374 775937
2656244 776446
2656338 776501
2656649 776683
2657288 777057
2657329 777081
2657756 777331
2658444 777734
2658753 777915
265899...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 10 test cases (10 test cases)

Test #8:

score: 0
Accepted
time: 194ms
memory: 34484kb

input:

1
300000
-61217516 50928980
-61217337 50928367
-61217304 50928254
-61217146 50927713
-61217021 50927285
-61216778 50926453
-61216627 50925936
-61216568 50925734
-61216339 50924950
-61216254 50924659
-61216058 50923988
-61215810 50923139
-61215673 50922670
-61215647 50922581
-61215498 50922071
-61215...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1 test cases (1 test case)

Test #9:

score: 0
Accepted
time: 64ms
memory: 16056kb

input:

1
99999
218789668 -30062233
218794627 -30062475
218801690 -30062819
218806557 -30063056
218816411 -30063535
218824584 -30063932
218833009 -30064340
218838547 -30064608
218842640 -30064806
218851370 -30065228
218859212 -30065606
218863641 -30065819
218873133 -30066275
218880895 -30066647
218887844 -3...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1 test cases (1 test case)

Test #10:

score: 0
Accepted
time: 52ms
memory: 16988kb

input:

1
100000
82919048 -59332292
82916010 -59318408
82914444 -59311256
82910724 -59294272
82906424 -59274644
82902060 -59254728
82901298 -59251252
82897114 -59232174
82893492 -59215662
82891602 -59207046
82888736 -59193982
82885472 -59179104
82881702 -59161920
82879974 -59154046
82876596 -59138654
828753...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1 test cases (1 test case)

Test #11:

score: 0
Accepted
time: 57ms
memory: 16028kb

input:

1
99999
-402380358 -107427468
-402383014 -107437774
-402386031 -107449481
-402389658 -107463560
-402393296 -107477692
-402397214 -107492914
-402400465 -107505547
-402403082 -107515718
-402407128 -107531454
-402410352 -107543998
-402411755 -107549457
-402413647 -107556819
-402417630 -107572336
-40242...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1 test cases (1 test case)

Test #12:

score: 0
Accepted
time: 61ms
memory: 17144kb

input:

1
99999
-303286690 188419090
-303288556 188407794
-303290704 188394790
-303293491 188377917
-303296036 188362506
-303297724 188352282
-303300256 188336940
-303301127 188331657
-303303320 188318354
-303304980 188308280
-303307691 188291827
-303309017 188283775
-303310881 188272455
-303312454 18826290...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1 test cases (1 test case)

Test #13:

score: 0
Accepted
time: 50ms
memory: 14380kb

input:

1
100000
-10515521 -377619713
-10509191 -377606643
-10504546 -377597052
-10499572 -377586780
-10493113 -377573441
-10487726 -377562314
-10483280 -377553130
-10480829 -377548067
-10477885 -377541985
-10474544 -377535082
-10469084 -377523800
-10464369 -377514055
-10459797 -377504605
-10453394 -3774913...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1 test cases (1 test case)

Test #14:

score: 0
Accepted
time: 44ms
memory: 13152kb

input:

1
100000
52134468 -112136157
52140143 -112126841
52145705 -112117709
52148858 -112112532
52154331 -112103544
52155916 -112100941
52160349 -112093660
52164990 -112086037
52168996 -112079457
52174143 -112070999
52178665 -112063568
52181149 -112059485
52185995 -112051519
52188699 -112047073
52191836 -1...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1 test cases (1 test case)

Test #15:

score: 0
Accepted
time: 46ms
memory: 14316kb

input:

1
100000
-42856709 -331300887
-42853910 -331295570
-42849395 -331286993
-42843271 -331275359
-42836605 -331262695
-42831066 -331252172
-42826574 -331243638
-42820731 -331232537
-42819105 -331229447
-42817184 -331225796
-42810718 -331213504
-42803978 -331200688
-42798459 -331190191
-42792064 -3311780...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1 test cases (1 test case)

Test #16:

score: 0
Accepted
time: 55ms
memory: 13496kb

input:

1
100000
-304306010 128978426
-304297926 128971488
-304290350 128964986
-304284535 128959997
-304275510 128952254
-304268400 128946154
-304259046 128938132
-304248614 128929186
-304239900 128921714
-304234563 128917139
-304224983 128908927
-304217392 128902424
-304208887 128895143
-304200925 1288883...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1 test cases (1 test case)

Test #17:

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

input:

1
100
435910464 -369900640
435846544 -369903376
435797504 -369906496
435556432 -369927280
435277168 -369960656
434997792 -370000896
434763392 -370060352
434668832 -370093472
434493872 -370155216
434336096 -370240384
434160144 -370335856
434132736 -370357024
434022656 -370448224
433917664 -370539584
...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
5748096 5748096 -362910501482496
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
-4447168 4447168 3593466007363584
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2
5748096 5748096 -362910501482496
-444...

result:

ok 1 test cases (1 test case)

Test #18:

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

input:

1
20
302599125 132311481
334130200 195340566
346755856 283587898
334163265 352929811
302658642 415972122
239636170 479021046
176607085 510552121
88359753 523177777
19017840 510585186
-44024471 479080563
-107073395 416058091
-138604470 353029006
-151230126 264781674
-138637535 195439761
-107132912 13...

output:

0
1
-63128280 -441236660 127151980712776960
0
0
1
251984080 -756481280 182780972274616880
0
0
0
0
1
882407190 -441435050 34768119726149950
0
0
0
0
1
567360960 188988060 -107284483726405560
0
0
4
-63062150 -126058170 40728368822061370
251984080 -756481280 182780972274616880
882407190 -441435050 34768...

result:

ok 1 test cases (1 test case)

Test #19:

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

input:

1
36
283484898 -47733438
301706406 -27263790
337025352 33021084
345972264 58924416
352998720 92181888
355387878 128156202
347378370 188909778
324660582 245822442
304987320 276035388
282597216 301611036
262127568 319832544
201842694 355151490
175939362 364098402
142681890 371124858
106707576 37351401...

output:

0
1
-124974732 -213315708 40526725760856504
0
0
0
0
0
0
0
0
1
215091072 -823663680 80880136942550400
0
0
0
0
0
0
0
0
1
825439044 -483597876 -28279162166698872
0
0
0
0
0
0
0
0
1
485373240 126750096 -68632573348392768
0
0
0
0
4
-124974732 -213315708 40526725760856504
215091072 -823663680 8088013694255...

result:

ok 1 test cases (1 test case)

Test #20:

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

input:

1
180
-182099331 -116688857
-171283846 -131987752
-169345591 -134429887
-168418543 -135570401
-163947366 -140838112
-156902016 -148436612
-150919291 -154302887
-148630336 -156419852
-140786662 -163191184
-134190951 -168358657
-128590726 -172405592
-127381416 -173240912
-118682446 -178871372
-1127230...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
-332171398 182071734 -3370458327906410
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
-725990304 -211905408 -13937892662110560
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1 test cases (1 test case)

Test #21:

score: 0
Accepted
time: 4ms
memory: 7756kb

input:

1
4860
437827436 349656580
437455154 349924606
437194654 350111706
436912664 350313826
436278394 350766876
436118314 350880876
435714164 351168076
435359992 351419040
435169262 351553912
434491420 352031668
434259304 352194706
433883638 352457968
433336234 352840246
432767834 353235516
432655294 353...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1 test cases (1 test case)

Test #22:

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

input:

1
20
193942440 -131795120
193480280 -129266440
149924960 -19635280
66155040 66967080
-44479640 114688520
-162429680 116649440
-164958360 116187280
-274589520 72631960
-361191880 -11137960
-408913320 -121772640
-410874240 -239722680
-410412080 -242251360
-366856760 -351882520
-283086840 -438484880
-1...

output:

0
0
0
0
1
717801600 -495964800 -14272879121280000
0
0
0
0
1
1208709040 220912480 172140173142808000
0
0
0
0
1
491831760 711819920 185573859834272000
0
0
4
924320 -5057360 -839192429816000
717801600 -495964800 -14272879121280000
1208709040 220912480 172140173142808000
491831760 711819920 185573859834...

result:

ok 1 test cases (1 test case)

Test #23:

score: -100
Wrong Answer
time: 2ms
memory: 7668kb

input:

1
20
72470855 -54298240
137429725 -55993140
150456700 -52396865
195543975 -26919760
205346000 -17616235
237410380 38902815
239105280 103861685
235509005 116888660
210031900 161975935
200728375 171777960
144209325 203842340
79250455 205537240
66223480 201940965
21136205 176463860
11334180 167160335
-...

output:

0
0
0
1
-329879050 -186402110 49676793855140000
0
0
0
0
1
-143476940 -516281160 54147705302102600
0
0
0
0
1
186402110 -329879050 4470911446962600
0
0
0
4
-329879050 -186402110 49676793855140000
-143476940 -516281160 54147705302102600
186402110 -329879050 4470911446962600
258140580 -71738470 22602941...

result:

wrong answer the participant are greater than answer (test case 1)