QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#537351#4367. Longest RiversqiuzxAC ✓415ms129772kbC++201.6kb2024-08-30 10:34:512024-08-30 10:34:51

详细

Test #1:

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

input:

6 2
PaSak 0 513
Nan 2 675
Yom 2 700
Wang 1 335
Ping 1 305
ThaChin 0 765
0 353
0 65

output:

PaSak 5
Nan 2
Yom 1
Wang 3
Ping 4
ThaChin 1

result:

ok 6 lines

Test #2:

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

input:

6 3
Chi 1 1047
Mekong 2 2650
Mun 1 800
Nan 3 710
Salween 0 2815
Yom 3 787
2 100
0 1700
0 30

output:

Chi 1
Mekong 1
Mun 3
Nan 6
Salween 1
Yom 4

result:

ok 6 lines

Test #3:

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

input:

1 0
Chi 0 1047

output:

Chi 1

result:

ok single line: 'Chi 1'

Test #4:

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

input:

6 0
Chi 0 2650
Mekong 0 2650
Mun 0 800
Nan 0 710
Salween 0 2815
Yom 0 800

output:

Chi 2
Mekong 2
Mun 4
Nan 6
Salween 1
Yom 4

result:

ok 6 lines

Test #5:

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

input:

5 3
a 2 1
b 2 1
c 3 1
d 3 1
e 0 1
0 1
1 1
1 1

output:

a 1
b 1
c 1
d 1
e 3

result:

ok 5 lines

Test #6:

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

input:

5 3
a 0 1
b 1 1
c 2 1
d 3 1
e 3 1
0 1
1 1
2 1

output:

a 2
b 1
c 1
d 1
e 1

result:

ok 5 lines

Test #7:

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

input:

20 6
Aa 1 2
Ab 1 10
Ac 2 3
Ad 2 8
Ba 4 2
Bb 4 3
Bc 5 1
Bd 5 12
Ca 0 1
Cb 0 2
Cc 0 3
Cd 0 4
Ce 0 5
Cf 0 6
Cg 0 7
Ch 0 8
Ci 0 9
Cj 0 10
Ck 0 11
Cl 0 12
3 4
3 4
0 5
6 4
6 10
0 5

output:

Aa 3
Ab 1
Ac 1
Ad 1
Ba 3
Bb 1
Bc 1
Bd 1
Ca 19
Cb 16
Cc 14
Cd 13
Ce 12
Cf 10
Cg 9
Ch 7
Ci 6
Cj 5
Ck 3
Cl 1

result:

ok 20 lines

Test #8:

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

input:

22 5
yKTPTxbEaz 4 4
omjEjrOh 2 5
gdoRvn 0 3
OOGXohosn 0 1
MaujmScAJ 3 2
aaxvd 0 2
DBIYQR 0 5
VgeqnMM 0 6
QsFqZKeK 0 5
WIbJT 4 3
FHUPH 0 9
Dce 0 7
VXAoSQOk 0 10
gJD 5 4
UjN 5 1
kCrOYfJa 0 4
BZwx 0 8
yffrZmH 1 2
ijZgV 5 4
RiWMwHoofM 4 1
ASCqUqSs 5 3
Ian 3 4
0 4
1 3
2 1
3 4
4 2

output:

yKTPTxbEaz 1
omjEjrOh 1
gdoRvn 14
OOGXohosn 20
MaujmScAJ 1
aaxvd 17
DBIYQR 7
VgeqnMM 5
QsFqZKeK 7
WIbJT 1
FHUPH 2
Dce 4
VXAoSQOk 1
gJD 1
UjN 1
kCrOYfJa 10
BZwx 3
yffrZmH 5
ijZgV 1
RiWMwHoofM 1
ASCqUqSs 1
Ian 1

result:

ok 22 lines

Test #9:

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

input:

21 5
Ryk 3 3
aWw 3 4
vfWA 0 10
bRPGs 5 4
WlAbmmWpc 2 4
QNx 1 3
eCHmXfbel 1 4
PwAYJciSc 0 5
Ogtc 4 3
vbmY 0 7
pxV 0 4
zrczFcgBDr 0 8
IYsvt 0 4
QuvVNudkl 0 1
aMnBPgcKK 5 5
RkhpX 5 4
fiFmnHaEH 0 2
CWOb 0 3
UMJspNzt 0 9
KAgOeGV 0 6
BdOnF 1 3
0 5
1 5
2 4
3 1
4 3

