QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#416936#8711. Tilestesttset49 91ms53736kbC++144.8kb2024-05-22 11:18:312024-05-22 11:18:31

Judging History

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

  • [2024-05-22 11:18:31]
  • 评测
  • 测评结果:49
  • 用时:91ms
  • 内存:53736kb
  • [2024-05-22 11:18:31]
  • 提交

answer

// what is matter? never mind. 
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx,avx,avx2") 
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define ll long long
//#define int __int128
//#define ull unsigned long long
#define SZ(x) ((int)((x).size()))
#define ALL(x) (x).begin(),(x).end()
using namespace std;
inline int read()
{
    char c=getchar();int x=0;bool f=0;
    for(;!isdigit(c);c=getchar())f^=!(c^45);
    for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
    if(f)x=-x;return x;
}

#define mod 1000000007
struct modint{
	int x;
	modint(int o=0){x=o;}
	modint &operator = (int o){return x=o,*this;}
	modint &operator +=(modint o){return x=x+o.x>=mod?x+o.x-mod:x+o.x,*this;}
	modint &operator -=(modint o){return x=x-o.x<0?x-o.x+mod:x-o.x,*this;}
	modint &operator *=(modint o){return x=1ll*x*o.x%mod,*this;}
	modint &operator ^=(int b){
		modint a=*this,c=1;
		for(;b;b>>=1,a*=a)if(b&1)c*=a;
		return x=c.x,*this;
	}
	modint &operator /=(modint o){return *this *=o^=mod-2;}
	friend modint operator +(modint a,modint b){return a+=b;}
	friend modint operator -(modint a,modint b){return a-=b;}
	friend modint operator *(modint a,modint b){return a*=b;}
	friend modint operator /(modint a,modint b){return a/=b;}
	friend modint operator ^(modint a,int b){return a^=b;}
	friend bool operator ==(modint a,modint b){return a.x==b.x;}
	friend bool operator !=(modint a,modint b){return a.x!=b.x;}
	bool operator ! () {return !x;}
	modint operator - () {return x?mod-x:0;}
	bool operator <(const modint&b)const{return x<b.x;}
};
inline modint qpow(modint x,int y){return x^y;}

vector<modint> fac,ifac,iv;
inline void initC(int n)
{
	if(iv.empty())fac=ifac=iv=vector<modint>(2,1);
	int m=iv.size(); ++n;
	if(m>=n)return;
	iv.resize(n),fac.resize(n),ifac.resize(n);
	For(i,m,n-1){
		iv[i]=iv[mod%i]*(mod-mod/i);
		fac[i]=fac[i-1]*i,ifac[i]=ifac[i-1]*iv[i];
	}
}
inline modint C(int n,int m){
	if(m<0||n<m)return 0;
	return initC(n),fac[n]*ifac[m]*ifac[n-m];
}
inline modint sign(int n){return (n&1)?(mod-1):(1);}

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;

#define maxn 200005
#define inf 0x3f3f3f3f

int n,m;
int x[maxn],y[maxn],t[maxn],tx[maxn],lx;

vector<pii>buc[maxn];

struct info{
	int l,r;
	bool f[2][2];
	info(){
		l=r=-1;
		memset(f,0,sizeof f);
	}
};

// 

info gen(int l,int r,int y){
	info t;
	if(!y){
		For(i,0,1) t.f[i][i]=1;
		t.l=-1;
		t.r=-1;
	}else{
		t.l=l,t.r=r;
		For(i,0,1) For(j,0,1) t.f[i][j]=((i==j)==((r-l+1)%2==0));
	}
	return t;
}

info merge(info a,info b){
	if(a.l==-1) return b;
	if(b.l==-1) return a;
	info c;
	c.l=a.l,c.r=b.r;
	For(x,0,1)
		For(y,0,1) if(a.f[x][y] && (!y||a.r+1==b.l))
			For(z,0,1)
				if(b.f[y][z]) c.f[x][z]=1;
	return c;
}

