QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#26915#1342. N-by-M grid calculationWu_RenAC ✓455ms58120kbC++171.7kb2022-04-08 22:17:502022-04-29 04:55:02

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-04-29 04:55:02]
  • 评测
  • 测评结果:AC
  • 用时:455ms
  • 内存:58120kb
  • [2022-04-08 22:17:50]
  • 提交

answer

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int n,m,Q,suf[100010];
int c[100010],t=0,a[100010],b[100010],tot[100010],p[100010],tr[100010];
ll _k[20];
char s[300010];
struct ask{
	int id;
	ll d;
}q[300010];
vector<ask>v,qr[100010];
void add(int x){
	for(int i=x;i<=m;i+=(i&-i)) tr[i]++;
}
int qry(ll &x){
	int nw=0;
	for(int j=18;j>=0;j--) if(nw+(1<<j)<=m&&tr[nw+(1<<j)]<x) nw+=(1<<j),x-=tr[nw];
	return nw+1;
}
int main(){
	_k[0]=1;
	for(int i=1;i<=18;i++) _k[i]=_k[i-1]*10;
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	for(int j=1;j<=m;j++) scanf("%d",&b[j]),c[++t]=b[j];
	sort(c+1,c+t+1),t=unique(c+1,c+t+1)-c-1;
	for(int i=1;i<=m;i++){
		int p=lower_bound(c+1,c+t+1,b[i])-c;
		suf[p]++;
		for(int j=0;j<=18;j++) v.push_back({i,(_k[j]+b[i]-1)/b[i]});
	}
	for(int j=t;j>=1;j--) suf[j]=suf[j]+suf[j+1];
	for(int i=1;i<=n;i++){
		for(int j=0;j<=18;j++){
			int y=lower_bound(c+1,c+t+1,(_k[j]+a[i]-1)/a[i])-c;
			tot[i]+=suf[y];
		}
	}
	scanf("%d",&Q);
	for(int i=1;i<=Q;i++) scanf("%lld",&q[i].d),q[i].id=i;
	sort(q+1,q+Q+1,[](ask &a,ask &b){return a.d<b.d;});
	ll nw=0;
	for(int i=1,j=1;i<=Q;i++){
		while(j<=n&&q[i].d>nw+tot[j]) nw+=tot[j],j++;
		q[i].d-=nw;
		if(j>n) s[q[i].id]='x';
		else qr[j].push_back(q[i]);
	}
	sort(v.begin(),v.end(),[](ask &a,ask &b){return a.d<b.d;});
	iota(p+1,p+n+1,1),sort(p+1,p+n+1,[](int x,int y){return a[x]<a[y];});
	for(int _=1,j=0;_<=n;_++){
		int i=p[_];
		while(j<v.size()&&v[j].d<=a[i]) add(v[j].id),j++;
		for(ask &k:qr[i]){
			int p=qry(k.d);
			ll x=1ll*a[i]*b[p];
			for(int l=18;l>=0;l--) if(x/_k[l]>0||l==0){
				s[k.id]='0'+(x/_k[l-k.d+1])%10;
				break;
			}
		}
	}
	puts(s+1);
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 3
8 1
1 7 3
5
1 2 8 9 1000000000000000

output:

853xx

result:

ok "853xx"

Test #2:

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

input:

3 4
271 828 18
2845 90 45235 3
7
30 71 8 61 28 90 42

output:

7x406x0

result:

ok "7x406x0"

Test #3:

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

input:

72 26
3 313 7704 2654 3920 365 85192 38 453 94 2 4 850 71630 93379 355 451 75039 984 890 7645 852 7176 3 9668 932 840 360 87960 33040 25556 3363 9283 10 89 6922 75 6946 9517 2 53122 84 3238 8 489 54 42 838 701 40 437 90 146 8135 50 26456 59 19 58 43 75 91 180 1179 5 51 67543 1876 485 2952 252 7
1829...

output:

x9x7686288600x23227340525506096039x0148936413973912408810

result:

ok "x9x7686288600x23227340525506096039x0148936413973912408810"

Test #4:

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

input:

45 13
781 6770 66438 9024 97 5284 3213 43862 5 63730 20 7580 50 4 98937 6413 9 773 50 565 34 9 2863 9660 72743 32 3 1224 4 59496 310 89 105 55121 3326 2442 397 60 5710 850 5 5311 34053 29374 68840
26 76699 7511 22 53541 55403 3749 4 27 920 501 83393 171
92
3790 3789 1440 3198 1046 254 2277 737 521 9...

output:

x04276884012123615094622503388xx281x56702325x864x1805191037236451388594x46x2986443365x00x921

result:

ok "x04276884012123615094622503388...6451388594x46x2986443365x00x921"

Test #5:

score: 0
Accepted
time: 5ms
memory: 11108kb

input:

73 89
8 4 858 39773 54741 999 31574 3662 39 3 462 21169 560 8259 2 42740 396 68 9 4 256 82 194 43719 61 9 24 645 768 62 36 686 10025 92680 30947 67 49891 1182 700 47 43915 2723 48 60 5257 1545 95 72026 652 4918 2293 1086 468 81434 695 1 8409 11 42 35 321 25 6 122 399 9 3278 816 74 1 30 99 54066
8498...

output:

x283x3002414245x

result:

ok "x283x3002414245x"

Test #6:

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

input:

52 23
418 45 86 4 31 99908 63296 883 9334 54 908 825 750 80 1 260 90762 462 9 22 269 100 724 629 2 986 8 39 4 2512 36697 1872 2276 229 20 418 306 42 1 96485 18511 67513 10 9411 20439 373 861 7522 2766 6940 184 25051
559 622 7 914 421 3543 496 43 195 430 468 19015 74306 362 39 13213 4 2 6 8334 65 101...

output:

x6x9276xx4086x77x7223401x88

result:

ok "x6x9276xx4086x77x7223401x88"

Test #7:

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

input:

83 85
50 84634 9397 617 89 2 12032 96 2046 839 2 80199 214 27684 42217 13018 42408 5 52789 987 925 11047 2 779 379 81831 694 83476 2 8 65 36 3 93 3 271 77685 20 74058 2295 479 1871 72 72954 7728 6 405 9881 365 33586 3 122 2053 48 7 4846 10 419 56628 93 41151 832 841 32 63 87 6 23151 9 5925 18 662 9 ...

output:

x854683x185770816898519x70150159x02147x840032790410x8849654436935753x9151905189xx98

result:

ok "x854683x185770816898519x701501...8849654436935753x9151905189xx98"

Test #8:

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

input:

58 96
71247 8353 9262 64463 8 9638 8 9603 84983 3 3 2930 4232 11023 1 5 20 85 541 880 40 3 17352 375 40761 8812 3184 6 6365 1 8 8 68 80 73 6 6261 22155 28396 90 3 8 679 79201 79 5 4940 1 7521 545 1 85 5 759 88898 8 32 6717
6056 53614 55646 82194 541 31 3 6607 10833 25 46 8745 827 27 325 83 36 29190 ...

output:

x028601242694x87088x34xx9321226090467330138233x3x4264x1x58473174917602

result:

ok "x028601242694x87088x34xx932122...0138233x3x4264x1x58473174917602"

Test #9:

score: 0
Accepted
time: 5ms
memory: 10188kb

input:

82 19
4 69293 64694 7 7 378 64 42001 15601 24 67 55148 95 509 7 7866 85 675 41648 41 1584 98923 7841 20 941 53709 115 265 38 68479 3 7 432 741 5719 875 349 1652 1 8 15 287 68391 9 41816 309 8874 943 44488 974 66 24705 22 55 7 38 5401 806 59 8 35479 6015 7666 11378 1 7835 156 29 53107 21 8582 36 100 ...

output:

x004016232716224716079x998838057192317917057130586581835x24x81383406813301x735839962794456414x18374

result:

ok "x004016232716224716079x9988380...813301x735839962794456414x18374"

Test #10:

score: 0
Accepted
time: 5ms
memory: 10872kb

input:

89 9
67 5179 2987 6657 87147 1743 495 434 307 6 10 47237 4 444 671 5892 9550 6369 665 43952 47339 94181 15 233 10 73852 6 489 83177 2039 601 84021 20031 87 156 564 6 100 308 2 137 100 2811 9 8 4 2 25619 66257 16476 947 9 10 9751 932 12 5 64132 26 73891 9 36976 334 9 9973 9 84 1 25004 8089 41 2216 16...

output:

x04090082370x87xx2839801348863350xx6151412x760019848428758880354560074450679170810164x080144925x

result:

ok "x04090082370x87xx2839801348863...60074450679170810164x080144925x"

Test #11:

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

input:

74 79
23 853 29 939 2 20 10 21185 1 8493 8350 17542 3 312 1 63079 90 931 95 8 25 3444 7 4084 2536 764 78 65395 28188 1873 3784 72951 69 35160 9681 8 7553 995 4112 9496 42 15 10 9455 7 9526 83906 88673 78 334 4297 10 4 5501 86407 778 27 86040 7345 49 9 8 4 2 545 9 7 673 43 8033 5742 8 8 7248
86 8178 ...

output:

x4041139x03402771321708914x86381810

result:

ok "x4041139x03402771321708914x86381810"

Test #12:

score: 0
Accepted
time: 5ms
memory: 11652kb

input:

42 91
569 51007 348 1292 77515 25 54769 6 7370 67915 26759 3207 3182 24 5550 660 6203 779 95867 74 21807 86 518 4 3587 5891 8784 10 4 3613 47881 72 4 93 6 7 39 7 1 1101 311 817
66931 1 51 148 228 57 117 2 4032 578 247 2103 4 39811 87763 64 52 96328 10 919 9 44 68199 38 1956 43 2 8232 44 2689 7216 38...

output:

x171807698146865x52882267890983x394015x99257

result:

ok "x171807698146865x52882267890983x394015x99257"

Test #13:

score: 0
Accepted
time: 428ms
memory: 50268kb

input:

99955 99911
785660006 701 7442 460674810 677936453 447584 12503 5330 497261209 326 464859182 11 244 30559909 23014 170 4499 767 7211786 2302 21454 625732895 16144645 30399 87262366 84 2408300 294404857 65644516 523 41653095 8834 10 10 30815 930285593 3 8492 91602565 84 2186 41299 8146587 5561 721970...

output:

x7946x960100x3xx604x7x924136486x89050xx0763x7370680x69822804025913722862x7325325x2750444154823052x843x29x525111x90x1108055243543991386x5435750912140551462229332874285663155xx19136229x308121357788xx852897368450773232739x35x4624698677243x83687100x9236x8524x695854x398845511922963432x190236703333x206206...

result:

ok "x7946x960100x3xx604x7x92413648...19x526013x24x602442618966339819"

Test #14:

score: 0
Accepted
time: 440ms
memory: 50640kb

input:

99914 99919
504 963802080 707 367466222 944 323668 38112 171055868 83 86368957 329 37267666 48 3 43460714 24965672 7703374 35215315 600 703 7964 66634 10 973507590 688 3319 51 864 59794984 310241 880361 5 4665 47 69 7247 73444262 83575 4664 3 570783265 71780332 73019720 2893 3082 332 414 72460 30136...

output:

x37114x09159549424517x331214962066511x7626x73225x9820172795x2132x534382809460801105x855283064095488585372448524xx1299429203785148297x941x176064x287x952305262272x087803x69385x30474326907x6149015x1269842xx36x7566x4830812417438563x8974562x8654034057398193202615891x742x90015450336353668728x58x8659445x19...

result:

ok "x37114x09159549424517x33121496...x439x59768xx0422930436891460021"

Test #15:

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

input:

99989 99901
8368 922324 16848791 68 978686366 88700 99186 330795295 5152 662830605 859666658 79802 973027 92715529 4 9 143108245 29515 45 2 242578 625732350 9477493 3958 932094209 88939590 93816113 30276987 3907303 727413795 169584613 54045 4 1249 68 5494 410561 289 771450 879110 6 6 83594 20285274 ...

output:

x07941467x831038109x74x5482023202101x38900107387383805481403904x6611863417x2x6x3x80064502x926110993534352203227288433x7151960925959865048x8251073052786394139754xx03141x468071814737288772674195093690250xx0765x8609923x188883455x129189x95x055x017199043181926742370909923xxxxx85138xx924970x34274901231637...

result:

ok "x07941467x831038109x74x5482023...x20738xx01996275087523137537503"

Test #16:

score: 0
Accepted
time: 455ms
memory: 49884kb

input:

99986 100000
8 7453380 724087023 395812609 74051 9857 69 297657110 8068664 284 93171 90 41361 748 32510 64680 707305 386 782274956 34 9580766 21151125 7690 2 393866 15171116 9361 36795 34 4083 171 14046 1 73043 290 914 2443080 79629628 46987204 34887 8331 44 743010175 6599 9450008 6774257 597179 720...

output:

x81268x353004x516637183277x514554452xx9713600106272x4x460x018102160x3946300302556x353322376063x8817399xx815261380338x40x0354682177322965xx269220931823030256081261x2366887981641668513482x2x25364x20023x3609x2x44880x449xxx4112715xx521703471x818672x40036xx5426132828x7421504796922346524404009640596228024...

result:

ok "x81268x353004x516637183277x514...395155x7320x04x93x617996x921271"

Test #17:

score: 0
Accepted
time: 448ms
memory: 51336kb

input:

99944 99992
17043077 676495 93583027 708 89291 351968 383334208 328697 6855 32 22313 25512 999 459 6930 975675746 385879317 30284 26 668274315 852 93 379196388 224647899 88 86 42830577 563580780 2960 9175627 143951373 3927 674 467 3960 70249 37621434 4 832 3926 60777 930 9448 336 9362970 7315678 329...

output:

x65020542716039x808x6786x9573024366216036023492x655xx5941123741133537406557x3261785790172906x201821314109130010431035044214561x2671080535xx381032x9566384509x5905567341772x5x64x551293xx2x1xx64194731516814333x1086x0x08415143805430479x13x972x3416738x765078x63973xx695422372754285055158837844x33511181801...

result:

ok "x65020542716039x808x6786x95730...69329613937490904426x4868657124"

Test #18:

score: 0
Accepted
time: 455ms
memory: 49688kb

input:

99958 99987
666672166 910 83265188 59657200 127906811 71923705 92 14069 7229 2 661479 722968627 361804 1446 8866 96897 37906350 42100 4108540 6700 7682442 750320907 16 72000028 7349625 68414 6358154 2983956 23886 14 76921 6923518 74283902 73964328 34 4716054 97412 490868 45590 67 8074 19120 2511740 ...

output:

x059435120519995848272961xx02666764549x552x717968x566x286179923651172989647x221201967034x2x7253057738x35x69x27x978809552334810051486568425266258x7595583029063xx2437x089x595145350042040038306344111x889078112152071840760x422x1802810440557631199506x5598457320067722457x2682485842310198570195064281775x48...

result:

ok "x059435120519995848272961xx026...7624x979322633590x5562506248x3x"

Test #19:

score: 0
Accepted
time: 425ms
memory: 50888kb

input:

99995 99975
65 49483917 74909681 8410089 62580 548173651 929309 57853290 4226535 6649822 501116 731289 8958301 10 310083105 40682 26270192 43921479 1523139 32842218 8827480 1697020 4141581 785340 76 563 722 3761 72884 56110202 182108017 8020 80029 996 10 1424 8 10 721306113 8457943 67 54983692 35600...

output:

x05x409x251077863x3x270x99650398076x516064463x0881014xx785597219194996x996x7751x3817x5834753x40x751861x289061645255588433500371134530867600731453509658600943x462718846x72073x2499916x228247298666x5x8067902951344557338x9730569649727665420x1426721012342224669x3022848370x0428302872xx144418223739496889x7...

result:

ok "x05x409x251077863x3x270x996503...76383x6x41x03720394593xx6553409"

Test #20:

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

input:

99967 100000
252624176 499810 555842 333 81 93 8 848458319 8676 295 18 93956 36 9534273 6193700 946689 96771 40827 2892 651 76771758 31722753 821 25772 87761633 4104 497223086 373891 42177193 66875 53 88 63 893 474914563 52 45397183 9511 170834091 41899614 34660 842697893 16073864 5512 146635880 639...

output:

x03539984xx974x66x7814091272072742115712775570095446380639592863x14943656796x006641720045758419450839056123x578375224000053241188x0656299868027910368731932x569355873935244100552x003x428x939812169514x4088283283864301044924405785990x72422027432041555589x1091x408630415648741xx2841778x610x8x88x414596800...

result:

ok "x03539984xx974x66x781409127207...6055x8602x10184963x7x6360192692"

Test #21:

score: 0
Accepted
time: 422ms
memory: 49932kb

input:

99962 99982
360551584 93790707 17559 21 7 6109094 7 54795 988031 1685188 564137605 371 60413712 638 277666859 7362868 75178496 560243 390 56 5767 18804 909 267 3066828 518 87433843 5866857 9651 38410 14762732 6715 2 18105524 22358959 43001 80193 79 90748 689048 3 5479448 8 726 34793076 94946 608 216...

output:

x170033828122821571121597x956612449220794153307x950823x106988027265811x501x087475x499x94x854718733816xx4400x24x80257634119117435908863x7787778384702933x918x73785030x33x2640xx699744xx96602684474586x04x98222x591xx3976430125168867544838xx58x991331xx988552418766892655515778x3x566x87517515354428900616x71...

result:

ok "x170033828122821571121597x9566...0544288x286xx5626980514x53899x7"

Test #22:

score: 0
Accepted
time: 432ms
memory: 51116kb

input:

99943 99950
71704473 98768 6 3683 772553 5022 208874 2 77749306 997382 6 102 352725488 7 2758524 70783435 800345 6 3541417 712 18272 92526623 78031926 98278653 22 26854604 510760560 5364970 10 664922 111793668 34326575 497456 902354 1175 8481053 3416 914317656 3 29885468 36 139 796803 206997 675 842...

output:

x85x9022434235146912145692913x38122x28953671x3x18732186xx4139961958005154x138960097x53454253456351400275207384411491372733796x37733898x66419905900722368030309x81xx912x061x3101427549216x046474945597890552140252121421410638084435610308509530519322796374286648441273036017530432x862007198228804089451242...

result:

ok "x85x9022434235146912145692913x...36659417496226230791x76404854x0"

Test #23:

score: 0
Accepted
time: 427ms
memory: 51092kb

input:

99959 99910
62 1732636 48834 4774 2 5520138 1810 3090901 87570 8 3 93205979 47171311 890327 5 496683488 28 240 713889964 741272 78951 384 8 4062076 91034 479562241 35965 840 56628 2781783 91 5200663 251 12696056 994579902 955257 13054 733266939 9 202 6 727738 969 59390 8513 49 1 47866923 26 404 9780...

output:

x34093734649929x8619321573x95x2xx4508096949933xx27x6x911448x73652747551x80341x87x01595931xx221988058427x17601x41x46x38383129990304867176482810683xx3730586133694138827177079891324x3250x13x9192321653402x417x89226201992419264264521x36631922893x25582632x9190553x473966450254844947221961864198x59790554216...

result:

ok "x34093734649929x8619321573x95x...9x4x9113044437x43692x1871257934"

Test #24:

score: 0
Accepted
time: 432ms
memory: 49428kb

input:

99909 99934
7126 17026199 8861 32 9306 54 37064711 6132352 43 93 659 19 32613 4 7163 142364 824880380 63 48173 73747344 68805 2787 6 814635 38499 56081 5 71041 143 90 443104 47226 553229338 110637052 100 7 73519327 1 74275736 235808448 205337 59822 5 6466202 29 12564 3595 345510 44 700354917 932287 ...

output:

x1x3xx4x02x573502xx400026302939879x695862681735x2x169348x714918143330057664562103x95x656823647x02x0543x7x812000053x212x4769450402118x27201544577529222176x42xx924922243x0250x32178260x40424341891530895148119462382111772469x51x00408571543x411432496559699295x8x473265451x4699554927x4045546212964760691625...

result:

ok "x1x3xx4x02x573502xx40002630293...7x2412x045x2206x1x3468032413846"

Test #25:

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

input:

99959 99996
2311 815094 5254 1090044 85 668165 373 455 53724 82 94532184 137170893 77 13269 249 692 91270 1 5787623 1751 84095934 51 47 4 9788273 45077 90 986 8724485 60710 10 71993591 9914 1 75 7 10 495976122 10 57984 3798152 32967 5613017 4 9 43325036 475 85216479 422703013 95095 2790 86881 3 79 2...

output:

x07xx0276862x4368084812x014548xx5x7106x9523399x5x4509x416969x9x6435905275559x2247453986628938822389x196x31154803x820521x9364146641196x204x261x816393811270x6x2611447434734668x14401853458191x298053200108294292245156579x8x65501432810636259634632728435307630437580xxx0x9506012x516x874705941x747xx32983933...

result:

ok "x07xx0276862x4368084812x014548...0x728328x04x5194871025565177386"

Test #26:

score: 0
Accepted
time: 449ms
memory: 50600kb

input:

99904 99985
72308848 6509258 881340533 6068524 26 16092 929539 92645 5582 8 79 19 715 9153 8273025 663 11002752 7049 16082 2472752 819128411 8859 4388 8 39 251 9773 14461525 215 6075 973844746 2429578 76 5811961 74342205 92317510 2825 2051124 950 396576 2 556525 160974686 306205056 8557646 74034 701...

output:

x69x408135014025160481528286x9922519892994381x67x13x5x2x1211xx312713463889161652x44008050233x2x0391833305x6589674366x24068295116x5x10xx416051402442408x461x405x89743681x001246366595930855765x98664375806127315828x2539189701561x963x1428211x22x26361x1319x78356x6055030522540251095907x59104761767x40697474...

result:

ok "x69x408135014025160481528286x9...117119928166x45x013220164924664"

Test #27:

score: 0
Accepted
time: 432ms
memory: 50808kb

input:

99982 99993
58 707 9683543 62490 42 9557 133612340 307848 2 9225299 79 286809542 50 92990947 352294499 1 5 7712051 557262605 241351 5538270 8 2112471 650661 206 523695 2572 97923013 8015 3 9933387 95463 144 516589 9233 10 2280969 344169455 1034 73 7712 53448154 250175 693701 2 19414 110 48 97826671 ...

output:

x779x011377x14980x810x358x84153x81x2xx3036459164322823351x6096x2642245546x633x3x750429826100x942712x38163858570x54346942421512443515x23298xx73xx51804014x126xx646711246421047775846253882x02224778238137548402848022x565865x742406x242158371x00x337140779143990731213340046013012387478728336987305661250x98...

result:

ok "x779x011377x14980x810x358x8415...x6840489801789x033270596516x036"

Test #28:

score: 0
Accepted
time: 422ms
memory: 49500kb

input:

99992 99904
4736710 646474 2234 10980630 44671 441928233 1 244608 840570 65211718 3026037 499731 52 20579435 346 324 526 5293412 4 10 208768675 3 204563 156312 1 509306348 5573579 6941 57524908 80933255 89220208 3971328 8587536 147036 539 1 8644 790011894 11761303 2533041 25 704 67 64674044 856 6329...

output:

x4681131092237208x5820x325935612045496632x57939239400575645915804272xx745513x11871129774xxx036883x1692x1213263187090445x70909188486084364156263892x2503377495968681x831752320187647616400089206225814x8278x672x300097781693x61688151x7737353333788585496xx99x713614662847x075788x11794x55089015081952340x314...

result:

ok "x4681131092237208x5820x3259356...103128x149116113847812402802563"

Test #29:

score: 0
Accepted
time: 423ms
memory: 50556kb

input:

99920 99967
4480884 75837984 6130940 803274337 73 4224 649366455 3570857 2260 7584 76 22 573 566421329 288911 688 213812 99 7 9642 436024093 920408 9684060 561338391 3726 33227512 6380 36 6 73314644 66061 4 3153 5074 2845402 3092975 96 826 60265 874731 3999002 35931 9553 14117392 604376 6738 9614442...

output:

x5257474712743403947859499076936400450x873261289297904419180x418250332340x6415028366x9468xx210752x34283x266454778x2067x1384x3293533x0224207x19118x43470x778326804097258xx0x612265732x214233057x84149x0988848453679508x8718x704918x8563171470747x71585335547x1x6556280060040x128343xx4182340x44956436x707x792...

result:

ok "x52574747127434039478594990769...8658865536413x4xx49531192820072"

Test #30:

score: 0
Accepted
time: 434ms
memory: 49340kb

input:

99995 99901
819958 620 4782715 2598 3 77 63788604 271 469 1525 37291037 73721665 133042 89867 68 342875 2900567 93 89456900 2947849 3 94297572 715388034 91 535938583 2013042 838548 63881 20903085 7067722 4 71 186596513 48 226 746 93 25936030 6732121 65028168 2395 74957021 3506 64 864456444 20835876 ...

output:

x4x97341010726138x1x97844859x4x6894093594x630799626971x2574864520927x26612862840794x087196338x27264979721x211731605x79752979322612894366671x93414x671102171262x2428x00x93212x7083899559818775x812182x8635750504977095369x80x003485385x23409x3522090x10x0327580984824x272144241173440226x77795572x0872151x086...

result:

ok "x4x97341010726138x1x97844859x4...01708559414x6253130544702823x65"

Test #31:

score: 0
Accepted
time: 438ms
memory: 50104kb

input:

99952 99963
918 8740083 37729127 296 64729 49502367 6964 35 3569 41 831 869186 8801284 48 19919804 16222 886434255 185 851741376 2479046 8067 166856 475094204 253413 2 821 2606 46114 28883 345982 124116 9153 5526992 99306 5754589 6 960 526203339 210 58162 374270772 6946347 344971927 21 35 57186 483 ...

output:

x07093042532369107243077622086867x936473x2x226865176332746107x0344230x060574727022512436x7110727763869x169296999372x05191x3276x92125x0687x074464950112923524897x500995582673542619121x2234132302035xxx7x740688503779137105x509627662107702802xxx6742x0798861xx68x570x026575732x489818940x2x26x230155322x2337...

result:

ok "x07093042532369107243077622086...8x28322748608043938499x54582149"

Test #32:

score: 0
Accepted
time: 447ms
memory: 49516kb

input:

99907 99929
49169802 60041350 5651973 253 94990 386342 6271 17 5958529 49669929 136342937 657 7843 1739660 6617458 4093 79267808 48456689 17642 11 57515061 979689 7625656 88420 5173076 78 781 50 2278595 647 237481 25 33 802 68707950 835 10 583822872 9 2820 87830 90 818 18 663526703 355616 811 47 758...

output:

x0x987853x5x5x755839421149334029017522887048x697081757327262348194x9337318206xx4715878440814xx18603742938x2008x264110x4878666473006759xx950x64x258xx36480750188189176985379017400407119586x493x8225x220336094655509301110531361441xx260032935981603x347766x8076110x1281xx1x971054664911123139037861874039206...

result:

ok "x0x987853x5x5x7558394211493340...x891833038261x97x17917067x5x424"

Test #33:

score: 0
Accepted
time: 349ms
memory: 49380kb

input:

99960 99910
21 4241 42901 65 41 4324 428548 381 42858853 4293 38 42903 428588616 42858859 4285923 457 6 428588631 4285924 4293 4285852 4237 460 4251 402 42858889 91 428594 4316 428588646 428573 61 4248 4253 474 428577 42851 42858845 22 428588589 4244 437 4240 4335 4246 42902 4285887 42858816 54 4285...

output:

x545209271xx96441407671x001375953338555x99796046088051x60678517998619x4xx2x16x56364577x0990991x69698089730x9x0413612032882727x61712841979209870900903x03180897407x9xx824807xx011192899043079405197406x4x4409xx09190x15337089285156x69640686880745150058012x4156x8387xx26x520096x0662821605022461x7x802866894...

result:

ok "x545209271xx96441407671x001375...0799x929793855x802904058695x323"

Test #34:

score: 0
Accepted
time: 361ms
memory: 49580kb

input:

99931 99985
46972454 4697225 46972527 469724990 427 4697259 4666 469699 469724975 4742 9 469770 449 468 504 501 469724905 69 489 469675 7 10 437 38 4697234 42 41 42 46932 4696 508 73 48 46972538 469724968 4697299 46999 46984 16 469724972 469724962 469699 46941 46972539 91 7 44 48 440 46929 46972514 ...

output:

x0808415x1x690469x043112929358x99000403992760980647940x5196x173642091509426x0x56918086060x6x46698691193014149111x9x9x31932897709225x99693232391053544250x14195148099868719246909919259672x00738022582x13300915917108410731x019430735800896x90963x40997x200119498045699x31x6x7228494964598701x05279x39x221990...

result:

ok "x0808415x1x690469x043112929358...0091995066829927876810408372x37"

Test #35:

score: 0
Accepted
time: 358ms
memory: 50976kb

input:

99920 99936
7 54122306 54122355 5395 5398 54122352 1 53 37 5412279 5376 541211 541223365 541180 541216 5412210 1 102 54122311 76 1 516 5376 54122340 54122321 54122299 86 5421 54122342 52 54131 541223434 54122330 527 54122353 546 568 541273 36 54078 54122373 541223443 5363 56 5364 536 54122382 541265...

output:

x0614525134x32x709436621012106x7x8540x91550169094090704850086640708x110641816418x4954333779366612400920x45994x9x19009153x066054700828123473503x09255x9989xxx09019140x051x7949x20x9922517798111036612x519101985903880802x81614328899051661x4491x06783920056285xx992606184528x93258x0598280846080814409xxxx055...

result:

ok "x0614525134x32x709436621012106...54x80222674004088489x5863390068"

Test #36:

score: 0
Accepted
time: 344ms
memory: 49380kb

input:

99972 99927
382189413 1 38213 71 382189480 1 382228 382230 3846 3821880 35 3799 382189467 382189468 381 3829 3821864 3821931 41 382211 382189406 410 38218949 3790 3821865 29 3771 38182 3821857 3821920 382237 3827 3821887 1 413 3821849 382217 3789 38233 29 3821895 38218984 38218992 3787 382189433 381...

output:

x593073394x9002x95x129x3x6060592819304x970316x95397913984757x8x100349524x96x302739621975911x98465x9x290984800038541261x0169x085095187158121996129028x063129083466x30659394069561916674899x974x98670182870070090657669399991450953x909079699199391883685600090804895602x1940981560902362282690013980084821780...

result:

ok "x593073394x9002x95x129x3x60605...1082294x9x640839207501089164119"

Test #37:

score: 0
Accepted
time: 352ms
memory: 50072kb

input:

99949 99924
9520 9569765 991 9569762 956974663 95697430 956974707 915 9569785 9574 9569792 9535 80 95697490 952 956990 48 956945 956974682 953 956974711 90 9522 69 956974703 1 9594 956994 956974718 959 9569713 95697454 956974705 2 95697436 9614 95697490 956952 112 9551 1 9599 95690 1 95697484 963 95...

output:

x8557668x191411994496467790040040829961451575397x4849695x63492760x18x6x31683192408x470507x2576449289xx663xx18941527502691x990250049x64x8958941068x067340191x98350909x3593x8009582x41520359618952498x8691x50241599x60099852519793x93x4100615554090888397290611437861977989xx1153x2xx9179792681x142xx949249455...

result:

ok "x8557668x191411994496467790040...51x660904274x10409960360873x720"

Test #38:

score: 0
Accepted
time: 353ms
memory: 50596kb

input:

99952 99967
42 299835 323 1 299915 324 299849 2998678 46 8 3027 47 299877 29940 299871491 21 329 299856 1 299871499 67 2956 3043 2998676 1 29987195 261 29987118 40 29987133 29987125 271 299871540 3044 299851 253 29987110 299905 29987188 1 2998708 29987189 2998737 30009 345 29987186 299871553 299873 ...

output:

x3210100046828501727944821695x89x68961232x2899910x1x118459x5x900686x101764994020391166424295086000490683x071x30405332480275519x2480x8082377930x77132911105870915x9269736112371216095x70317241625014973776884895178991x1x8x6499x934x3058934015x791x10085041913915292652756081448892432822000x8x28x6903720x083...

result:

ok "x3210100046828501727944821695x...6830753079071921051xx099672x392"

Test #39:

score: 0
Accepted
time: 353ms
memory: 51080kb

input:

99963 99999
596 41 34 596788248 596788296 5981 596788230 8 59698 5967847 59678 1 596788290 5967874 59678783 596785 59712 565 59678806 5923 5967929 59678844 596828 10 1 573 596834 5967886 596813 39 59686 5967913 59689 5980 59678855 14 21 594 5967874 596788302 5948 596780 59678809 59686 596771 593 600...

output:

x56742848065678480315943973581x182x95009208137460730909659051x984519280839070700x904490x91185x83590762689x1x214952040066550591xx89025859583x49292481698x1702352720305539264195527638649324299062287x272698x6157632114x8950034991026x91634599x6458223089049548082316x05957273652380520020916371x9680x30x1x941...

result:

ok "x56742848065678480315943973581...x1111795x890870392810x081354084"

Test #40:

score: 0
Accepted
time: 367ms
memory: 49928kb

input:

99960 99930
80 46239 462265 436 414 4669 46251 462306 477 58 46226066 4631 1 4599 462289 1 4622654 420 56 37 4622654 462225 462215 503 430 46226134 46246 1 7 4639 4628 72 36 4602 462261165 458 46226157 46198 462222 94 1 459 462261176 4656 1 46219 46197 4622653 60 462261194 4622629 66 491 4 4622621 4...

output:

x0816887597674577x58129208x792604x0132944700x01021x95388264826954180x546x46x04086577x81052405340008864x790194x4x972279x68530591x74996xx22423xx69xxx67320018081x704424589643919919167161236594637xx0099x8011230125x960079000841701402600794x9476781xx888036807225x29xx55x62115509x9711239675819428x96458x4xx9...

result:

ok "x0816887597674577x58129208x792...9x8x629900093460592x004154843x1"

Test #41:

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

input:

99949 99928
82 85202185 85202148 849 851993 852021684 54 85202140 8520223 85158 1 852021685 66 8492 1 852021686 852021700 85226 85153 8520218 85216 8547 851 113 851976 85187 852021637 812 111 8470 8547 852021732 8520190 85202166 852021677 135 8524 8482 852013 106 852016 854 8520188 848 852004 852022...

output:

x0x5493x0143506306349167130847x7x7011430509x058888802928x71159294393004x239597379x406905099963x8x8x1198xx64232566x30x0392201x40x8596498912x09908xx66x41770990230561x4088090228x7943xx8903504599903399052099x6978x0768x697x414199x609x27x5x41x428010173647008xx4935x99503557111479802989951193302061245166118...

result:

ok "x0x5493x0143506306349167130847...4249183941909xx790196239x418726"

Test #42:

score: 0
Accepted
time: 345ms
memory: 51088kb

input:

99913 99962
8348542 834858137 8348605 826 54 834858081 8348569 83485808 1 1 8338 834858083 83490 83495 858 133 54 815 834858139 859 8348535 11 8348591 834858069 8348612 8348557 834858103 797 819 102 49 83525 813 834858072 83485859 8348569 83487 834822 112 83485780 83530 83485816 814 834858068 834858...

output:

x89840x41312984xx88756x96571566x470x3390881625410298198x867199319636706018x89886225421000049254314092732x57022109274193854546312081982917103x08877101565508791208936120069412x90x843935x830901160960720658x97x0x06x1100294703108099x0296x016671x0409970x0913xxx06x6519899906038xx75xx990095x2584x315x098x4xx...

result:

ok "x89840x41312984xx88756x9657156...7200x75481x90059x06x910002x999x"

Test #43:

score: 0
Accepted
time: 295ms
memory: 49768kb

input:

99996 99962
10000000 1000000 100 10000000 1000000 10000 100000 10 100000 100000000 10000 1 1000000 10 10 10000000 1000 1 10 10000000 10000000 1 100000000 1 1000000 100000000 10000000 1000 10000000 100000000 100000 100000000 1000 100000 100000000 10000 1 1000000 10000 1 1 100000000 100 100000000 1000...

output:

x000x0000000x1x0x00x0001000000x011xx0001000x000000100010000001000000x00000000x000000000x0100x1010001000x0010xx0000000100x0xx000010001000100000x0100101001x000000000010010x010000x000x01x00000000000x000x000x00000000x0x100100000000100x1000000000010000000xx0010000x0x0xx000000000000100000101000010000000x0...

result:

ok "x000x0000000x1x0x00x0001000000...00000000x00000x00x00x0000000001"

Test #44:

score: 0
Accepted
time: 301ms
memory: 50604kb

input:

99909 99984
100000 1 1 10000 100 1000 10000000 100000 100000 100 1000000 100000 100 100000 1 1000000 10 1000 1000000 1 1 10000 10 1000000 100000000 10000000 100 10000 100000000 100000 10 10 10000000 1000000 10 100000 1000 10000 1000 10000000 1000 100000000 1000000 100 1 10000000 1000000 10000000 100...

output:

x0000000000000x1010000000000000000000101000000000000000000000001000100001000000000000000xx10000000x0000000001010x100x0x00000x0000x0000x0000000001000000100000000x0x00000100000x000000000000101010001000100000x00x000000101000001001x00x100000000x00x00000100000x000x00100000xxx0000000000000000100x000000000...

result:

ok "x0000000000000x101000000000000...01000x0000000000100001000000x00"

Test #45:

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

input:

99943 99938
100 1 1000 1000000 1000000 100 100000000 1000000 10 1000000 10 1 100 100000 100000 100 10 10000000 10000 1 10000000 100000000 1000 1000 10 1000000 1000 100 10 100 10000000 100000000 10000 1 100 1000000 100 100000 1000000 1 100 100 100 10000 1000 100000000 10 1000 10000000 1000000 100000 ...

output:

x0x0000000100x0000100000010000100000000001010000000100000001000010000x000000x0000010000000x0000000001x0x0000000000x10000000000000100x000000x00000000x1x0x0000000000000x11x00000000011x001x00000010x100100000000000x10x0000010100x0x001000x0x01000000x0000000000x00000000001000000000x000x00000x00000001xx000...

result:

ok "x0x0000000100x0000100000010000...0x00000000000100x000000xx000001"

Test #46:

score: 0
Accepted
time: 301ms
memory: 50868kb

input:

99963 99956
100000000 10 100000 10 1000 10 10 1 100 100000 1000000 100 10000000 100 10000000 1 100000 100000000 10000 100000000 100000 10000000 100000 100000 1000 10000000 100000 10000 10 100000000 10000000 100000000 1000000 100000 10 10 1000000 10 100000000 100000000 100000 10000 10000000 10000 100...

output:

x01000000000000000000x000000000000000x000000x00x00000000100000011x0000000110001x000x00000000xxx000000x0x000000100x0000x001000x00000000000x0xxx0000001000100000000001x00000000x000000001x0000x00000010000xx00000000000x10000x0101000x0x00x0001000101000x001000100000000000000000000010000000000000001x0000000...

result:

ok "x01000000000000000000x00000000...0100000000010000100x0x000x00000"

Test #47:

score: 0
Accepted
time: 315ms
memory: 49360kb

input:

99938 99931
1000000 1 10 100000 10000000 10000000 10000 10000000 100000 1000 1000000 10 10 100000 1000 100000 10000 1 1000 10 10 10000 10 10000000 10000000 100000 10 100 1000 1000 100000000 1 100000000 10 1 100000000 100 10000000 100000000 1000000 100 10000 100 10 100000 10000 10 10000 10 1000000 10...

output:

x00000000100x001000010000001x1010000000x001011000000000000001000000x0000000x00x0000000000000000000x0000000000000x00100000x0000000000000000000x00x000000111x000000x000010x10001x00001011010x000000x0x00000x10000001000100xx0x00001000xx00x0100000000000x0100000x0010x00010000000000010x00000x00000001x0000000...

result:

ok "x00000000100x001000010000001x1...000000000001010000000x000010000"

Test #48:

score: 0
Accepted
time: 330ms
memory: 50644kb

input:

99972 99901
10003 104 9 1 100000004 12 99999998 1000002 99999995 1 1 10003 8 10002 95 1000005 10000004 99999997 99996 100000005 9999 10003 9999998 9997 15 99995 99995 10000 1 9999998 100 1000004 1003 100000004 96 12 99997 997 104 100001 998 1 9995 10003 10000000 11 98 10000002 99996 15 10001 100002 ...

output:

x6099090115x3948x0999969199909009090109009900x949x89099293919697x91900900010x6060x09909x99700950x000x1x0758x200009590900099x9119009055090994x900x0100908697109779900009110090900092009990049901990160x4900x0999009x9090149500x0x99x00990591995x001990120x0xx009944609002130x0940980009091921x050x079090x9040...

result:

ok "x6099090115x3948x0999969199909...94990006191400x5006197xx1950008"

Test #49:

score: 0
Accepted
time: 330ms
memory: 50092kb

input:

99908 99994
9 9 95 10 99998 999 1 98 100000000 99999998 4 999999 1 100004 97 99999996 6 1004 102 9999999 1000001 1 2 10002 4 97 9999998 9999996 100002 1 999998 1 10000005 9 104 2 9999997 999999 1000 1001 5 5 10000004 100000004 99999998 9999999 10 8 7 10 9995 999997 997 10002 100000003 99999 104 1000...

output:

x194x385040x9020608009x00988010890009x0029x90000000003090099291006x90x93970390x014x0xx879001952x126990190040490000899009269900988x970x00990990x00909x904x93x079x9904990x009x09932092929998090x04921996090x110401992x0004000909008900x95409x00800000001907x0004100600799104x9909010x951970x0909140060000x00x9...

result:

ok "x194x385040x9020608009x0098801...9909112089697900905002790090050"

Test #50:

score: 0
Accepted
time: 331ms
memory: 50480kb

input:

99993 99966
104 1000000 15 10000001 999999 104 9999996 9999995 999997 1 1000 999995 10003 10000005 10000 997 10003 100000004 99999999 100000001 10000000 97 10 999995 99997 10000000 9999999 100000001 1000 100005 99995 1 10000000 1000000 4 99 10000005 999995 100003 15 9999995 1000003 6 100000003 98 10...

output:

x7x020x001891910509019911x92300x9019104290x9090904990900001899280949xx00x54001070904940099260006211x23919900092350910019000020589009918990x9002900995099600xx016999958060x9x0000001996x2000xx69x9908x040005904900090791932199x19xx00819x01499x09011x900999x099951xx99079099218x00025094100900039x50908925000...

result:

ok "x7x020x001891910509019911x9230...996009090091830080098x010930009"

Test #51:

score: 0
Accepted
time: 331ms
memory: 50036kb

input:

99910 99985
10001 103 1 13 99996 105 12 10001 10000005 100004 103 1005 9999 1003 10000004 9999995 13 100000 100000004 1001 100000003 99999996 100000 3 999998 999996 9997 9999998 99999995 101 996 9999996 999997 9 99999 10000 100005 10003 6 104 10005 9995 1 1 10000001 100000003 6 10002 1000003 99995 9...

output:

x3909801119500100109090009600x700x0900x94054x049259099420900x0400000091989090990409x0419091999539095900900099x05x0340990990999x050010900090015009980809x10x89085x312x468x9x90x16960099905900x10099x69x919xx98x9x57x00085104049009050050095919020598000x0946x0070x8910x991x39029040500x9150995900511003x50090...

result:

ok "x3909801119500100109090009600x...50000xx79958900090999300x509912"

Test #52:

score: 0
Accepted
time: 335ms
memory: 50992kb

input:

99936 99974
1005 100004 102 1005 10005 6 101 9999999 10000000 1000000 15 99996 10000005 9999 99998 103 999 10000003 12 99999 9999995 103 100002 1005 1000001 2 100000004 10000000 1 1000002 101 100000005 99999 100005 7 1 105 6 100005 9 103 1 99998 5 10000005 10003 999995 10000005 10000002 100004 99999...

output:

x09x94102700x8500900600999009x009x69099558121039000905xx90179500x50206093x906x9x0x9309060619x10x0048001099891x7x19990x6099999x00008900588791994204091990900999101001098006999x007099097909900017090949939x0429090x9819199x99050990100x5008508909594952x99290509x300908x0931193960000960500909007x20090989099...

result:

ok "x09x94102700x8500900600999009x...99989001x0908190x68114080x99990"

Test #53:

score: 0
Accepted
time: 128ms
memory: 19916kb

input:

99960 1
538 6669 26 19 2062 5158295 29794 78119 64470 2710 74 5 110413 230 3 110844 5223399 47058326 674 16497983 697882 16 989 2252181 46 98788622 2236563 765 1843407 839 9092 470568 5077680 2366 7198160 31999025 5039 3386 174655 779735 72432939 7607 53 176541 9541 1 768 7 2175437 827542 8265386 21...

output:

x245181xx215969410887799156x586741873288020984663408432x462351007245483412x8x41385558485207052722859988817125818420714830x8299883985293114275770608302561236x8361310x10949869868510999942x126763x2x367988144010x814xx8807459276342x28xx3616x810x037330611256034048x69624009128x2737525425726226785647911x666...

result:

ok "x245181xx215969410887799156x58...658647x84x5xxx1x272264875113825"

Test #54:

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

input:

99908 1
270036 1439 903 1 619663 139543 894 3424836 51 1 6 719 86103508 51554209 126086 1948 3 59 61654 1 8860 847 32797 12066 58925044 891809 53458065 90260 77590268 224611 500249 98361 9072 2896 10455 1662972 2441 14509 5 2 6 2491719 7381 8620 31936524 2359 30640725 10 17345184 16 61867 186708 828...

output:

x681226422163300089470x943576x674019623728653029268645657xx1729211x0242x03562xx73x44575925x73x550261x258x989264038x24x1522869348x862639x337143119260222x9107215639642441793130066x512110x9952273x39x84x7003879776376x05x621890569x164857x06118801463x7560x380524x0304146682605x47541365146x59xx3246126915359...

result:

ok "x681226422163300089470x943576x...06765626711x92x2x5104267x136764"

Test #55:

score: 0
Accepted
time: 152ms
memory: 19624kb

input:

99904 1
741235 158 28585776 25476 9814 71 34534173 6029 70767217 3 84411 820893 2 8621 7 479884 5 375736 55 879 11 72 442274 16876773 89192 805 5413003 276879 6647 5569292 53418 48144 2248835 1892806 43 7 456 42 75878 9 8142 11205177 4149 2744282 5997824 2 4897 557 50514529 8632022 298001 933 409443...

output:

x9x13075675460824992323777392x30498157697x148x2574x2863153741x14125xxx95x8797531285x8x844x0340627x33488755x09x4836059049x046x818xx74239977470xx8x119825x178490760x5674222729x098078x681144745x928513398x83334x2820163394383901765357540312268x91223844739953357239917x0892650985810545244805xx3072x5542x9744...

result:

ok "x9x13075675460824992323777392x...39x2302241987248x61967352xx8830"

Test #56:

score: 0
Accepted
time: 157ms
memory: 19328kb

input:

99948 1
266339 7 712 421 578 6 615674 69 259662 230 50865 33 61382564 6212 223 366613 41283705 3 7556 59829 55920 5424006 23864541 6074306 549628 6467101 5870 2166095 93607 1519580 4737 646417 82818951 776053 95993858 805407 86618206 7646692 22045 1 63 9129416 94 579456 83381 80996733 319973 39911 3...

output:

x060x61x781203728001120x08x41096746909400500437809070006905x503x5828482012056x211000670079204404608545000538086806802050220x4x850008000980292x44x280690382012208000071730x97680x8004168404071266x654644100457600x30000685x6400360092331826309674400209070723406x25142x0440x1x0730495008070x0006086269x335103...

result:

ok "x060x61x781203728001120x08x410...16280x0244047055872406022037890"

Test #57:

score: 0
Accepted
time: 137ms
memory: 19648kb

input:

99979 1
13123 73505565 290808 7 5081 6 9468 972 414409 1643467 25809427 28 1 595 4 419639 60991295 37 2113 9596037 42059 66 707 741482 10 7803 7508963 85 41 22530 28906704 2 3770144 984 84 44408 7836 26872 57656439 6 2389204 7920 870 5192550 86801 7 5201477 97 7168 49323998 22694 436448 96 55489 949...

output:

x4x6745x8123x5911276734x20665250535845355309431819411521803411661916x6411517656x71640804143760229972753686xx247185910215x8829410712672390372xx65587164143804x51519057529963642965x4x4036772x213538516881x58588701839x04x3x6010343669750243337898328215796x147170579858xxx3x3999532x839383021771678x736x08690...

result:

ok "x4x6745x8123x5911276734x206652...9x26394913196237175113679780866"

Test #58:

score: 0
Accepted
time: 247ms
memory: 57396kb

input:

1 100000
42679666
72412 7299064 3587030 4010938 1033628 73618239 9 2685176 348 60309 3859 2 12959942 233 662184 1 79533207 630084 7 5691 9 7086 52560 55986875 113 87299 718 23 605 74794 7 6699397 53738 6504 583 29 8 883 142 4073900 20 25875273 680 68057302 6982551 6184 7519089 46 625991 14516961 932...

output:

x64x82132x22x0x17x5x55997152366648704x51314432784x556921813x88736554104813163461021836x3598099648282261737492681663x366182x2130436749x1x30870346141208649093867763589200574004340x483195212114809161x271728x824996281449x1533382603x159284422861126740973508699075x916431673954853xx81910457157xx55x1267714x...

result:

ok "x64x82132x22x0x17x5x5599715236...5x61049210891138182277x2758x327"

Test #59:

score: 0
Accepted
time: 145ms
memory: 19456kb

input:

99958 1
8471 97451212 391 317 99250 757563 288536 434 49430561 23391 2606595 95 98006856 87 799 503 920571 4360473 942 47 4946 89348 80288336 4704483 942400 875 69939 59 1 743 34274 215 78881 69 38769302 87094761 8624 27065036 45119890 993908 6 38816 8673492 1 2628 5 868881 69922 17 63768968 73 4 5 ...

output:

x38869671182600986x27xxx88657x94272x6017262xxxx723557655x0116038459288x03950502875922196220086842x492413570073649211792446290x7531198296151764x642x8641111883427738020x608963327792111238x69877787041x30613838x2481932171291255xx80x7x3x07316x592216x72x88132934169131944314411032x221177x328248814848357655...

result:

ok "x38869671182600986x27xxx88657x...7x1662147712540315669x0703168x0"

Test #60:

score: 0
Accepted
time: 245ms
memory: 57592kb

input:

1 99994
780
682658 514985 3185 355126 927711 8224409 4627255 9261517 43338054 7 213 26333 4484801 17050 16 867709 5191468 39312292 218657 404589 98044917 582995 98515 749 94086020 97907561 4 21116800 45882970 725 36046 90530776 959 3 72417 223 53862 3000 64723612 88675912 1288458 65194429 95 8031882...

output:

x0805883x90786x3002x64810144428340022xx21400287396383644523x04635487x886061651x354x009x161491890464600080663443329030126x8800800293600xxx7605137362354635x6x6100037035625581x01xx4901x1551x291469990x964499x4001268718x206387018549206298x64646xx2020208x412070464958420x236121x4052630x8x06986415x743772046...

result:

ok "x0805883x90786x3002x6481014442...03650461002434607732505304072x7"

Test #61:

score: 0
Accepted
time: 242ms
memory: 58120kb

input:

1 99955
6182195
67784 3986 9 2005778 78187396 337396 1 78623426 3779578 999 578216 7778 68956373 64107 5045 27 275785 36 7 4327719 5 8428236 205740 75782719 23987 432002 3 16097 32329 4 3 26801156 9 65 599 29852202 10287 72868195 1694 2449 3703430 81844 2694777 617 73996 16 880327 59 97 490285 32 42...

output:

x0x623316x8501826037715x0013204x5x00632525501842x6x04x02613342842x25230242789906730x255x5072401x0050x1853577029034003971964258645026587x51145x9344152x6539x801x5592233550583178108005351x57609561240969xx4349x5098x99499451x85x5x797x1149x685372353x997266294095605260105x81565101x54260665x8907930162x1x481...

result:

ok "x0x623316x8501826037715x001320...514506800981x56596203134xx38696"

Test #62:

score: 0
Accepted
time: 253ms
memory: 55824kb

input:

1 99952
83616654
1798997 72224233 4 4 71315 4753515 7 3 82285 863 64 10 41360 92 601819 8 2444 42538827 1652 9602 1543 75521117 2 8851 222 5438 9423 68227749 844638 3107 770242 9081550 8986 95 97 50546 10 34554 9084692 10242 640 78591 102047 10 4915 8133843 4 8718 718 877 585022 287 6079799 305755 9...

output:

x221215227x730125304282101772x126435418x7690109454320513x44407693386287991031616006x29447xx86x0x30x102458x1557428607x2x4899x84x3264152x597817462018229233280817080290729x0441228x102476946718762x455067x6246704202x0x95497753990668258986822x856785560281x604097122820751330694x822212780x570274068428682x32...

result:

ok "x221215227x730125304282101772x...79057x34x760xx514808x476166x445"

Test #63:

score: 0
Accepted
time: 69ms
memory: 15244kb

input:

1 1
1
1
299968
2 1 1 2 1 1 2 1 1 2 1 1 1 2 1 2 2 1 1 2 1 1 1 1 2 2 2 1 1 1 2 2 1 2 1 2 2 1 2 1 1 1 2 2 2 2 1 1 2 1 2 2 1 1 2 1 2 1 2 2 1 2 2 1 1 1 1 1 2 1 2 1 1 2 2 1 2 1 2 2 2 2 2 2 2 2 2 1 1 1 1 2 1 1 1 2 2 2 2 2 2 1 1 2 1 2 1 2 1 2 2 1 1 1 2 1 2 1 1 1 1 2 2 2 1 2 2 1 2 1 1 1 2 1 1 2 2 1 1 1 2 1 1...

output:

x11x11x11x111x1xx11x1111xxx111xx1x1xx1x111xxxx11x1xx11x1x1xx1xx11111x1x11xx1x1xxxxxxxxx1111x111xxxxxx11x1x1x1xx111x1x1111xxx1xx1x111x11xx111x111x111xx1x1xx1x1111x1111xxx11x111xx1x1x111x1xxxxxx1111xxx11xxx1111x11xxx11x11x1xx111xx11x1111111xx1xx11xxxx1x1xxxxxxx1x1x111x1xx1xx11111xxx111xx11xxxx111111xx...

result:

ok "x11x11x11x111x1xx11x1111xxx111...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Test #64:

score: 0
Accepted
time: 243ms
memory: 47340kb

input:

100000 100000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 ...

output:

x00x000000x000000000000000000000000xx0000000x000000100000x000000000000000000100000000000x00100000001000000000000000000x00000000000000000x000000000000x00x000x00x1xxx000x00000x0x0x00000000xx000000010x000000000100x000xx00x00x0000x00000x0001000000000000xx00000101000x000x0000x0x000000000100000xx001000000...

result:

ok "x00x000000x0000000000000000000...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Test #65:

score: 0
Accepted
time: 229ms
memory: 47088kb

input:

100000 100000
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999...

output:

x099000990000090xx909xx099999000000x9990x999990900x099900990009x00900990x090099009009xx009000x00909090009990990000009900099099x09x90900x00x99909x900x0009090909000009090990x9x09009x9x0009999009000900990090090990xxx900900009909009099x909900x99000x99x0x9099009099099000xxx0099990x9x0909x000x900009999000...

result:

ok "x099000990000090xx909xx0999990...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Test #66:

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

input:

100000 100000
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999...

output:

x1099099x0900010999900901909009099x000000990099099009099x900x899x99909909189900xx100009999x900000019099900x00810889109009x9999099999999190908x90x09x991x9990009000980980x0990xx0199819001xx090909910899899x09x899809x909001080090x9000x9x909180900090900911089x9009x009x0x10x00000x090090x09090898918xx1x90x...

result:

ok "x1099099x090001099990090190900...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Test #67:

score: 0
Accepted
time: 80ms
memory: 14636kb

input:

1 1
4
3
299966
3 2 1 2 2 3 3 3 1 1 2 1 1 2 2 3 2 2 3 2 1 1 2 3 1 3 2 1 1 1 3 2 1 1 1 1 3 1 3 3 1 1 1 3 3 1 3 3 3 2 1 3 2 3 3 3 1 3 1 1 2 3 1 2 2 1 3 3 1 2 2 1 1 2 2 1 2 3 2 3 1 1 3 3 2 3 1 1 2 3 2 1 1 2 1 2 1 2 1 3 1 3 1 3 3 2 1 1 1 3 2 3 3 1 1 2 2 2 2 2 3 3 2 3 3 1 1 1 2 2 2 3 3 1 1 1 3 3 3 1 1 3 1...

output:

x2122xxx1121122x22x2112x1x2111x21111x1xx111xx1xxx21x2xxx1x112x1221xx122112212x2x11xx2x112x211212121x1x1xx2111x2xx1122222xx2xx111222xx111xxx11x11x222xxxxxx2x1x21x1221222222x1x22222x222211111xx2x1xx1x122xxx11112x11x12112x11xx21x22211211x112121112x212222xxx22x2212211x12xxxxxxxx22xx11x1x12112x1xxx11111x...

result:

ok "x2122xxx1121122x22x2112x1x2111...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Test #68:

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

input:

2 2
6 3
2 5
10
1 2 3 4 5 6 7 8 9 10

output:

1230615xxx

result:

ok "1230615xxx"