QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#100953#6352. SPPPSPSS.CrysflyAC ✓895ms71948kbC++174.4kb2023-04-28 20:18:272023-04-28 20:18:32

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-28 20:18:32]
  • 评测
  • 测评结果:AC
  • 用时:895ms
  • 内存:71948kb
  • [2023-04-28 20:18:27]
  • 提交

answer

#pragma GCC optimize("Ofast")
#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)
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 fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;

#define maxn 1000005
#define inf 0x3f3f3f3f

bool mbe;

int p[maxn],n;

bool vis[maxn];
void wkpre(vi&o,int x){
	For(i,1,n)vis[i]=0;
	For(i,0,x-1)vis[o[i]]=1;
	int p=0;
	For(i,1,n)if(vis[i])o[p]=i,++p;
}
void wksuf(vi&o,int x){
	For(i,1,n)vis[i]=0;
	For(i,n-x,n-1)vis[o[i]]=1;
	int p=n-x;
	For(i,1,n)if(vis[i])o[p]=i,++p;
}
bool check(int mid,bool out=0)
{
	vi o(n);For(i,0,n-1)o[i]=p[i+1];
	wkpre(o,mid-1),wksuf(o,mid);
	if(is_sorted(o.begin(),o.end())){
		if(out){
			For(i,1,mid-2)cout<<"S";
			cout<<"PS.";
		}
		return 1;
	}
	For(i,0,n-1)o[i]=p[i+1];
	wksuf(o,mid-1),wkpre(o,mid);
	if(is_sorted(o.begin(),o.end())){
		if(out){
			For(i,1,mid-2)cout<<"S";
			cout<<"SP.";
		}
		return 1;
	}
	return 0;
}

#define N 32000005
int rt0,rt1,tot;
int ls[N],rs[N],sum[N];
int rub[N],rubtot;
int newn(){
	if(rubtot)return rub[rubtot--];
	return assert(tot<=N-5),++tot;
}
void thro(int x){
	ls[x]=rs[x]=sum[x]=0;
	rub[++rubtot]=x;
}
void add(int&p,int l,int r,int x,int y){
	if(!p)p=newn();
	sum[p]+=y;
	if(l==r)return;
	int mid=l+r>>1;
	x<=mid?add(ls[p],l,mid,x,y):add(rs[p],mid+1,r,x,y);
}
int ask(int p,int l,int r,int ql,int qr){
	if(!p)return 0;
	if(l>=ql&&r<=qr)return sum[p];
	int mid=l+r>>1,res=0;
	if(ql<=mid)res+=ask(ls[p],l,mid,ql,qr);
	if(qr>mid)res+=ask(rs[p],mid+1,r,ql,qr);
	return res;
}

void split(int x,int&y,int k){
	if(!x)return;
	y=newn();
	int v=sum[ls[x]];
	if(k>v)split(rs[x],rs[y],k-v);
	else swap(rs[x],rs[y]);
	if(k<v)split(ls[x],ls[y],k);
	sum[y]=sum[x]-k;
	sum[x]=k;
}

int merge(int x,int y){
	if(!x||!y)return x|y;
	sum[x]+=sum[y],ls[x]=merge(ls[x],ls[y]),rs[x]=merge(rs[x],rs[y]),thro(y);
	return x;
}

void dfs(int p,int l,int r){
	if(!p||!sum[p])return;
	if(l==r)return cout<<l<<" ",void();int mid=l+r>>1;
	dfs(ls[p],l,mid),dfs(rs[p],mid+1,r);
}
bool med;