struct segt{
	info tr[maxn<<2][2];
	bool rev[maxn<<2];
	void up(int p){
		For(i,0,1) tr[p][i]=merge(tr[p<<1][i],tr[p<<1|1][i]);
	}
	void pt(int p){
		rev[p]^=1;
		swap(tr[p][0],tr[p][1]);
	}
	void down(int p){
		if(rev[p]){
			pt(p<<1),pt(p<<1|1);
			rev[p]=0;
		}
	}
	void mdf(int p,int l,int r,int ql,int qr){
		if(l>=ql&&r<=qr)return pt(p);
		int mid=l+r>>1; down(p);
		if(ql<=mid) mdf(p<<1,l,mid,ql,qr);
		if(qr>mid) mdf(p<<1|1,mid+1,r,ql,qr);
		up(p);
	}
	void build(int p,int l,int r){
	//	cout<<"build "<<p<<" "<<l<<" "<<r<<"\n";
		if(l==r){
			For(i,0,1) tr[p][i]=gen(t[l],t[l+1]-1,i);
			return;
		}
		int mid=l+r>>1;
		build(p<<1,l,mid);
		build(p<<1|1,mid+1,r);
		up(p);
	}
	bool chk(){
		return tr[1][0].f[0][0];
	}
	bool chk0(){
		return tr[1][0].l==-1;
	}
}T[2];

signed main()
{
	n=read(),m=read(); int mm=m; m=0;
	For(i,1,n)x[i]=read(),y[i]=read(),t[++m]=y[i],tx[++lx]=x[i];
	sort(t+1,t+m+1); sort(tx+1,tx+lx+1);
	m=unique(t+1,t+m+1)-t-1,lx=unique(tx+1,tx+lx+1)-tx-1;
	For(i,1,n){
		x[i]=lower_bound(tx+1,tx+lx+1,x[i])-tx;
		y[i]=lower_bound(t+1,t+m+1,y[i])-t;
	}
	For(i,1,n){
		int j=i%n+1;
		if(x[i]==x[j]) buc[x[i]].pb(mkp(min(y[i],y[j]),max(y[i],y[j])));
	}
	//cout<<"---\n";
	T[0].build(1,1,m-1);
	T[1]=T[0];
	int o=0;
	int res=t[0];
	tx[lx+1]=2e9;
	For(i,1,lx){
	//	cout<<"i: "<<i<<"\n";
		for(auto [l,r]:buc[i]) T[o].mdf(1,1,m-1,l,r-1);
		if(!T[o].chk()){
			cout<<tx[i]/2*2;
			exit(0);
		}
		int tt[2]={tx[i+1],tx[i+1]-1};
		if((tt[0]-tx[i])%2) swap(tt[0],tt[1]);
		
		if(T[o].chk0() && tt[1]>=tx[i]) res=max(res,tt[1]);
		if(T[!o].chk0() && tt[0]>=tx[i]) res=max(res,tt[0]);
		
		if((tx[i+1]-tx[i])%2){
			o^=1;
		}
	}
	res=min(res,mm);
	cout<<res;
	return 0;
}
/*
1 
1 2 2 1 
1 2 2 1
1 2 2 1
1 2 2 1

5 4

*/

/*
*/

詳細信息

Subtask #1:

score: 4
Accepted

Test #1:

score: 4
Accepted
time: 3ms
memory: 49952kb

input:

4 3
0 0
0 3
3 3
3 0

output:

0

result:

ok single line: '0'

Test #2:

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

input:

4 999999999
999999999 0
999999999 1000000000
0 1000000000
0 0

output:

999999998

result:

ok single line: '999999998'

Test #3:

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

input:

4 875
875 0
0 0
0 284
875 284

output:

874

result:

ok single line: '874'

Test #4:

score: 0
Accepted
time: 13ms
memory: 49488kb

input:

4 317
317 0
317 920
0 920
0 0

output:

316

result:

ok single line: '316'