output:

Ryk 1
aWw 1
vfWA 1
bRPGs 1
WlAbmmWpc 1
QNx 4
eCHmXfbel 2
PwAYJciSc 7
Ogtc 1
vbmY 5
pxV 8
zrczFcgBDr 4
IYsvt 8
QuvVNudkl 21
aMnBPgcKK 1
RkhpX 1
fiFmnHaEH 20
CWOb 15
UMJspNzt 2
KAgOeGV 6
BdOnF 4

result:

ok 21 lines

Test #10:

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

input:

19 4
oOdh 1 1
NFQXI 0 10
WhMS 0 3
yMOIuySfCD 0 1
NIlkPSKtPP 0 5
JmwHGUV 0 6
UsvaIzrie 4 2
uJupWlmYuL 0 1
WNHLkT 0 3
xatRy 3 2
IvvOpkYY 0 8
MGCXNXA 4 1
aZjE 2 1
KjOohn 0 2
QCx 3 1
lJiJQfS 0 1
ZUwxik 0 4
uIICCYiVWW 0 7
TyonRMORlL 0 9
0 3
1 1
2 3
3 4

output:

oOdh 8
NFQXI 1
WhMS 9
yMOIuySfCD 13
NIlkPSKtPP 6
JmwHGUV 5
UsvaIzrie 1
uJupWlmYuL 13
WNHLkT 9
xatRy 2
IvvOpkYY 3
MGCXNXA 1
aZjE 6
KjOohn 11
QCx 3
lJiJQfS 13
ZUwxik 8
uIICCYiVWW 4
TyonRMORlL 2

result:

ok 19 lines

Test #11:

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

input:

27 7
JBNj 0 5
ExVz 1 3
SxnMbTXkow 5 4
lCayMYJbWh 0 6
XQz 5 3
HYZvtctK 4 3
mIOmr 3 4
jEs 1 5
ACBSlCKVu 0 9
igPSvfp 5 1
fYIdPdT 0 8
mprPQWWFvq 0 4
RiLVYhEZQn 0 3
oJVAl 4 1
Tbyx 4 4
ZcuDzyIC 6 4
DHZzziLt 0 2
wcRQN 0 5
OhjBLhz 0 7
tgELsM 0 10
iPiYndkAQH 2 2
os 0 3
TUpEeglwi 0 4
DkJlZIYyD 7 5
nitjuhXP 6 ...

output:

JBNj 7
ExVz 5
SxnMbTXkow 1
lCayMYJbWh 6
XQz 1
HYZvtctK 1
mIOmr 1
jEs 2
ACBSlCKVu 2
igPSvfp 1
fYIdPdT 4
mprPQWWFvq 10
RiLVYhEZQn 16
oJVAl 1
Tbyx 1
ZcuDzyIC 1
DHZzziLt 22
wcRQN 7
OhjBLhz 5
tgELsM 1
iPiYndkAQH 2
os 16
TUpEeglwi 10
DkJlZIYyD 1
nitjuhXP 1
XhD 25
mKbwlKgyW 1

result:

ok 27 lines

Test #12:

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

input:

25 6
aNDR 0 4
WjGnCcRr 1 5
WngZtPusBh 4 2
athF 1 2
KSd 4 4
TstoRCcZw 0 10
uzTeFX 0 5
WmiSu 0 1
bgcbkUg 0 8
FtCQzyT 0 2
DsCDnBUL 2 4
PrNv 5 2
itEFlc 5 3
iTBbmT 1 3
cdhgcIPlV 0 9
UMQh 0 6
tlPkJhP 6 1
FSs 2 1
tcAWtfk 0 7
MYNBDgZm 0 1
IUiKwFOheI 0 3
yNQi 6 4
frBQRnth 0 3
kcPaq 0 1
BxLkrPzeXs 3 4
0 4
1 4...

output:

aNDR 9
WjGnCcRr 2
WngZtPusBh 1
athF 6
KSd 1
TstoRCcZw 1
uzTeFX 7
WmiSu 21
bgcbkUg 3
FtCQzyT 17
DsCDnBUL 1
PrNv 1
itEFlc 1
iTBbmT 5
cdhgcIPlV 2
UMQh 6
tlPkJhP 1
FSs 2
tcAWtfk 5
MYNBDgZm 21
IUiKwFOheI 13
yNQi 1
frBQRnth 13
kcPaq 21
BxLkrPzeXs 1