signed main()
{
//	printf("%.6lf\n",(&mbe-&med)/1024576.0);
//	freopen("data.in","r",stdin);
	n=read();
	For(i,1,n)p[i]=read();
	if(is_sorted(p+1,p+n+1)){
		puts(".");
		exit(0);
	}
	if(check((n+1)/2)){
		int l=2,r=(n+1)/2,res=r;
		while(l<=r){
			int mid=l+r>>1;
			if(check(mid))res=mid,r=mid-1;
			else l=mid+1;
		}
		check(res,1);exit(0);
	}
	//pspspsp
	
	int p0=1,p1=0;
	for(int op=1;p0+p1+2<=n;op^=1){
		if(op)p1+=2;else p0+=2;
	}
	if(n%2==0){
		For(i,1,n/2) add(rt0,1,n,p[i],1);
		For(i,n/2+1,n) add(rt1,1,n,p[i],1);
	}else{
		For(i,1,p0) add(rt0,1,n,p[i],1);
		For(i,p0+1,n) add(rt1,1,n,p[i],1);
	}
	
	
	pii res=mkp(inf,inf);
	For(i,(n+1)/2+1,n){
		if(i%2==0){
			//s
			p1+=2;
			int tmp=0;
		//	cout<<"split "<<n-p1<<endl;
			split(rt0,tmp,n-p1);
			rt1=merge(tmp,rt1);
		}else{
			//p
			p0+=2;
			int tmpl=rt1,tmpr=0;
		//	cout<<"SPLIT "<<p0-(n-p1+1)+1<<endl;
			split(tmpl,tmpr,p0-(n-p1+1)+1);
			rt0=merge(rt0,tmpl);
			rt1=tmpr;
		}
	//	cout<<"i: "<<i<<"\n";
	//	dfs(rt0,1,n),cout<<" ",dfs(rt1,1,n);
	//	cout<<sum[rt0]<<" "<<sum[rt1]<<"\n";
		if(ask(rt0,1,n,1,sum[rt0])==sum[rt0]
			 && ask(rt1,1,n,n-sum[rt1]+1,n)==sum[rt1]){
			 	res=min(res,mkp(i,0));
			 	break;
			 }
	}
	
	For(i,0,tot) ls[i]=rs[i]=sum[i]=0; rt0=rt1=0;
	//spspsps
	
	p0=0,p1=1;
	for(int op=0;p0+p1+2<=n;op^=1){
		if(op)p1+=2;else p0+=2;
	}
	if(n%2==0){
		For(i,1,n/2) add(rt0,1,n,p[i],1);
		For(i,n/2+1,n) add(rt1,1,n,p[i],1);
	}else{
		For(i,1,p0) add(rt0,1,n,p[i],1);
		For(i,p0+1,n) add(rt1,1,n,p[i],1);
	}
	
	For(i,(n+1)/2+1,n){
		if(i%2==0){
			//p
			p0+=2;
			int tmpl=rt1,tmpr=0;
			split(tmpl,tmpr,p0-(n-p1+1)+1);
			rt0=merge(rt0,tmpl);
			rt1=tmpr;
		}else{
			p1+=2;
			int tmp=0;
			split(rt0,tmp,n-p1);
			rt1=merge(tmp,rt1);
		}
		if(ask(rt0,1,n,1,sum[rt0])==sum[rt0]
			 && ask(rt1,1,n,n-sum[rt1]+1,n)==sum[rt1]){
			 	res=min(res,mkp(i,1));
			 	break;
			 }
	}
	
//	cout<<"res: "<<res.fi<<"\n";exit(0);
	For(i,1,res.fi)
		if((i&1)^(res.se))cout<<'P';
		else cout<<'S'; cout<<'.';
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 5336kb

input:

3
1 2 3

output:

.

result:

ok OK 0 operations

Test #2:

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

input:

2
2 1

output:

PS.

result:

ok OK 2 operations

Test #3:

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

input:

9
3 2 4 1 5 6 7 9 8

output:

SSSP.

result:

ok OK 4 operations

Test #4:

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

input:

10
2 9 5 7 10 6 3 1 8 4

output:

PSPSPSPS.

result:

ok OK 8 operations

Test #5:

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

input:

13
9 8 5 4 3 2 1 13 12 11 10 7 6

output:

PSPSPSPS.

result:

ok OK 8 operations

Test #6:

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

input:

20
17 6 15 14 4 10 18 7 13 8 2 12 1 19 20 3 11 16 5 9

output:

PSPSPSPSPSPSPS.

result:

ok OK 14 operations

Test #7:

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

input:

100
98 85 81 18 27 10 68 48 19 2 55 51 61 20 91 54 35 22 83 75 8 5 17 23 21 95 37 15 92 50 78 82 44 39 26 87 52 66 70 74 89 4 59 40 12 88 86 43 14 80 53 46 63 3 36 97 60 58 57 96 11 67 99 41 34 47 71 72 73 79 9 94 6 1 77 25 31 7 45 100 90 32 24 13 76 16 93 38 29 69 42 84 30 28 33 56 49 62 64 65

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSP.

result:

ok OK 57 operations

Test #8:

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

input:

1000
668 554 210 852 617 846 561 95 341 893 276 224 287 1000 356 362 897 205 369 654 181 590 339 377 346 557 382 593 55 62 126 899 49 509 977 585 614 232 865 800 790 292 219 957 379 914 946 246 294 403 940 517 768 623 376 624 331 353 887 626 424 449 115 628 569 809 956 942 300 894 61 936 678 779 549...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 523 operations

Test #9:

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

input:

100000
30619 15529 4854 9258 46894 29948 59533 56945 19473 7608 42291 95532 80537 83105 70434 68130 89221 96367 26768 43837 54765 52814 88446 14950 63224 63479 11957 41446 38702 8466 85556 57724 50097 29014 17961 65178 88627 96815 80115 79096 19625 2979 51033 68224 48649 96250 3406 96433 22584 79610...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 50224 operations

Test #10:

score: 0
Accepted
time: 834ms
memory: 69964kb

input:

999999
1578 253230 300479 227250 673195 324827 649281 5836 935739 543519 370574 305888 969960 550993 463132 799873 408104 207874 140152 331798 698935 749195 181667 828624 142806 789266 207545 870039 88700 189925 952818 455047 184020 276480 107352 733977 864792 660399 680663 667372 602838 139419 6373...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500707 operations

Test #11:

score: 0
Accepted
time: 895ms
memory: 69968kb

input:

1000000
498323 782531 234963 338622 390785 762253 966967 650745 444031 637738 473839 375864 760158 925355 805145 658434 838301 951908 714792 187771 333492 834483 290468 35807 254116 31487 26159 884256 313908 818120 709500 119492 905109 843904 538404 58932 917890 581026 96134 638691 37548 257661 5970...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500708 operations

Test #12:

score: 0
Accepted
time: 843ms
memory: 69980kb

input:

999999
380307 675757 926537 909176 259398 767547 838631 229565 814257 719010 465888 449344 456782 751637 748757 577374 757939 757260 82870 301760 266209 725256 913345 539986 247478 544197 565340 329703 744214 414574 459491 771016 89606 959461 978510 867975 914868 284295 827692 407590 902000 767952 4...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500707 operations

Test #13:

score: 0
Accepted
time: 825ms
memory: 70052kb

input:

1000000
172470 877546 84214 400887 576185 285780 444366 860147 679572 546507 239729 179884 641568 611945 977189 861170 861757 693499 814472 702031 255178 541730 195701 957000 328294 18206 94292 127407 263007 99562 518088 991416 202210 484246 231421 576703 773500 77020 699579 530140 726362 266475 626...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500708 operations

Test #14:

score: 0
Accepted
time: 820ms
memory: 69964kb

input:

999999
677199 527402 260278 378779 196676 500505 577396 576982 652450 128125 354892 561405 186110 561334 565676 844764 382506 305379 925068 208078 261826 38458 770208 575208 532632 190199 485712 280726 926898 155492 38167 609603 546994 379870 692140 671912 601918 200311 856148 602748 462185 21114 95...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500708 operations

Test #15:

score: 0
Accepted
time: 833ms
memory: 69976kb

input:

1000000
658205 878240 84096 393775 557729 717785 892649 547846 422807 378161 798924 644602 145033 110712 138504 956461 341742 765625 673610 342509 423873 129182 392707 32579 60070 466722 986494 956165 949960 516080 98315 228617 987897 101869 510240 75032 104837 57653 90089 361011 655034 87399 917195...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500708 operations

Test #16:

score: 0
Accepted
time: 844ms
memory: 69944kb

input:

999999
560006 626515 58664 838744 331899 741740 279578 478999 629913 502367 224087 372784 152865 636238 570022 4907 690160 662704 313958 835987 577073 39974 554116 608506 928397 237166 371458 131297 716305 127503 368310 291092 204051 919187 30124 574809 66145 667573 552009 969718 524326 38216 31718 ...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500707 operations

Test #17:

score: 0
Accepted
time: 863ms
memory: 69960kb

input:

1000000
170718 784810 674417 159793 189317 115530 524872 124667 363570 32215 429929 857870 786504 55147 260225 923095 230428 883443 620592 493326 858668 898580 49426 842887 324927 561607 693452 710499 436481 482595 832325 617114 614693 640199 419510 663725 273513 263053 841014 263727 372656 198411 3...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500707 operations

Test #18:

score: 0
Accepted
time: 874ms
memory: 69928kb

input:

999999
916422 888632 300041 567034 646896 723598 645143 497821 300002 219825 105896 178442 118885 995990 840287 12749 420928 906993 504111 435638 296923 141718 149413 62682 648366 511386 626431 2995 841547 689727 493661 425018 231433 521401 883925 802229 422860 288294 393191 26220 36803 46033 286602...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500707 operations

Test #19:

score: 0
Accepted
time: 864ms
memory: 71948kb

input:

1000000
46874 765821 886525 977705 548127 465831 540580 146805 506375 466370 168997 91537 183504 584871 197569 524930 989026 923955 624733 821306 59866 341573 53478 890358 290792 45795 848498 441703 988088 170699 262407 669394 988604 839083 947414 387735 667389 442038 238162 829673 242428 907422 143...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500708 operations

Test #20:

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

input:

45
41 43 34 18 38 8 28 3 17 16 32 37 7 1 4 9 13 24 2 36 22 35 40 45 31 11 19 12 21 26 29 20 42 33 30 23 27 15 5 6 39 14 25 44 10

output:

SPSPSPSPSPSPSPSPSPSPSPSPSPS.

result:

ok OK 27 operations

Test #21:

score: 0
Accepted
time: 150ms
memory: 12468kb

input:

999997
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

output:

SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS...

result:

ok OK 499999 operations

Test #22:

score: 0
Accepted
time: 122ms
memory: 12736kb

input:

999987
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

output:

SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS...

result:

ok OK 499994 operations

Test #23:

score: 0
Accepted
time: 207ms
memory: 58100kb

input:

1000000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500001 operations

Test #24:

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

input:

1000000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

.

result:

ok OK 0 operations

Test #25:

score: 0
Accepted
time: 189ms
memory: 59392kb

input:

1000000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

SPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSP...

result:

ok OK 500001 operations

Test #26:

score: 0
Accepted
time: 232ms
memory: 59568kb

input:

1000000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500005 operations

Test #27:

score: 0
Accepted
time: 195ms
memory: 56376kb

input:

1000000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500008 operations

Test #28:

score: 0
Accepted
time: 183ms
memory: 59588kb

input:

1000000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500023 operations

Test #29:

score: 0
Accepted
time: 198ms
memory: 60040kb

input:

1000000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500224 operations

Test #30:

score: 0
Accepted
time: 811ms
memory: 69424kb

input:

1000000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500672 operations

Test #31:

score: 0
Accepted
time: 32ms
memory: 8432kb

input:

999999
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

output:

.

result:

ok OK 0 operations

Test #32:

score: 0
Accepted
time: 183ms
memory: 56736kb

input:

999999
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500005 operations

Test #33:

score: 0
Accepted
time: 202ms
memory: 59376kb

input:

999999
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500007 operations

Test #34:

score: 0
Accepted
time: 192ms
memory: 59876kb

input:

999999
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500022 operations

Test #35:

score: 0
Accepted
time: 212ms
memory: 57356kb

input:

999999
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500223 operations

Test #36:

score: 0
Accepted
time: 764ms
memory: 71468kb

input:

999999
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500670 operations

Test #37:

score: 0
Accepted
time: 131ms
memory: 12128kb

input:

1000000
85269 232632 182463 141993 164612 185571 196834 27556 17144 41461 114002 223286 199965 104924 74257 11534 186869 93956 52714 49057 66612 84626 209949 70888 46558 179874 35456 159824 197676 205799 91114 167353 56211 100660 152256 9430 118528 232533 161318 5269 118930 15106 47536 88328 58944 6...

output:

SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS...

result:

ok OK 235314 operations

Test #38:

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

input:

1000000
96642 24932 138614 159073 210308 214096 62029 162505 29524 10221 179795 93890 122182 113556 153174 26998 213378 32623 49137 45538 36364 72485 49459 151422 60864 25672 205141 144863 226840 227484 35755 139439 211425 68185 9193 72790 201702 110595 59017 74109 137356 58563 87208 144275 138239 1...

output:

SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS...

result:

ok OK 235314 operations

Test #39:

score: 0
Accepted
time: 487ms
memory: 56260kb

input:

1000000
488727 426787 41476 18303 152740 280483 151820 20439 231296 248933 25665 194977 359736 251353 494229 58533 209539 64788 307381 415428 81302 318942 52921 450027 161512 307783 479728 332292 491479 118078 40988 365789 13780 380644 36344 428410 118369 202243 407866 286384 188600 312831 102906 37...

output:

SPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSP...

result:

ok OK 500001 operations

Test #40:

score: 0
Accepted
time: 527ms
memory: 59932kb

input:

1000000
334819 52725 117665 271110 25265 425908 422442 316644 211766 240110 156046 192692 440325 144648 60930 339780 189940 450040 255346 449859 34356 415080 427399 51031 438318 339684 445088 270339 130487 39687 497571 253421 40508 454987 314666 305585 410767 347721 341238 164648 434537 18879 327014...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500001 operations

Test #41:

score: 0
Accepted
time: 105ms
memory: 13024kb

input:

1000000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS...

result:

ok OK 222333 operations

Test #42:

score: 0
Accepted
time: 823ms
memory: 69316kb

input:

1000000
69926 66346 53127 49611 51808 15323 1662 17965 64803 12740 39135 17879 63554 11678 25924 8550 62668 86775 67631 17130 95019 58126 37753 8671 71567 28838 99842 81371 42211 10138 11092 85937 11778 43056 95400 28761 90723 66345 68338 54552 88285 66621 88205 52183 16456 99867 54204 43264 42151 9...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500667 operations

Test #43:

score: 0
Accepted
time: 114ms
memory: 12592kb

input:

999999
113883 1479 137441 182288 87293 53557 200692 186438 48482 98467 125219 173811 10205 33462 116418 2950 35532 85577 212049 198984 3811 27434 14699 115652 219705 68486 163618 202552 136274 139143 55116 194934 219242 95243 230318 166789 4837 183128 102 183772 79990 31009 173826 22828 193641 86533...

output:

SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS...

result:

ok OK 235314 operations

Test #44:

score: 0
Accepted
time: 124ms
memory: 12616kb

input:

999999
62901 35715 133527 162199 66245 219202 27943 24162 35408 227837 7214 169972 186885 189493 94865 219521 156516 100914 162168 149048 69857 196348 214357 103440 125144 68854 170190 141644 226852 221438 175614 117289 172568 130317 4355 32887 30202 72304 205461 116455 26519 221271 45957 191138 163...

output:

SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS...

result:

ok OK 235314 operations

Test #45:

score: 0
Accepted
time: 165ms
memory: 12588kb

input:

999999
202465 233679 342410 231389 159364 117382 24423 126719 260105 221047 150381 87993 233732 455257 31140 165519 463956 17223 281457 317060 36298 198189 32063 168156 186664 281805 461445 403833 92000 179294 261286 203578 148693 364455 477401 391581 436488 427071 331101 363849 168853 69197 42272 8...

output:

SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS...

result:

ok OK 500000 operations

Test #46:

score: 0
Accepted
time: 175ms
memory: 13900kb

input:

999999
145947 76584 434300 207762 44507 163000 135132 372250 377869 253108 414089 269544 322146 385288 209174 454953 51040 56455 112162 438740 318452 140336 7845 372019 82544 292999 365874 26832 345508 435203 192908 297631 111498 221286 327339 46835 420965 218211 304822 100406 272242 432331 277514 1...

output:

SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS...

result:

ok OK 500000 operations

Test #47:

score: 0
Accepted
time: 85ms
memory: 13192kb

input:

999999
45757 97696 82350 114214 40702 83424 96493 111573 95343 27563 122803 90435 35682 26082 60335 960 81812 56044 64358 29197 97009 95277 18383 116811 11397 12302 81822 8484 37739 69967 93435 1105 5682 93317 41824 90750 76127 76453 11493 76837 4820 64585 11974 112393 36363 1376 15483 71455 15138 3...

output:

SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS...

result:

ok OK 123344 operations

Test #48:

score: 0
Accepted
time: 802ms
memory: 69312kb

input:

999999
19720 10279 37765 56772 39058 29258 88325 89048 73408 15300 59280 37035 26203 26497 6920 72191 3116 6333 77127 44173 92633 63690 57594 84918 22187 2552 16670 52543 55137 75109 11653 66958 67597 18676 18323 62620 32058 80783 66113 48172 20098 20422 65878 48497 68794 86837 19878 7064 16489 8843...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500667 operations

Test #49:

score: 0
Accepted
time: 202ms
memory: 59720kb

input:

1000000
1000000 999999 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 9999...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 501000 operations

Test #50:

score: 0
Accepted
time: 212ms
memory: 56368kb

input:

999999
999999 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 999959 999958...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500999 operations

Test #51:

score: 0
Accepted
time: 193ms
memory: 59968kb

input:

999998
999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 999959 999958 999957...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500999 operations

Test #52:

score: 0
Accepted
time: 207ms
memory: 56136kb

input:

999997
999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 999959 999958 999957 999956...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500998 operations

Test #53:

score: 0
Accepted
time: 201ms
memory: 56684kb

input:

1000000
1 1000000 999999 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 99...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 501000 operations

Test #54:

score: 0
Accepted
time: 182ms
memory: 56736kb

input:

999999
1 999999 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 999959 9999...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500999 operations

Test #55:

score: 0
Accepted
time: 191ms
memory: 56176kb

input:

999998
1 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 999959 999958 9999...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500999 operations

Test #56:

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

input:

999997
1 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 999959 999958 999957 9999...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500998 operations

Test #57:

score: 0
Accepted
time: 201ms
memory: 58968kb

input:

1000000
1 2 1000000 999999 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 ...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 501000 operations

Test #58:

score: 0
Accepted
time: 164ms
memory: 58924kb

input:

999999
1 2 999999 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 999959 99...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500999 operations

Test #59:

score: 0
Accepted
time: 172ms
memory: 59964kb

input:

999998
1 2 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 999959 999958 99...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500999 operations

Test #60:

score: 0
Accepted
time: 246ms
memory: 59336kb

input:

999997
1 2 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 999959 999958 999957 99...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500998 operations

Test #61:

score: 0
Accepted
time: 202ms
memory: 59868kb

input:

998244
998244 998243 998242 998241 998240 998239 998238 998237 998236 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 499127 operations

Test #62:

score: 0
Accepted
time: 204ms
memory: 56632kb

input:

1000000
1000000 999999 999998 999997 999996 999995 999994 999993 999992 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 ...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500005 operations

Test #63:

score: 0
Accepted
time: 192ms
memory: 59548kb

input:

1000000
1000000 999999 999998 999997 999996 999995 999994 999993 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500005 operations

Test #64:

score: 0
Accepted
time: 209ms
memory: 56372kb

input:

1000000
1000000 999999 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500003 operations

Test #65:

score: 0
Accepted
time: 188ms
memory: 59928kb

input:

1000000
1000000 999999 999998 999997 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 9...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500004 operations

Test #66:

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

input:

999999
999999 999998 999997 999996 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 ...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500003 operations

Test #67:

score: 0
Accepted
time: 191ms
memory: 56812kb

input:

999999
999999 999998 999997 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500003 operations

Test #68:

score: 0
Accepted
time: 205ms
memory: 56652kb

input:

999999
999999 999998 999997 999996 999995 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 9...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500004 operations

Test #69:

score: 0
Accepted
time: 206ms
memory: 59320kb

input:

999998
999998 999997 999996 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500002 operations

Test #70:

score: 0
Accepted
time: 169ms
memory: 12720kb

input:

1000000
1 2 4 3 6 5 8 7 9 10 12 13 11 14 16 17 18 19 15 21 20 22 24 25 23 27 26 28 29 31 30 32 33 34 35 36 38 39 37 41 40 43 44 45 46 47 42 49 50 51 52 48 54 53 56 57 58 59 55 60 61 62 64 65 66 63 67 68 70 69 72 71 74 75 73 76 78 77 79 81 80 82 83 85 84 87 88 89 90 86 92 93 94 91 96 95 98 99 100 97 ...

output:

SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS...

result:

ok OK 499999 operations

Test #71:

score: 0
Accepted
time: 205ms
memory: 59044kb

input:

1000000
1 2 4 3 6 5 7 8 9 11 10 13 12 14 15 17 16 18 20 19 21 22 24 23 26 25 27 28 29 31 30 33 32 34 35 37 36 39 38 40 42 41 43 45 44 46 48 47 50 49 52 51 54 53 55 56 57 59 58 61 60 63 62 64 66 65 67 69 68 70 71 73 72 74 76 75 77 79 78 81 80 83 82 84 85 87 86 88 90 89 91 92 93 94 95 97 96 98 99 100 ...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500001 operations

Test #72:

score: 0
Accepted
time: 216ms
memory: 57864kb

input:

999999
2 3 4 1 5 6 8 9 7 11 10 13 14 15 16 12 17 19 18 21 22 23 24 25 20 26 27 28 29 30 32 33 31 34 36 35 38 39 40 37 42 43 44 41 46 45 48 47 50 51 49 52 53 54 56 55 57 59 60 58 61 63 64 62 66 67 68 69 70 71 65 73 74 75 72 76 78 77 80 81 79 82 83 84 86 85 88 87 89 91 92 90 94 95 93 97 98 99 96 101 1...

output:

PSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS...

result:

ok OK 500001 operations

Test #73:

score: 0
Accepted
time: 109ms
memory: 13008kb

input:

999999
2 1 3 4 6 5 8 7 10 9 12 11 13 15 14 17 16 18 19 21 20 22 24 23 26 25 27 29 28 30 32 31 34 33 35 37 36 38 39 41 40 43 42 44 45 47 46 48 50 49 52 51 53 55 54 57 56 59 58 60 61 63 62 65 64 66 68 67 70 69 71 72 73 75 74 77 76 79 78 81 80 82 83 85 84 86 87 89 88 90 92 91 93 94 96 95 97 99 98 101 1...

output:

SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS...

result:

ok OK 499999 operations

Test #74:

score: 0
Accepted
time: 187ms
memory: 59260kb

input:

999998
1 3 2 5 4 6 7 8 9 10 11 13 12 15 16 14 17 19 20 21 22 23 24 18 26 27 25 29 30 28 32 31 33 35 34 36 37 38 40 39 41 42 43 44 46 47 45 48 50 51 52 49 54 55 56 57 58 59 60 61 62 53 64 65 66 67 68 69 70 63 72 71 73 75 76 74 78 79 77 80 81 83 82 85 84 86 88 89 87 90 91 92 93 95 96 97 98 94 100 99 1...

output:

SPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSP...

result:

ok OK 500000 operations

Test #75:

score: 0
Accepted
time: 126ms
memory: 12216kb

input:

999998
1 3 2 4 5 7 6 8 9 11 10 13 12 14 15 17 16 19 18 20 22 21 24 23 25 27 26 29 28 31 30 32 33 34 35 37 36 38 40 39 42 41 43 45 44 46 47 48 50 49 51 53 52 54 55 56 57 59 58 60 62 61 63 64 65 67 66 69 68 71 70 72 74 73 75 77 76 78 80 79 82 81 83 85 84 87 86 89 88 90 91 92 93 94 96 95 98 97 99 100 1...

output:

SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS...

result:

ok OK 499999 operations