Test #5:

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

input:

4 912
912 814
912 0
0 0
0 814

output:

912

result:

ok single line: '912'

Test #6:

score: 0
Accepted
time: 9ms
memory: 50416kb

input:

4 2
0 0
0 1
2 1
2 0

output:

0

result:

ok single line: '0'

Test #7:

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

input:

4 1
0 0
0 1
1 1
1 0

output:

0

result:

ok single line: '0'

Test #8:

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

input:

4 412
412 998
0 998
0 17
412 17

output:

0

result:

ok single line: '0'

Test #9:

score: 0
Accepted
time: 9ms
memory: 49272kb

input:

4 87523458
87523458 42385699
0 42385699
0 23498231
87523458 23498231

output:

87523458

result:

ok single line: '87523458'

Test #10:

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

input:

4 1
0 0
0 1000000000
1 1000000000
1 0

output:

0

result:

ok single line: '0'

Test #11:

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

input:

4 1000000000
1000000000 0
1000000000 1000000000
0 1000000000
0 0

output:

1000000000

result:

ok single line: '1000000000'

Subtask #2:

score: 9
Accepted

Dependency #1:

100%
Accepted

Test #12:

score: 9
Accepted
time: 9ms
memory: 49236kb

input:

5 29034873
29034873 13721
0 13721
0 99198237
29034870 99198237
29034873 99198237

output:

29034872

result:

ok single line: '29034872'

Test #13:

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

input:

6 999999993
2934870 21349
2934870 3423847
0 3423847
0 91827393
999999993 91827393
999999993 21349

output:

999999992

result:

ok single line: '999999992'

Test #14:

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

input:

6 401
153 409
153 751
0 751
0 909
401 909
401 409

output:

152

result:

ok single line: '152'

Test #15:

score: 0
Accepted
time: 7ms
memory: 50068kb

input:

5 726
0 286
0 315
726 315
726 122
0 122

output:

0

result:

ok single line: '0'

Test #16:

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

input:

6 999
616 129
616 311
0 311
0 529
999 529
999 129

output:

998

result:

ok single line: '998'

Test #17:

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

input:

6 3
0 0
0 4
3 4
3 2
2 2
2 0

output:

2

result:

ok single line: '2'

Test #18:

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

input:

6 3
0 0
0 2
1 2
1 3
3 3
3 0

output:

0

result:

ok single line: '0'

Test #19:

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

input:

6 717
204 1000
0 1000
0 306
548 306
717 306
717 1000

output:

716

result:

ok single line: '716'

Test #20:

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

input:

6 804
785 17
785 665
0 665
0 969
804 969
804 17

output:

784

result:

ok single line: '784'

Test #21:

score: 0
Accepted
time: 6ms
memory: 49376kb

input:

6 973
973 772
973 122
42 122
42 6
0 6
0 772

output:

972

result:

ok single line: '972'

Test #22:

score: 0
Accepted
time: 9ms
memory: 50380kb

input:

6 615
492 993
492 748
615 748
615 311
0 311
0 993

output:

492

result:

ok single line: '492'

Test #23:

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

input:

6 999
999 424
999 302
83 302
83 70
0 70
0 424

output:

82

result:

ok single line: '82'

Test #24:

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

input:

6 884
884 622
884 317
228 317
228 96
0 96
0 622

output:

228

result:

ok single line: '228'

Test #25:

score: 0
Accepted
time: 6ms
memory: 50196kb

input:

6 6
0 6
3 6
3 4
6 4
6 0
0 0

output:

2

result:

ok single line: '2'

Test #26:

score: 0
Accepted
time: 6ms
memory: 50612kb

input:

6 6
0 4
5 4
5 2
6 2
6 0
0 0

output:

4

result:

ok single line: '4'

Test #27:

score: 0
Accepted
time: 9ms
memory: 48600kb

input:

6 6
0 6
2 6
2 4
6 4
6 0
0 0

output:

6

result:

ok single line: '6'

Test #28:

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

input:

6 6
0 6
1 6
1 4
6 4
6 0
0 0

output:

0

result:

ok single line: '0'

Test #29:

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

input:

6 802
0 60
802 60
802 604
288 604
288 271
0 271

output:

0

result:

ok single line: '0'

Test #30:

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

input:

5 318
0 782
318 782
318 256
318 148
0 148

output:

318

result:

ok single line: '318'

Test #31:

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

input:

6 994
994 511
994 76
0 76
0 135
0 782
994 782

output:

994

result:

ok single line: '994'

Subtask #3:

score: 11
Accepted

Test #32:

score: 11
Accepted
time: 10ms
memory: 48908kb

input:

1551 1000
0 988
2 988
3 988
6 988
6 985
6 982
6 981
6 979
6 978
6 977
6 976
6 975
6 974
6 972
6 970
6 969
6 968
6 966
6 965
6 964
7 964
8 964
8 963
8 961
8 960
10 960
11 960
13 960
16 960
16 959
16 958
16 957
16 954
16 953
16 951
16 950
17 950
18 950
18 948
18 946
18 945
18 944
18 942
18 941
18 939
...

output:

164

result:

ok single line: '164'

Test #33:

score: 0
Accepted
time: 13ms
memory: 50404kb

input:

36221 1000000000
0 996776952
43916 996776952
43916 996301596
102050 996301596
102050 995243908
173144 995243908
173144 992639626
184542 992639626
184542 987461238
192474 987461238
192474 982703402
406098 982703402
406098 980100986
525272 980100986
525272 978443232
532708 978443232
532708 977775310
6...

output:

14903120

result:

ok single line: '14903120'

Test #34:

score: 0
Accepted
time: 63ms
memory: 53396kb

input:

193828 1000000000
0 999998938
7028 999998938
7028 999997962
20232 999997962
20232 999997052
23456 999997052
23456 999996854
30820 999996854
30820 999996798
53224 999996798
53224 999996114
55112 999996114
55112 999995972
57148 999995972
57148 999995732
59864 999995732
59864 999995618
64052 999995618
...

output:

847705586

result:

ok single line: '847705586'

Test #35:

score: 0
Accepted
time: 43ms
memory: 51788kb

input:

100000 999981518
0 999980992
50540 999980992
50540 999973058
73428 999973058
73428 999952350
116804 999952350
116804 999950006
133616 999950006
133616 999940658
150202 999940658
150202 999931756
158656 999931756
158656 999921792
182938 999921792
182938 999899902
224480 999899902
224480 999898440
226...

output:

999981518

result:

ok single line: '999981518'

Test #36:

score: 0
Accepted
time: 35ms
memory: 51052kb

input:

100000 999999946
0 999984618
10462 999984618
10462 999958906
60800 999958906
60800 999953668
65892 999953668
65892 999947392
70334 999947392
70334 999928772
87646 999928772
87646 999863608
117006 999863608
117006 999834378
182962 999834378
182962 999819462
202864 999819462
202864 999812430
204350 99...

output:

676608028

result:

ok single line: '676608028'

Test #37:

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

input:

502 993
0 1000
2 1000
2 996
4 996
4 992
6 992
6 988
8 988
8 984
10 984
10 980
12 980
12 976
14 976
14 972
16 972
16 968
18 968
18 964
20 964
20 960
22 960
22 956
24 956
24 952
26 952
26 948
28 948
28 944
30 944
30 940
32 940
32 936
34 936
34 932
36 932
36 928
38 928
38 924
40 924
40 920
42 920
42 91...

output:

992

result:

ok single line: '992'

Test #38:

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

input:

1080 994
0 990
2 990
4 990
8 990
8 989
8 988
8 987
8 986
10 986
12 986
14 986
20 986
20 985
20 983
20 982
20 979
20 978
20 976
20 975
20 974
20 973
20 968
22 968
26 968
28 968
28 967
28 965
28 963
28 962
28 956
28 955
28 950
28 949
28 947
28 945
28 944
28 943
28 942
28 941
28 940
28 939
28 938
28 93...