result:

ok 25 lines

Test #13:

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

input:

1000 0
SXZQe 0 658987472
cRzIeoi 0 690625285
OFKCkHshzG 0 172224743
uCSAP 0 888927762
tzrxZF 0 210536718
HOrZAA 0 234768976
jtrCkQbFd 0 848220519
nbTA 0 955831079
ZpGSnJ 0 439468684
NGzeCubONG 0 385473142
GoanlnPMk 0 153265256
QnTHagWl 0 139770293
nszbp 0 987984189
XHZXMILPAx 0 135814422
nzMCPw 0 55...

output:

SXZQe 333
cRzIeoi 296
OFKCkHshzG 812
uCSAP 124
tzrxZF 779
HOrZAA 750
jtrCkQbFd 154
nbTA 47
ZpGSnJ 563
NGzeCubONG 621
GoanlnPMk 839
QnTHagWl 852
nszbp 10
XHZXMILPAx 855
nzMCPw 450
eLZSQk 252
URZC 967
AEoDBX 662
aojFWPcHqU 862
dTngSEP 404
nWghgQTEtW 210
TSiJ 85
AMsyVZRH 29
gNRW 850
zVsaTXdoip 423
DzTY...

result:

ok 1000 lines

Test #14:

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

input:

1000 0
wFIHlbJl 0 187817413
aBzEArw 0 568211482
JzniTRFX 0 273872964
NsroGzjh 0 675038018
HaJDYEt 0 288303146
NJJjlNxxg 0 414903709
aZOsnIMhK 0 620486245
BWFtr 0 44388139
GGJjBYRAPI 0 377534969
YfN 0 134915471
OFjWAK 0 179728712
GFp 0 170799831
GvUVKUu 0 58255307
PdaJ 0 608059201
bSyZDaAa 0 23174328...

output:

wFIHlbJl 816
aBzEArw 431
JzniTRFX 740
NsroGzjh 330
HaJDYEt 716
NJJjlNxxg 587
aZOsnIMhK 375
BWFtr 952
GGJjBYRAPI 636
YfN 862
OFjWAK 826
GFp 833
GvUVKUu 940
PdaJ 388
bSyZDaAa 778
OZVyRQB 656
fotXLgNXCH 462
AaODVs 556
ATUsU 230
vYjxmMBgW 91
GPmwBZ 688
igi 873
pBFrOvnM 771
JjXZ 467
yyspSqlko 263
ofD 254...

result:

ok 1000 lines

Test #15:

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

input:

1000 0
eQTT 0 459903657
PmUMB 0 778606291
OQnEYd 0 360782970
nr 0 756134916
pqftxLeE 0 103800366
SlLJWqaE 0 529021879
rVagM 0 560298963
YteJngiIgt 0 111442171
YSucalDm 0 171190871
ZCyEYbh 0 104167495
VPyWMTfZgz 0 51324868
OcnEMhV 0 958722830
jOleFH 0 249192703
ZQHehRHGs 0 361864048
NByUlbGQQu 0 4182...

output:

eQTT 547
PmUMB 234
OQnEYd 648
nr 261
pqftxLeE 901
SlLJWqaE 489
rVagM 461
YteJngiIgt 895
YSucalDm 839
ZCyEYbh 900
VPyWMTfZgz 952
OcnEMhV 41
jOleFH 766
ZQHehRHGs 646
NByUlbGQQu 592
mBpokTRU 135
YBMUxZvF 960
MOfDAbDJ 734
skRLYP 740
IDyI 252
FAemkayQ 733
UCEzYgh 935
UqZV 986
UkLAU 129
WAmY 226
jlXXhaUIa...

result:

ok 1000 lines

Test #16:

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

input:

7793 660
ZRGdSi 268 9
LbYlcpN 638 24
vAXmYV 510 2
bGdwjBbUr 20 21
RFVmrqFu 227 9
HBlsEKXvyp 402 5
mJnQGX 329 22
DWak 207 20
gVfA 489 17
AsHKwqM 554 25
UExzlBBfa 353 17
HdokUTZZ 399 2
vwWdLI 65 22
OGqKjvN 109 24
tMV 342 19
gTPxsXshF 555 22
jXwsG 247 5
FimMZazN 140 3
YZgWo 392 9
bRrt 318 15
qLnUXzLj 2...