output:

572

result:

ok single line: '572'

Test #39:

score: 0
Accepted
time: 63ms
memory: 53660kb

input:

200000 999999996
0 999999712
11680 999999712
11680 999998638
16884 999998638
16884 999992598
25560 999992598
25560 999986560
27916 999986560
27916 999980634
34720 999980634
34720 999978576
44572 999978576
44572 999968226
49332 999968226
49332 999941322
62120 999941322
62120 999937962
92112 999937962...

output:

479112624

result:

ok single line: '479112624'

Test #40:

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

input:

114867 183430402
0 1000000000
3192 1000000000
3192 999982590
6384 999982590
6384 999965180
9576 999965180
9576 999947770
12768 999947770
12768 999930360
15960 999930360
15960 999912950
19152 999912950
19152 999895540
22344 999895540
22344 999878130
25536 999878130
25536 999860720
28728 999860720
287...

output:

183430402

result:

ok single line: '183430402'

Test #41:

score: 0
Accepted
time: 87ms
memory: 53648kb

input:

200000 999999999
0 998179020
20114 998179020
20114 998131016
56540 998131016
56540 998028168
57786 998028168
57786 997952316
58860 997952316
58860 997891040
68802 997891040
68802 997877196
94486 997877196
94486 997832208
110000 997832208
110000 997641760
117346 997641760
117346 997520396
118582 9975...

output:

6933364

result:

ok single line: '6933364'

Test #42:

score: 0
Accepted
time: 40ms
memory: 50776kb

input:

90448 279993337
0 1000000000
6190 1000000000
6190 999977888
12380 999977888
12380 999955776
18570 999955776
18570 999933664
24760 999933664
24760 999911552
30950 999911552
30950 999889440
37140 999889440
37140 999867328
43330 999867328
43330 999845216
49520 999845216
49520 999823104
55710 999823104
...

output:

279993336

result:

ok single line: '279993336'

Test #43:

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

input:

16 1000000000
0 1000000000
82734 1000000000
98347 1000000000
102982 1000000000
102982 293874957
102982 234875948
102982 102938556
355111 102938556
12836323 102938556
19238732 102938556
349587239 102938556
1000000000 102938556
1000000000 1928733
1000000000 283746
1000000000 0
0 0

output:

1000000000

result:

ok single line: '1000000000'

Test #44:

score: 0
Accepted
time: 77ms
memory: 53704kb

input:

199999 1000000000
0 999996612
3392 999996612
3392 999996606
15294 999996606
15294 999993550
20716 999993550
20716 999992154
35680 999992154
35680 999985500
38506 999985500
38506 999983338
46448 999983338
46448 999976708
47598 999976708
47598 999976696
48928 999976696
48928 999965882
49490 999965882
...

output:

1000000000

result:

ok single line: '1000000000'

Subtask #4:

score: 0
Wrong Answer

Test #45:

score: 19
Accepted
time: 0ms
memory: 49708kb

input:

14 6
0 1
0 3
2 3
2 4
0 4
0 6
3 6
3 7
4 7
6 7
6 5
3 5
3 2
3 1

output:

2

result:

ok single line: '2'

Test #46:

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

input:

18 9
0 2
2 2
2 1
4 1
4 0
9 0
9 2
4 2
4 4
7 4
7 3
9 3
9 6
4 6
4 5
2 5
2 4
0 4

output:

6

result:

ok single line: '6'

Test #47:

score: 0
Accepted
time: 39ms
memory: 51496kb

input:

199996 966
752 702
754 702
754 700
756 700
756 702
758 702
758 700
760 700
760 702
762 702
762 700
764 700
764 702
766 702
766 700
768 700
768 702
770 702
770 700
772 700
772 702
774 702
774 700
776 700
776 702
778 702
778 700
780 700
780 702
782 702
782 700
784 700
784 702
786 702
786 700
788 700
7...

output:

0

result:

ok single line: '0'

Test #48:

score: 0
Accepted
time: 47ms
memory: 51500kb

input:

199996 966
748 702
750 702
750 700
752 700
752 702
754 702
754 700
756 700
756 702
758 702
758 700
760 700
760 702
762 702
762 700
764 700
764 702
766 702
766 700
768 700
768 702
770 702
770 700
772 700
772 702
774 702
774 700
776 700
776 702
778 702
778 700
780 700
780 702
782 702
782 700
784 700
7...

output:

962

result:

ok single line: '962'

Test #49:

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

input:

500 916
560 975
560 526
544 526
544 708
538 708
538 585
534 585
534 879
530 879
530 612
514 612
514 907
512 907
512 571
504 571
504 976
494 976
494 746
486 746
486 922
478 922
478 667
476 667
476 913
472 913
472 623
456 623
456 890
450 890
450 609
446 609
446 905
436 905
436 705
428 705
428 816
418 ...

output:

900

result:

ok single line: '900'

Test #50:

score: -19
Wrong Answer
time: 9ms
memory: 49492kb

input:

500 980
421 481
453 481
453 479
32 479
32 477
453 477
453 461
353 461
353 451
403 451
403 441
176 441
176 435
314 435
314 429
128 429
128 417
129 417
129 413
31 413
31 401
136 401
136 399
130 399
130 398
130 391
217 391
217 383
6 383
6 369
105 369
105 365
84 365
84 353
178 353
178 345
0 345
0 343
26...

output:

768

result:

wrong answer 1st lines differ - expected: '0', found: '768'

Subtask #5:

score: 0
Wrong Answer

Test #89:

score: 22
Accepted
time: 56ms
memory: 51200kb

input:

199996 198506138
31225688 248200160
31225688 248291950
28995282 248291950
28995282 248200160
26764876 248200160
26764876 248291950
24534470 248291950
24534470 248200160
22304064 248200160
22304064 248291950
20073658 248291950
20073658 248200160
17843252 248200160
17843252 248291950
15612846 24829195...

output:

0

result:

ok single line: '0'

Test #90:

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

input:

199996 740789144
48843244 341844840
48843244 342042210
40702704 342042210
40702704 341844840
32562164 341844840
32562164 342042210
24421624 342042210
24421624 341844840
16281084 341844840
16281084 342042210
8140544 342042210
8140544 341450100
16281084 341450100
16281084 341647470
24421624 341647470
...

output:

0

result:

ok single line: '0'

Test #91:

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

input:

199996 198506138
31225684 248200166
31225684 248291956
28995278 248291956
28995278 248200166
26764872 248200166
26764872 248291956
24534466 248291956
24534466 248200166
22304060 248200166
22304060 248291956
20073654 248291956
20073654 248200166
17843248 248200166
17843248 248291956
15612842 24829195...

output:

198506134

result:

ok single line: '198506134'

Test #92:

score: 0
Accepted
time: 60ms
memory: 51104kb

input:

199996 740789144
48843240 341844840
48843240 342042210
40702700 342042210
40702700 341844840
32562160 341844840
32562160 342042210
24421620 342042210
24421620 341844840
16281080 341844840
16281080 342042210
8140540 342042210
8140540 341450100
16281080 341450100
16281080 341647470
24421620 341647470
...

output:

740789140

result:

ok single line: '740789140'

Test #93:

score: 0
Accepted
time: 76ms
memory: 53636kb

input:

199999 1000000000
1000000000 0
999999222 0
999999222 136
999984018 136
999984018 228
999973482 228
999973482 292
999971160 292
999971160 396
999964886 396
999964886 588
999959042 588
999959042 680
999955190 680
999955190 732
999927188 732
999927188 748
999913912 748
999913912 796
999912122 796
99991...

output:

13366

result:

ok single line: '13366'

Test #94:

score: 0
Accepted
time: 65ms
memory: 53596kb

input:

200000 1000000000
684694139 795608956
684694139 795624096
684697059 795624096
684697059 795626100
684706431 795626100
684706431 795627636
684723897 795627636
684723897 795629488
684739661 795629488
684739661 795629884
684747463 795629884
684747463 795637960
684749717 795637960
684749717 795650464
68...

output:

33676

result:

ok single line: '33676'

Test #95:

score: 0
Accepted
time: 91ms
memory: 53592kb

input:

200000 1000000000
46181104 58318020
46181104 58296528
46177454 58296528
46177454 58295540
46175192 58295540
46175192 58283280
46160546 58283280
46160546 58257456
46152376 58257456
46152376 58240260
46149232 58240260
46149232 58234984
46135618 58234984
46135618 58228216
46117434 58228216
46117434 582...

output:

257649284

result:

ok single line: '257649284'

Test #96:

score: -22
Wrong Answer
time: 42ms
memory: 51664kb

input:

199996 554773273
457247489 96654740
457247489 98035522
457386217 98035522
457386217 99416304
457247489 99416304
457247489 100797086
457386217 100797086
457386217 102177868
457247489 102177868
457247489 103558650
457386217 103558650
457386217 104939432
457247489 104939432
457247489 106320214
45738621...

output:

497478608

result:

wrong answer 1st lines differ - expected: '392045328', found: '497478608'

Subtask #6:

score: 25
Accepted

Test #118:

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

input:

200000 1000000000
1000000000 0
999990876 0
999990876 38
999972524 38
999972524 1510
999969180 1510
999969180 3734
999964780 3734
999964780 4138
999960464 4138
999960464 11052
999953728 11052
999953728 24478
999914972 24478
999914972 25892
999909864 25892
999909864 28102
999902920 28102
999902920 301...

output:

40502

result:

ok single line: '40502'

Test #119:

score: 0
Accepted
time: 79ms
memory: 53604kb

input:

200000 778696306
22822858 87970191
330038016 87970191
330038016 87957657
259262362 87957657
259262362 87923225
316313936 87923225
316313936 87896643
155653960 87896643
155653960 87890367
184851800 87890367
184851800 87877609
93595576 87877609
93595576 87838069
384366344 87838069
384366344 87822439
3...

output:

298364980

result:

ok single line: '298364980'

Test #120:

score: 0
Accepted
time: 71ms
memory: 52096kb

input:

199996 939450484
183372590 726043385
183372590 947636904
183351398 947636904
183351398 585647776
183326398 585647776
183326398 815654133
183324414 815654133
183324414 681316487
183304068 681316487
183304068 993350372
183281288 993350372
183281288 748476649
183258832 748476649
183258832 772289334
183...

output:

158652

result:

ok single line: '158652'

Test #121:

score: 0
Accepted
time: 42ms
memory: 53668kb

input:

200000 1000000000
851050592 949600024
851052652 949600024
851052652 949609374
851074804 949609374
851074804 949619690
851079480 949619690
851079480 949621292
851099180 949621292
851099180 949623446
851108076 949623446
851108076 949624656
851108300 949624656
851108300 949626322
851114392 949626322
85...

output:

0

result:

ok single line: '0'

Test #122:

score: 0
Accepted
time: 73ms
memory: 53644kb

input:

200000 1000000000
563456704 374947039
563456704 374927074
563408574 374927074
563408574 374916426
563395120 374916426
563395120 374901323
563377364 374901323
563377364 374886390
563372770 374886390
563372770 374876185
563370378 374876185
563370378 374859944
563361728 374859944
563361728 374858704
56...

output:

317583084

result:

ok single line: '317583084'

Test #123:

score: 0
Accepted
time: 56ms
memory: 50952kb

input:

199999 96699482
32621512 407805930
31456458 407805930
31456458 407659920
30291404 407659920
30291404 408097950
31456458 408097950
31456458 407951940
32621512 407951940
32621512 408097950
33786566 408097950
33786566 407951940
34951620 407951940
34951620 408097950
36116674 408097950
36116674 407951940...

output:

96699482

result:

ok single line: '96699482'

Test #124:

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

input:

199991 628378890
454249800 18408156
461820630 18408156
461820630 18371848
469391460 18371848
469391460 18408156
476962290 18408156
476962290 18371848
484533120 18371848
484533120 18408156
492103950 18408156
492103950 18371848
499674780 18371848
499674780 18408156
507245610 18408156
507245610 1837184...

output:

597872006

result:

ok single line: '597872006'

Test #125:

score: 0
Accepted
time: 54ms
memory: 50972kb

input:

199991 411269100
304822980 10387669
304822980 10334399
309661440 10334399
309661440 10387669
314499900 10387669
314499900 10334399
319338360 10334399
319338360 10387669
324176820 10387669
324176820 10334399
329015280 10334399
329015280 10387669
333853740 10387669
333853740 10334399
338692200 1033439...

output:

409773014

result:

ok single line: '409773014'

Test #126:

score: 0
Accepted
time: 71ms
memory: 53584kb

input:

200000 1000000000
0 0
2 0
2 7506
999900202 7506
999900202 7508
99800 7508
99800 8994
999900204 8994
999900204 8996
99798 8996
99798 16558
999900206 16558
999900206 16560
99796 16560
99796 32318
999900208 32318
999900208 32320
99794 32320
99794 35116
999900210 35116
999900210 35118
99792 35118
99792 ...

output:

999966026

result:

ok single line: '999966026'

Test #127:

score: 0
Accepted
time: 65ms
memory: 53736kb

input:

200000 1000000000
0 0
2 0
2 15124
999900202 15124
999900202 15126
99800 15126
99800 28330
999900204 28330
999900204 28332
99798 28332
99798 33696
999900206 33696
999900206 33698
99796 33698
99796 43952
999900208 43952
999900208 43954
99794 43954
99794 46390
999900210 46390
999900210 46392
99792 4639...

output:

999961970

result:

ok single line: '999961970'

Test #128:

score: 0
Accepted
time: 67ms
memory: 53600kb

input:

200000 1000000000
0 0
2 0
2 17910
999900202 17910
999900202 17912
99800 17912
99800 29854
999900204 29854
999900204 29856
99798 29856
99798 32692
999900206 32692
999900206 32694
99796 32694
99796 41542
999900208 41542
999900208 41544
99794 41544
99794 45142
999900210 45142
999900210 45144
99792 4514...

output:

999966092

result:

ok single line: '999966092'

Test #129:

score: 0
Accepted
time: 38ms
memory: 50276kb

input:

100624 506028352
0 8751
9104 8751
9104 32159
12966 32159
12966 45070
50526 45070
50526 58152
64694 58152
64694 99309
66288 99309
66288 142125
91496 142125
91496 147329
96042 147329
96042 149406
130818 149406
130818 174885
163952 174885
163952 187058
167450 187058
167450 207028
208448 207028
208448 2...

output:

506028352

result:

ok single line: '506028352'

Test #130:

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

input:

12 238947238
8922 63488
8922 123
92348756 123
92348756 63488
238947238 63488
238947238 3474740
92348756 3474740
92348756 845673459
8922 845673459
8922 3474740
0 3474740
0 63488

output:

238947238

result:

ok single line: '238947238'

Test #131:

score: 0
Accepted
time: 41ms
memory: 50156kb

input:

100532 502940770
0 15447
122642 15447
122642 30295
176092 30295
176092 37938
214052 37938
214052 42195
239082 42195
239082 42698
242510 42698
242510 52373
258142 52373
258142 56745
260132 56745
260132 85113
280290 85113
280290 141795
303652 141795
303652 155321
327606 155321
327606 158599
333920 158...

output:

502940770

result:

ok single line: '502940770'

Subtask #7:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%