output:

ZRGdSi 1
LbYlcpN 1
vAXmYV 1
bGdwjBbUr 1
RFVmrqFu 1
HBlsEKXvyp 1
mJnQGX 1
DWak 1
gVfA 1
AsHKwqM 1
UExzlBBfa 1
HdokUTZZ 1
vwWdLI 1
OGqKjvN 1
tMV 1
gTPxsXshF 1
jXwsG 1
FimMZazN 1
YZgWo 1
bRrt 1
qLnUXzLj 1
DtzHT 1
ULPjjHHV 1
pPuqIlmLV 1
bLZiHjiKgq 1
jVePx 1
ijlJa 1
pExaSSnC 1
xJUdDDdp 1
lonlImYq 1
JMhTf...

result:

ok 7793 lines

Test #17:

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

input:

7112 600
dEGYPNBjz 454 16
xYFNTmJ 398 25
WimZgfOY 32 9
HZWlxW 224 13
gshai 398 9
fQAct 536 15
CRrvCkP 7 15
zUkFztd 511 5
NuHslt 226 10
AxXFhaCZ 145 22
ThBva 97 1
wOCpfseZFU 307 2
zFC 160 9
YDY 15 25
XNPsdQQGi 291 22
MyX 534 15
fbTaQUHd 93 3
XLjtdsEp 176 20
FKzTEU 460 19
FeBMm 49 13
vDMvG 163 19
qWkt...

output:

dEGYPNBjz 1
xYFNTmJ 1
WimZgfOY 1
HZWlxW 1
gshai 1
fQAct 1
CRrvCkP 1
zUkFztd 1
NuHslt 1
AxXFhaCZ 1
ThBva 1
wOCpfseZFU 1
zFC 1
YDY 1
XNPsdQQGi 1
MyX 1
fbTaQUHd 1
XLjtdsEp 1
FKzTEU 1
FeBMm 1
vDMvG 1
qWktBhdFbB 1
HjRiK 1
rMkAN 1
NZUz 1
NweDz 1
dPHk 1
AqRyUhVcgz 1
teqhWFQtq 1
pPBlAMb 1
HLiNNjjHHU 1
OVX 1...

result:

ok 7112 lines

Test #18:

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

input:

9718 834
iQRDF 597 6
QaVznELbB 584 6
uvsfd 771 6
cNMSlt 567 14
BDZa 365 22
lBsQkZzunz 576 2
XWUYHXfH 359 13
UsZBznRP 340 20
PMUKqZaTE 373 11
kGndGC 204 14
OGGk 437 18
ZoCSCljdK 269 11
LRQXBivDN 135 9
ygdemE 604 22
MpggJ 390 13
ZIqAHQDnFB 243 19
HBCRZhtBv 99 3
lcdrpi 691 9
FSTNOOdZoi 525 17
fbRvMIZRy...

output:

iQRDF 1
QaVznELbB 1
uvsfd 1
cNMSlt 1
BDZa 1
lBsQkZzunz 1
XWUYHXfH 1
UsZBznRP 1
PMUKqZaTE 1
kGndGC 1
OGGk 1
ZoCSCljdK 1
LRQXBivDN 1
ygdemE 1
MpggJ 1
ZIqAHQDnFB 1
HBCRZhtBv 1
lcdrpi 1
FSTNOOdZoi 1
fbRvMIZRyo 1
aKrnRQAGn 1
qbhbvOfL 1
PQqRSwqUwn 1
fKxuZhkNny 2
BwGTdaqIl 1
glyITNi 1
JuVPQov 1
RYcharhPTy ...

result:

ok 9718 lines

Test #19:

score: 0
Accepted
time: 359ms
memory: 81932kb

input:

500000 222529
wbFUlaCCEt 68789 6492
TtLa 0 19925
BPYzlQPXm 123884 1659
vUlBVsqP 139113 4489
VZJ 71027 632
dvZhmJEbkJ 159836 5263
dIeanlRGNE 74020 367
eRqE 118671 8704
YHwLoN 0 88518
QXsIxCvzN 0 67842
xFIlTb 78094 6
RIzi 216900 5411
lszTaU 54503 5808
olFPG 209755 7086
TyRydGRGH 181793 4807
VKeRExWLR ...

output:

wbFUlaCCEt 48835
TtLa 80821
BPYzlQPXm 48593
vUlBVsqP 37781
VZJ 36579
dvZhmJEbkJ 44703
dIeanlRGNE 50262
eRqE 47020
YHwLoN 11483
QXsIxCvzN 32159
xFIlTb 56545
RIzi 16423
lszTaU 42127
olFPG 30455
TyRydGRGH 40636
VKeRExWLR 61322
GbH 3873
miWweZmndc 24865
YGQkTlQUE 29351
gJgPVgjjd 34976
qacYxIJFgd 52788
M...

result:

ok 500000 lines

Test #20:

score: 0
Accepted
time: 357ms
memory: 81968kb

input:

500000 222359
ffxbeIMqf 0 11183
momqzzAJVt 176056 5317
CpAFNCDZzr 176153 2047
vJvX 116701 9553
xoVvTQ 154529 1200
wTdpqwZEcP 129811 6151
UaEfEEVNC 55855 7653
gspMOikb 57553 6227
lbQPSNJG 31955 6867
RTVw 115012 313
HKeXCTKuW 161617 4676
zXVeM 109010 6973
wGQtQDflWj 154501 3713
RSh 18222 5071
PkSTwFhP...

output:

ffxbeIMqf 125091
momqzzAJVt 45257
CpAFNCDZzr 45517
vJvX 36273
xoVvTQ 31506
wTdpqwZEcP 58172
UaEfEEVNC 51127
gspMOikb 44513
lbQPSNJG 51810
RTVw 55578
HKeXCTKuW 48850
zXVeM 36874
wGQtQDflWj 30388
RSh 62547
PkSTwFhP 44492
XQFP 68111
sJP 54320
EQZV 46866
vthVmx 42368
MlAcAOA 69169
kXe 41190
Vnzr 47245
z...

result:

ok 500000 lines

Test #21:

score: 0
Accepted
time: 355ms
memory: 83792kb

input:

500000 223366
HOe 188263 4600
sQGbOafrrd 42335 6125
dfDQ 98766 2924
TjTKikJ 105042 6099
dINM 104499 6037
hmfbpCLRp 0 6556
GNNMwmfO 120237 5313
nlkH 148349 7682
FEvO 87819 6958
EYfEr 93257 9013
uzpkAvHISp 0 49426
OyULPCMn 161849 7797
FXj 188804 5059
wVomcIpSr 202815 4102
mIjbqW 198905 270
rDqhAvm 204...

output:

HOe 43252
sQGbOafrrd 55629
dfDQ 56515
TjTKikJ 49221
dINM 68635
hmfbpCLRp 258071
GNNMwmfO 37965
nlkH 38979
FEvO 56265
EYfEr 55719
uzpkAvHISp 50575
OyULPCMn 35553
FXj 42957
wVomcIpSr 50213
mIjbqW 41186
rDqhAvm 49017
vUbb 52132
kPcc 39129
UAorXmU 46923
yjKNNZtZ 30884
OfPfbFRVgy 34646
zqBxuIb 58346
njqK...

result:

ok 500000 lines

Test #22:

score: 0
Accepted
time: 274ms
memory: 55220kb

input:

500000 0
DkmzNSUKJX 0 717063362
wmPC 0 912093770
QZHsQY 0 783994979
DyQIeT 0 91915691
fIU 0 735786973
FRexbDxj 0 935357805
TzeNIkJAU 0 293902188
lySnTNyJ 0 713713635
wMLffgriF 0 43432909
ICWnwec 0 525947262
CnDsN 0 985305273
NvzcnVKmn 0 94379699
alOZVRFF 0 525970316
RWKD 0 937949629
xsHLScrCt 0 7324...

output:

DkmzNSUKJX 141750
wmPC 43888
QZHsQY 108106
DyQIeT 453937
fIU 132281
FRexbDxj 32251
TzeNIkJAU 353232
lySnTNyJ 143392
wMLffgriF 478146
ICWnwec 237301
CnDsN 7327
NvzcnVKmn 452798
alOZVRFF 237290
RWKD 30962
xsHLScrCt 133953
DNCfvL 202668
HacjItOa 414948
sptvcYUp 487718
FlBia 132859
kvyZxCrj 150087
uopVC...

result:

ok 500000 lines

Test #23:

score: 0
Accepted
time: 290ms
memory: 55008kb

input:

500000 0
WgRVPbw 0 204523732
IxtCXoGjhh 0 141926129
lPTyAllLAA 0 865543463
zAbGP 0 740428852
WkVKYQ 0 677378407
JGBR 0 885857159
Orp 0 306674583
DYcO 0 51882550
GcVDjJqWoc 0 342100409
sFtBWAWiK 0 510018597
WuTxU 0 732646790
iPFi 0 587455391
OtTxorFcO 0 101721384
sHtCGeVCJ 0 150453054
PNVeOlBWHO 0 19...

output:

WgRVPbw 397909
IxtCXoGjhh 429166
lPTyAllLAA 67218
zAbGP 129638
WkVKYQ 161237
JGBR 56950
Orp 346914
DYcO 474236
GcVDjJqWoc 328968
sFtBWAWiK 244769
WuTxU 133452
iPFi 205979
OtTxorFcO 449268
sHtCGeVCJ 424938
PNVeOlBWHO 402931
kOqZW 191412
QAkd 32736
rGtJFILsV 487630
ldRGFH 407746
an 211789
aYMirvXU 930...

result:

ok 500000 lines

Test #24:

score: 0
Accepted
time: 276ms
memory: 54876kb

input:

500000 0
kQohhToufb 0 892899017
oJVgugkc 0 536920737
mLFpH 0 96264833
cIA 0 679801048
DrSe 0 554810887
kHpHTC 0 57836125
kXOnhcuRAK 0 716363977
KfdAaKzF 0 709822506
watFPA 0 917411344
JqBkOAAv 0 542910796
lNOfyF 0 582676562
yJyjzPe 0 171029619
lLXR 0 747220188
vnLfYgvr 0 75082198
GNXLeVjYvS 0 423191...

output:

kQohhToufb 53522
oJVgugkc 231794
mLFpH 451928
cIA 160303
DrSe 222950
kHpHTC 471182
kXOnhcuRAK 141966
KfdAaKzF 145313
watFPA 41329
JqBkOAAv 228787
lNOfyF 209052
yJyjzPe 414668
lLXR 126454
vnLfYgvr 462445
GNXLeVjYvS 288595
QGhwnhN 73067
LcFUfz 41555
vKavKEQ 330152
DJKWtEb 225272
PUEnyDk 258527
jYj 106...

result:

ok 500000 lines

Test #25:

score: 0
Accepted
time: 415ms
memory: 129772kb

input:

500000 499998
VlTEIorVH 54692 531591684
BjdRDm 59452 47589814
ExjhHwjj 427047 741606216
SEEPiFTcHi 385116 103716728
tqjdOomW 393932 104562399
UOpYnVI 6729 742111682
LksjycGTh 261741 611052594
tOLpjcu 343401 136358580
rwaazVcaOZ 372367 539591267
cWwPl 346760 905173850
syASEy 358215 653980421
cgkRUB 4...

output:

VlTEIorVH 1
BjdRDm 1
ExjhHwjj 1
SEEPiFTcHi 1
tqjdOomW 1
UOpYnVI 1
LksjycGTh 1
tOLpjcu 1
rwaazVcaOZ 1
cWwPl 1
syASEy 1
cgkRUB 1
iOOSK 1
svEYwB 1
wpdTeFDv 1
vvSkCg 1
gbWrHRSdcm 1
TwiAzmE 1
lMadbBnd 1
kVSlW 1
nYYt 1
oRSYuZeq 1
RJFcpP 1
XIgqtMw 1
BehMqRl 1
qvl 1
DPhgsVr 1
IrLJSZldoC 1
BCu 1
NTmvBOcoYk 1...

result:

ok 500000 lines

Test #26:

score: 0
Accepted
time: 401ms
memory: 129460kb

input:

500000 499998
gKc 34398 957536694
sjAEj 322061 90661340
mtDQIl 185517 344752119
oREv 37623 352771654
spqhuUwSMS 129178 168742761
NCSRO 94987 414156624
fGC 485055 755700667
GblXvA 356071 408124197
iAB 163394 797922953
PCLifa 268762 701550550
YxxHYQI 128206 318669301
Jrj 391940 303580120
lQnFXVhW 4160...

output:

gKc 1
sjAEj 1
mtDQIl 1
oREv 1
spqhuUwSMS 1
NCSRO 1
fGC 1
GblXvA 1
iAB 1
PCLifa 1
YxxHYQI 1
Jrj 1
lQnFXVhW 1
MwZTFtJ 1
FTrYUAhch 1
nUAkqlUsdk 1
qEClHYDW 1
GsVD 1
LSzmhHWdbj 1
JYSC 1
VqSydtvrc 1
gGxhIFda 1
AJSAe 1
PVJzy 1
kOGIZ 1
QzgnxfpIB 1
lNqhNX 1
WJUN 1
qXZDr 1
lRIwHZ 1
dcYYxy 1
fGHnfbeyo 1
YAKIYn...

result:

ok 500000 lines

Test #27:

score: 0
Accepted
time: 404ms
memory: 128912kb

input:

500000 499998
OOSQh 199084 675966486
OmDyVs 304010 111080340
iJRBGhKS 350388 184021697
DaoEt 458100 735983399
yQqo 12234 182323259
EQcbS 13314 368210825
qjPgLsMP 307949 660319596
CPxhQ 374507 720576848
NkbBMoocn 43322 826152134
nwyjQoeWA 499000 508760588
qqUEUGh 284006 139664533
wsY 316102 563298955...

output:

OOSQh 1
OmDyVs 1
iJRBGhKS 1
DaoEt 1
yQqo 1
EQcbS 1
qjPgLsMP 1
CPxhQ 1
NkbBMoocn 1
nwyjQoeWA 1
qqUEUGh 1
wsY 1
YSYAjYs 1
BkQDypCENz 1
OuPEzqPhmO 1
OhOiRuJFY 1
eUWXSknC 1
vDyBsgb 1
QgpYQLtjc 1
SXdSLrzJ 1
vWcFwcH 1
DfcyAnIl 1
WTPO 1
EPzQ 1
YWEc 1
TaTB 1
JJQizUXdP 1
Vns 1
kRaZusGAmw 1
ACpOo 1
hYcR 1
jUq...

result:

ok 500000 lines

Test #28:

score: 0
Accepted
time: 376ms
memory: 98296kb

input:

500000 498998
GIqBkeC 322575 42
gNH 479867 24
Cpjamib 396610 25
BMc 433581 45
HJtm 328647 2
OtzhwOqQyE 316099 44
ZcfeEHd 408583 7
vsdYWzCQ 480286 1
YHGaAhjo 323826 14
EXBsGeQHt 319443 47
LXkroN 338787 27
AQqSwFIAh 320216 24
tnaOICx 430724 1
EUn 351832 22
acTyWwc 301907 15
Khad 375365 38
DfTY 416983 ...

output:

GIqBkeC 547
gNH 547
Cpjamib 445
BMc 489
HJtm 658
OtzhwOqQyE 541
ZcfeEHd 605
vsdYWzCQ 560
YHGaAhjo 561
EXBsGeQHt 511
LXkroN 526
AQqSwFIAh 545
tnaOICx 574
EUn 642
acTyWwc 568
Khad 549
DfTY 586
tDWVHfqc 476
acvulNG 554
lNNi 527
wCN 602
danbU 626
nKSNN 479
IWNYhOA 524
GXoOHCAHfe 591
stDl 641
GpwUcgxO 49...

result:

ok 500000 lines

Test #29:

score: 0
Accepted
time: 365ms
memory: 99252kb

input:

500000 498998
zSo 495492 25
QADx 306870 5
cXl 276200 29
GuHviJ 295705 7
lqamXJJpU 371150 23
LIvKTx 309810 48
qtKwTEPWrK 384503 5
NhcXo 378631 22
sDtFgvW 354975 21
NCQUIoxvbl 372585 13
WTx 293637 40
jzMvrM 435245 45
WYpldCf 164013 26
hxR 474240 35
CkaufNyAX 313149 45
xmTLXzLRps 410729 48
iOn 345005 2...

output:

zSo 508
QADx 633
cXl 504
GuHviJ 537
lqamXJJpU 648
LIvKTx 497
qtKwTEPWrK 657
NhcXo 633
sDtFgvW 498
NCQUIoxvbl 561
WTx 526
jzMvrM 572
WYpldCf 588
hxR 556
CkaufNyAX 445
xmTLXzLRps 447
iOn 582
OuRgruqtEn 542
tmSUh 535
PzExhI 610
qIbBtPxc 505
FDkYv 566
bodvTLNVk 560
RCbSgJaDX 630
IwdAXC 623
QxNSu 550
WIl...

result:

ok 500000 lines

Test #30:

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

input:

500000 498998
zAvuCNnnii 433269 28
QAv 353136 43
hoVSTr 447531 30
KHxdUktAQ 466734 31
FPoip 470576 23
DhWVSsoc 466581 11
YZJxHhD 384494 47
RkoRGvlP 323530 4
RdimwYcST 352911 19
yyB 308505 14
hIEtWXEM 481298 15
ViwD 339106 30
fQoe 310174 27
aKEVj 204549 24
iDF 322117 33
RUd 386457 35
vpMO 317908 47
z...

output:

zAvuCNnnii 528
QAv 410
hoVSTr 590
KHxdUktAQ 589
FPoip 656
DhWVSsoc 593
YZJxHhD 484
RkoRGvlP 470
RdimwYcST 478
yyB 487
hIEtWXEM 606
ViwD 512
fQoe 497
aKEVj 534
iDF 421
RUd 491
vpMO 527
zVljDjoDp 588
psqZLiw 572
qgUPDv 499
TGjQETpkT 608
Bpgak 592
SpAbhTOg 499
tebx 374
xzMYGqc 545
zpapn 595
ABlBvIkB 49...

result:

ok 500000 lines

Test #31:

score: 0
Accepted
time: 351ms
memory: 97240kb

input:

500000 499999
aaaafaaaaa 250000 400471252
aaaafaaaab 250000 353005238
aaaafaaaac 250001 495648294
aaaafaaaad 250001 408723905
aaaafaaaae 250002 192736530
aaaafaaaaf 250002 746753036
aaaafaaaag 250003 107025523
aaaafaaaah 250003 813916343
aaaafaaaai 250004 757784911
aaaafaaaaj 250004 561247855
aaaafa...

output:

aaaafaaaaa 1
aaaafaaaab 1
aaaafaaaac 1
aaaafaaaad 1
aaaafaaaae 1
aaaafaaaaf 1
aaaafaaaag 1
aaaafaaaah 1
aaaafaaaai 1
aaaafaaaaj 1
aaaafaaaba 1
aaaafaaabb 1
aaaafaaabc 1
aaaafaaabd 1
aaaafaaabe 1
aaaafaaabf 1
aaaafaaabg 1
aaaafaaabh 1
aaaafaaabi 1
aaaafaaabj 1
aaaafaaaca 1
aaaafaaacb 1
aaaafaaacc 1
a...

result:

ok 500000 lines

Test #32:

score: 0
Accepted
time: 298ms
memory: 124972kb

input:

500000 499999
aaaaaaaaaa 1 681671519
aaaaaaaaab 2 627741789
aaaaaaaaac 3 388064579
aaaaaaaaad 4 11549178
aaaaaaaaae 5 428951744
aaaaaaaaaf 6 629978879
aaaaaaaaag 7 205035267
aaaaaaaaah 8 686394644
aaaaaaaaai 9 617349881
aaaaaaaaaj 10 19254644
aaaaaaaaba 11 193581754
aaaaaaaabb 12 421272350
aaaaaaaab...

output:

aaaaaaaaaa 2
aaaaaaaaab 2
aaaaaaaaac 2
aaaaaaaaad 2
aaaaaaaaae 1
aaaaaaaaaf 1
aaaaaaaaag 1
aaaaaaaaah 1
aaaaaaaaai 1
aaaaaaaaaj 1
aaaaaaaaba 1
aaaaaaaabb 1
aaaaaaaabc 1
aaaaaaaabd 1
aaaaaaaabe 1
aaaaaaaabf 1
aaaaaaaabg 1
aaaaaaaabh 1
aaaaaaaabi 1
aaaaaaaabj 1
aaaaaaaaca 1
aaaaaaaacb 1
aaaaaaaacc 1
a...

result:

ok 500000 lines