QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#189889 | #2871. Clean Up! | MaGnsi0# | AC ✓ | 19ms | 61328kb | C++17 | 1.7kb | 2023-09-28 01:18:40 | 2023-09-28 01:18:41 |
Judging History
answer
/**
* author: MaGnsi0
* created: 27.09.2023 19:58:09
**/
#include <bits/stdc++.h>
using namespace std;
const int M = 26;
struct node {
int w;
array<int, M> next;
node() {
w = 0;
for (int& u : next) { u = -1; }
}
};
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n, k;
cin >> n >> k;
vector<node> T(1);
for (int i = 0; i < n; ++i) {
string s; cin >> s;
int j = 0;
for (char c : s) {
T[j].w++;
if (T[j].next[c - 'a'] == -1) {
T[j].next[c - 'a'] = (int)T.size();
T.push_back(node());
}
j = T[j].next[c - 'a'];
}
T[j].w++;
}
int ans = 0;
function<int(int)> dfs = [&](int v) {
if (T[v].w == k) {
ans++;
return 0;
}
if (T[v].w < k) {
return T[v].w;
}
int on_me = T[v].w;
for (int u : T[v].next) {
if (u == -1) { continue; }
on_me -= T[u].w;
}
vector<int> have(1, on_me);
for (int u : T[v].next) {
if (u == -1) { continue; }
have.push_back(dfs(u));
}
int sum = accumulate(have.begin(), have.end(), 0);
sort(have.rbegin(), have.rend());
for (int x : have) {
if (sum == k) {
ans++;
return 0;
}
if (sum < k) {
return sum;
}
assert(x <= k);
sum -= x;
ans++;
}
return sum;
};
int x = dfs(0);
cout << ans + !!x;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3480kb
input:
4 2 a abc abd b
output:
2
result:
ok single line: '2'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3480kb
input:
4 2 d c ab a
output:
2
result:
ok single line: '2'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3468kb
input:
5 3 please remove all these files
output:
3
result:
ok single line: '3'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
2 3 c acbabaaccb
output:
1
result:
ok single line: '1'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
4 1 ccbc bbacb cacbbb caabcbbcba
output:
4
result:
ok single line: '4'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
10 2 c bbabcacb a cbc acccaaca abcaac abbacc ccb cacbb aaacab
output:
7
result:
ok single line: '7'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
9 1 aababaaab bc baabbaaacc bcbccbaaaa ac accaab bbbbc aacbaa ab
output:
9
result:
ok single line: '9'
Test #8:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
5 2 bbaac baac abbbcacab bca ccbbbbccc
output:
3
result:
ok single line: '3'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
8 1 ab bac abacbbcbbc cbbaabcaba ac ccac aacaabb accccabc
output:
8
result:
ok single line: '8'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
2 2 bacbc abbcacacc
output:
1
result:
ok single line: '1'
Test #11:
score: 0
Accepted
time: 1ms
memory: 3480kb
input:
9 1 babaccacab bacaa baacbbccc ccccac ccbb bb a accacabaa bcabbbccc
output:
9
result:
ok single line: '9'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
70 2 cbab ccbaaac ccccbacbcb bcbbcbc ab abaacbc cbcb acbacacbcc ccac acbcab cccacbaa aabccbac bcbbca caac aa aaaabb ccbbccbb ccacaa ccabbb ac acacbc ca ccabbbaa cbabbabc ccbabac cbb ccbab c ccba a cabaabbcba cbca caabc ccbaab cbbbbcc cccb acbc cabbaa caabcaba b ba baacabbcc ccb cbaacabbb aabb bbcbab...
output:
39
result:
ok single line: '39'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
22 5 baacacbbbc bbc cbbaac bacbcc acbccabbb cacacaaaab ca aac cba a b ab ccab cb abbcc aaa bc aaccbccc bacbaac aabcccc baacb abc
output:
6
result:
ok single line: '6'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
61 2 baccc cccaaaaccb bbbcbcb cbbc bbbcbcbabb a cbcbbbbbba baaacaa caaaac aba bbbabcabbc ccaccaac ccccbbbaa ca caaabcbcac bcbcaaaaa abaabb cc acc cbaab cacbccbc cbccbcbb abbbcac bcab bbaab c acaba aabca baccaaacb abbcca bab abc cababcc accbbabcbb acbcc bcccbbcaa aac cccbccbbcb acacacbccc caccac caaa...
output:
33
result:
ok single line: '33'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
95 3 cacb cacaaba aac ccabbcac acaaa cbc baaaaca caaaabacca cccbccbc ccabacbbca bacbabb bcc baabaccbc aabcaababb bcacc acaccbab bbccbc cbccbcc bbcac cbaac caaa bbbacaccca cbcacbbccc bccbabaaaa caabbacbcb aabacccc caa caaccaa aaac bccaacab baccaa bcccbbba aaba bccb ccbcabbbc bbacb abcacb cba abaacc c...
output:
40
result:
ok single line: '40'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
24 5 caaacbaaca acaccac ccabbbb abbcbcaca bb a aaba ccbca abbcaacaac bbcacaaacb aabaca bbbac ba bacbccacca cbabccaaca abcccc abbcbcca bbccacc bba bbabcc aabaaca bacaaacca bbcacbaacc aa
output:
6
result:
ok single line: '6'
Test #17:
score: 0
Accepted
time: 1ms
memory: 3556kb
input:
72 2 ccbba cca acbccbc bacacbcacb cccacacbcb aa cab bca cbbbcbccc baababcc aacacaaaaa acca aaababcbca cbacacabc cabba cabcbbcba ccaaacc cbc aab cbcbcac cacbcc aaaa aba bbcbbccbcc bbc cc abaccaccab bcbcbccc bbabbc accaa abcacc cbbcbcbba abccbbaa cacac ccccc abccaaa b ca bbabcaa caccabab bacaaa abccbc...
output:
38
result:
ok single line: '38'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
173 3 abc accaddcbacbace bcceacabacecbaabde ebbc deeebecabacce ebbadcdcdaeeeeda cbdbeabbcb eeabbe bbcbdbecdeecdabbeaee ed bebaddbae beadc cbd cecbacebddeeceb dacbd ddeabb a ceeeebbdba aaeaceaccbcdbc abadbee baacecdaadaabacbdbcc eddeabd cbcecbbaaaacceeebbd bed deebdc dbecaacbb acabececaeaddcb debcd a...
output:
69
result:
ok single line: '69'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
33 1 eecccdcdeedcac cecedcceedcaadb aeddcce acdcabcb beccecbbbdce edadbbecbebaccdadda bceaacabccebbcdb ee aba acddabaaeadabcd eaeedeeeeebae dacddabaeedcebbebeb aaa adadebcdbccabda bece bddcbeaae bcddeaeeedcbad becbbdbcca e eacdabceccebddabcde bdbc dbbe ccbeceabbbade eeebdc edbdbddcdbbedaaadb cbccdeb...
output:
33
result:
ok single line: '33'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
338 4 adbcdaccdeedbdabb caadbbbcdadaac daaee cbdaccbedabaea dbaeadeaedd dbeee beda bbac cbb abdbddb edacdaaebecabaa ebcbbbdc eccc dbbaedcbaedcdacdbeac eeaaebaebdaaeadd deebddedeaacbdeabbc ccacdeeaeaabdbcadca ccdebaceeddebebaa cddacbddeaedec debdaad abacbdce abdcca cebcdbeeccbedda dccc dacbaacdabe ba...
output:
110
result:
ok single line: '110'
Test #21:
score: 0
Accepted
time: 1ms
memory: 3788kb
input:
324 2 edcbacbebbbaec bcadaddbabbddaacbbd beddacbababdcddaa bbdbdabedcbeccd dcdbbbebbddbdbbcd dbbdcdbcbdcbe dbdddceccdbd cea eedc daec acecdbecbbec dabacdbabcece cbeeacbcca addeacdbddbadddeecba ebdeacebabebbacd ceeabadaecebcbe bbabaaecaddbacea abcabecbebbe bebbecbaa cbebdbabadeeacbecc cdeaeabcbeecdae...
output:
192
result:
ok single line: '192'
Test #22:
score: 0
Accepted
time: 1ms
memory: 4072kb
input:
803 5 bbcc adeeedeea dbee bdbaadabddcbdcba ecdbacccbcdddaabcda aaabebecaa eadedddabb ccecbc cebdbadac bdaddaecdebebd ebadebabbdeb aadcbcaaaaaeaa ebbaaceccccbedeab dedabe beccdebcadaebaced bbdbdbbdbccbecb daebebaadadccbddcec ebbcbedccd cbbee ebcbdbceddbbaaadc eeabbebbedcc abaeeecdcecbddadacae abeddca...
output:
219
result:
ok single line: '219'
Test #23:
score: 0
Accepted
time: 1ms
memory: 3696kb
input:
356 1 cbabebbdedcdaeaaebce ba cebebacecddddded bbceccedc bdeeadb aeedbbcbebbd abceeec baddee aedbcbddd dde ecdeccc cc ebeacadebadecbad dce bcebdacbddabb dcbcaced eded deadbbddddaaaadeda addacbacedbbcbc eabdddbcdeadaaecdc caedbbaddee dcbedabaebeeaad dedebdd ddb cdcbacab abde aebdabecbacccaacaec abece...
output:
356
result:
ok single line: '356'
Test #24:
score: 0
Accepted
time: 1ms
memory: 3716kb
input:
282 2 ccccbceccacb eebacbcbbe dbdbcdaaadbcedddcbab baeeebdedb eedbdbbcbceebaeabaab aeeaceec ddbcc dacdaaddee bceebbdadc acdeebbeaebaecdeae ceb beaebceaaddedbbdd dcba badcbebabdcedcae bdbdcaedbbaccbacabea bddedecabce abeaa caaabbbed eeacd acceba cbedeccbdedec edccbcbacaaabeb cbdeca da aebbdbb db baae...
output:
161
result:
ok single line: '161'
Test #25:
score: 0
Accepted
time: 15ms
memory: 32348kb
input:
25247 66 bagcagchec fghfdcabegef gdf hfbbcfcggbaahfbggdb cfdadffadgghaecadggb aehgeddchedfbbhec dhcfbea gageghbfchddaa gfcbcdc cah cfcefedchgdhgccafgd hgded aaehdadcabccab fffg becbgeafffgfef ebchgcgdbbc bcaegdccfadhffehg aagafbdhdfcegaebha hahhb agbchgbbc caaffbeegggbcgahd gfabhddeacc fcaadhcebchgh...
output:
511
result:
ok single line: '511'
Test #26:
score: 0
Accepted
time: 8ms
memory: 32736kb
input:
25336 47 bchhdhchhahhgagbe aaacgfhgcdgghha addae eeadbgadbadegagb ebagchhecfcbebgag chhgggdgageedbebdbe eacffbgfafbbgedf cab eabgcdg ddbea ebdbgbegh cgagaacchaadgg abhhdfhfffeegfffdecb aabheahaeggd hehfbcchehc dbhbhc gcebebgec egeeebea bhffhfebhbcdbfhfcg bdgfhaddd dfgagdbcdfghegfdagd feahgfade dffcf...
output:
866
result:
ok single line: '866'
Test #27:
score: 0
Accepted
time: 4ms
memory: 30852kb
input:
25235 60 efbhgdafdadcadaeea hdfgecegbfhfbd ccchbaaagdce dcbg cdbgffceaecabbgbcff bddgehfdegd aacggdbadgeca bagahgfeceacedc bbhchhcbg eagdhdfacfgbbaafdafa ebgde gbhceh gggahffbhefgdebdh edbfage hfadbhe dhhabcbcfffgbdh bfbfgedbfcdafgbfecc gahaea cgcgedghgchcafgh cbhgehhghdhhhhcedda cfagb gaebghfebhccb...
output:
544
result:
ok single line: '544'
Test #28:
score: 0
Accepted
time: 8ms
memory: 31956kb
input:
25291 9 hhhbachfgeadgbe bchgagehehceg cechccbcffeh acaageegcebh cefdaehgbfgbaeggfaa ddebbgegdhhfce aehg cfgdghacfdcfehhabg adfhebchffhcaadcbhde badebdeffgh heafcbhefahgdebahadh hhbgaha bfffhcg dhecfadddgdb chcf dhdhc geaeaffhbec echhchgchdabhg chdcddhbaahhfgbgcgda efhgaaeaafbhgcfc bgac abhgb dagf ba...
output:
3991
result:
ok single line: '3991'
Test #29:
score: 0
Accepted
time: 6ms
memory: 30892kb
input:
25165 22 afafcgfhchgahgbb egdeddeabcbdg bfbgb decaghfaeddh gchbhbbbcfade hchbd agebgbfeeggeggdbgdbc fhaaccbdbhcgg decefaagabceg deech dcedf bagcfe cahhfedeadccce bhffcgebaeacdgfdab acebhcbfchfafefbhhf adcc egddfbfdddagfh ehbchcf dddfedgcfdegdgh dcgeecabhaaba cabeeaacbgdhgedce bacfgfedcaccceee efhged...
output:
2411
result:
ok single line: '2411'
Test #30:
score: 0
Accepted
time: 10ms
memory: 17720kb
input:
16468 99 egaahccddccfg chefhgehacafbbh gbfffffgahacgcfbb gcchaaaaebabdh hcbbfgabcdfageahacag ghbeaggghhheeffce achaahcdeagegebbd chhbfccfbd eedggg dgbegaehgea bhfbeage gahbhghbafdghbahed abgcgbbhfhccadhef bhcdaf dechffccffacefe gacffcacbge cgfbbghhbeebdfhhdbbh hgfbhcgccb hggdgb hcgfbbace dhdccdaeega...
output:
380
result:
ok single line: '380'
Test #31:
score: 0
Accepted
time: 9ms
memory: 32568kb
input:
25216 12 beahgf fbaa cddfaeecbeecghaaf dbccbfeaad gdcbdfahhe bhgedhcgb eggbhfbehgadhf fdhgehcbhbcffcfab chhbghfdaecechcge ceghgcfhcbe agchehaa cggahchabcfaf ecffbaegfcf hbhfd eahadaffchhbf bebbdffh bbaaeaddbdffbhchafef ceaf fehgagedebeebdfaa geffggacddaaggacagg echahhabcedb hfgbe fcacagadhgdgghga cg...
output:
3324
result:
ok single line: '3324'
Test #32:
score: 0
Accepted
time: 8ms
memory: 31824kb
input:
25272 61 agfadhchgb bccbghfga ecbehhe fedeeffbecdadbhh febefeggeeahdced acffcdhhcabfbbaabbca cddcdeagcdcdabaff cahdcgchcccebcegh gcfggdfef bheab fahfgdd aefcafcddabgcg ccabgdbaegfafhhfaab dbadbafddc hcgcb gdhcfehaeggacda haebh gbbadagacghceghgheaa fedbhgdbgchhbcecebh abcehghgefebhdgc adhdg dedgcaeag...
output:
535
result:
ok single line: '535'
Test #33:
score: 0
Accepted
time: 4ms
memory: 32000kb
input:
25617 4 gigbdgeg idhiihjdii bidgchdcdjgfjdfjia bhbccjcedihifbbc ihbafcfdeihhd eegfjhaigbica aghcefbjigd fhabijbgihefhgefc cegaa abifbcdebcj iebj abbjcchhfab ddgchjeabefejgfjjhi haedcd acfaajehghhibbbajb aghaddahcghbihi adjhheh gbcagdee djjbidbhfiheg afi eeddcbfjhac fhjaeehjgceefjdcj aajgafjhcfcigihg...
output:
9066
result:
ok single line: '9066'
Test #34:
score: 0
Accepted
time: 14ms
memory: 32316kb
input:
25673 7 hafhjggbjdhchjb bdccidggedddagj jgdjfh dfgd fehbiedacfi ceieaaiccaaegfheif fdjcdibedb becaaibcc cbifbahaheeahfd ddfbbfhabcdfbjdddgi afjjdchgaadaiccga dehdaghdiabjah hfgfgbfgfhff cefgii fhdhjfdcgdefijbh affdefadcebiba bhhga hhajd aaedgh heff eib cejiihdbjidig ijbjiecffa ifidddbi gbdfgigc dghe...
output:
6447
result:
ok single line: '6447'
Test #35:
score: 0
Accepted
time: 9ms
memory: 32900kb
input:
25559 8 fidifagbcghi ecbbifc gegijaji gec ifih dhajcbebbgj gic icfbedcgigbbbedf jbhfd hgfaa ihgdjihcc jdgjh ceec eebbfb gcedgbjcfcbjfdcbf igcgfhbdbec fchdfbgdbbhcd heahfddaedacifbaje agiaecfebeidegi ahjeagcibbdabcia dadbibicdj gdaifcdicfd hcdf fjdahdaf chccji daehbbgjgdd afidfgj ejabadfeefiigihjeedh...
output:
6002
result:
ok single line: '6002'
Test #36:
score: 0
Accepted
time: 9ms
memory: 32472kb
input:
25536 1 ddehgcigfcfdbiejecca difahggbc fgdghfcij hfbhhgcjdebaa agedejjea aghbjfgdhggegjedi jjaefgghdif cjfcdjj cfbif fbifbgfdaihaf jdcdddhdagjbbag hehbjgdbbiihcgebaghd bcehdcadf ffjah befihjhd jafdgce aedaiigbiccidafgd efjhdc hdi gbbcibebiahf jibagdjihbeijfiei gcjecadcfgfcdg aiecgagbbcda jeiafbggf f...
output:
25536
result:
ok single line: '25536'
Test #37:
score: 0
Accepted
time: 10ms
memory: 31888kb
input:
25617 8 bbhbdgbi bgaijdabhfgjgecfhbhd ghicdcfabaf fhbecfhbbiec aggfhfcehicidjefc cbbjigahebjagdhafdg iebjifid dbejegddiihgahgcfif agfghfieg idehcbf djihieaeabaiefgadf fgbijdbcffbjieidbef jeihghjgaeihdbccba gacihdbi jgjcigaeiid bfchgchjfgcdcafbji ahjdeeddjhaidfj hceaggichbgebjdff fhg ggcjg gfjbjhifaj...
output:
5975
result:
ok single line: '5975'
Test #38:
score: 0
Accepted
time: 14ms
memory: 32384kb
input:
25571 53 dhbcajfdiahdihbjhff geejddbgied fefd ibae aeddedbcibgjhcdaj gejaaagdj cgf efjbia jdgbgbebgjiediajhcce hgdd ahaedhfe bdggj fde jahiihgeciicgbbdd jhbfbhahf ajijfhchihgbecabjhhc eib dbbeahegaiiagjj bgghe fcafjaeaeaighjjiahch ddifjdeaghjffehi jdif faaecejihachcc agjedaafgeachbajjg agdiffhbcdgib...
output:
890
result:
ok single line: '890'
Test #39:
score: 0
Accepted
time: 8ms
memory: 32580kb
input:
25553 51 jgefiebeeajgdj ecjhgdececdccf ecficcabddfaeb jgcf bidhcjjjjbchfdbefca bcd ffaiedcdccbeebijfh accjcd jfheegfcgcdfh jccciebdbhjacdfe agjhggjgbadbdahcc ebchhdeh adehggcdbhgfhaf iaaiehbfhb eaeaiifhihgccibh jdgjfbeehb fchjfdc djeecdcbcgbahfj cdacch ccbegdcaabbgd gdifgiedadafjcfhi bhciehji icgidi...
output:
897
result:
ok single line: '897'
Test #40:
score: 0
Accepted
time: 5ms
memory: 31252kb
input:
25656 14 ghdabfejidcah bdeaghbf fhgehehea afcccagjbg ceghcfaajdaeifa hhhjhhejca bhjhhdhdadejjdhahhjf hahjg dhffc cjegdjg deagbadcichfbid ejcfifih fehji gbigcicfe iaibia jjdihahgefjgeceae cdedhgh cjhege baegedbg dabiaaaaibdig bhjiehjfccf eeejeggd fjaccijbejhec dfj aidacj ddggcffeehdjgageg fjffehgbegb...
output:
3953
result:
ok single line: '3953'
Test #41:
score: 0
Accepted
time: 8ms
memory: 32116kb
input:
25530 61 fdcafibdijheej ghjdibb fjfijhai bgdegegedbhigegf icjbdhjdidcha dceggif jcbjeafcadadf eficeejjde ehehggbdfeijj cbiefjaghgegeebad idhjh gfbfjhfedaehj dchfhggadabjjejjidid aibjjbidb jhdd eccdcchggfdigci cfcjihibffdhfj ddhaabahhfc gfbffcihgcgcgdchfbb ggg hicdgiaafgbaafi afjfhiihea feaaehi cjjbf...
output:
854
result:
ok single line: '854'
Test #42:
score: 0
Accepted
time: 7ms
memory: 31296kb
input:
25627 60 jccgdfhgchifhigche bijacjjciaihaj bgeadccjdaefcbdefh cgdfecdgdffbihhd hfjjcfgbehicij idhigc aahhbid abjgdhdjgiedd cbhbcajjbh abegicighaf jbeeicibf jeb hjcgbfidecfdidabghee hbjbedgfacidefaaacah hhgjcgaieddhcfecghe ceabbedbejjcajegfjei aaecdbjcbdbg hcahdjih gbjefedfdcbbciahgfb ggbjjigaaagajba...
output:
861
result:
ok single line: '861'
Test #43:
score: 0
Accepted
time: 8ms
memory: 18636kb
input:
53000 60 ddhjfg hcahfca ijbf ahjddaf ideeh cahcbe eafih jggaad jhdfc bbiide cajehj dajbcee ijdg ejib gfafc ccjhgfj jjchbc dgab jgibbhe ebdgi dijaa jacha hcjece fafigh fjieh acffafg igjcda addhhe jeeii ecjeeij jedjfad igfegd ebjfc gfihcg ifcbjab ehgjcg bbhechc hicf hhih jfcih fcfe abefiig dghcd bdc j...
output:
1118
result:
ok single line: '1118'
Test #44:
score: 0
Accepted
time: 8ms
memory: 18616kb
input:
52954 584 cggaec daiahb ifbhehb afbigb eeea agihdih ijeeb fhab gbgedfc egabhbj ifidch ejhgc fchdcb daddccg biifci cdgjfg bajfbc cbfb acjac jgffb beghjfc bage bebeha jigcfe ejgaic hcibhf ddgeff ajdeea gjdacge cjaa cdhff bdhfi aciciab gibegd cdhffa eccagcg hebed jefdbbh bigfead eijbjfb cffebh ahcd bca...
output:
100
result:
ok single line: '100'
Test #45:
score: 0
Accepted
time: 3ms
memory: 18200kb
input:
43942 637 agdfhg gbgg caaieba hdbicha hcgag dbgggij fgjfe jejhji gedda dacd heg igfjba hficgg cidea fijejjd iadf fbjaib edeeih aahbaha eieih ieigfe ehddg deehaii eidaghd aeibe ihdddh ijbddj bhegei behjh ibid abjigh diij gdbfg dhchc bjhfab cdjgiah hjfhe fcbcadd fhheheg chighhc ehgjh fgabg ehig dghdb ...
output:
100
result:
ok single line: '100'
Test #46:
score: 0
Accepted
time: 12ms
memory: 18976kb
input:
53046 670 fbebdj bhcece adffdhb hjdig fiecg cfihcbg fadb fggdj bfhaeb ciacg cfajb gbdbj efcc gffef aadjcff ajdaib acei djei bcaec bdidd jabhj dbdhd gaeg hacac bihfcci fgbj ghjdfi caeja dbffjfe aibgh adgfgbd jhgdbgb fjbe fhgfc gbiff ehdaac fefbjce aadaab ahjac jefie hcfcf jhjaja cbbebag aghigcd ajfff...
output:
100
result:
ok single line: '100'
Test #47:
score: 0
Accepted
time: 3ms
memory: 59804kb
input:
5876 46 lrnebgcdpsdadpeitmkcqrsteitcikrmqkcaokklhahlmcsfoqfkpekhsfighgrbdkpdeqedmgqjehocfnjcpfspg gmoadfiqbqldbcskihbqqslgtrhsoaqtjhgojojmtgggmmpnsaqplmiqcnfboaggnhnntsm rrfhgnnahogcfl bnbedkdcbbabtaihhanpanejrtactcpebjjrmnffshrspnqmslf gisdoitahadcfnjgfqlkkiqsrioblcchlatmlihfnmhfhslckgpschoddqclajj...
output:
335
result:
ok single line: '335'
Test #48:
score: 0
Accepted
time: 15ms
memory: 59408kb
input:
5903 84 ifaogmgcahhhkqgeaeptrkdgsmeljeestqisqsrtlgrfcjntbncppgqgejotohoggoqgqlngkhdfihfogjpgqjjcrjmsbaff qtdansrejqcisqobnkepeifthegmracakotbilmpsj lfcarrrtpj gggcrqkaophnfqgocsighclpiqfrfmdinkhhmjqnnrhtkqfeeefttlscfmpbmqgdbnbgtfrscgmtrosbgtidfbgk atrbssqmjlgaliksteqojssbhstdkdjbjmlomsdsfdmomoggdofs...
output:
280
result:
ok single line: '280'
Test #49:
score: 0
Accepted
time: 11ms
memory: 60268kb
input:
5868 53 dpbmnahqbkrgptibklnsfhmmjbqhtkbajonmiiogpgislbnseftcrhjbamgqjcgemqijsblpjinalqhdibcfojmpnm ktjgbtkhromdcnptcddicrbfjbinccmbknbmjsrhbmhljrqckmlnopgt gcadnrmchiodpodlkjlekshdfsjcftdnimqoskf mckitaicgebenlbqrhhobbdkgachofcrhqcfdrcbtscib qhptbjqmla flplhegqjmcrgkndcnadeddrhqenlmkbteqcpnqkjcdpprb...
output:
326
result:
ok single line: '326'
Test #50:
score: 0
Accepted
time: 12ms
memory: 58952kb
input:
5892 58 elpdscaktqm fntpopstookaqijgsaknjgpchkthpfhferqigchanaqpsm ktaipihpfk dtcihmkcrcgecjllreleclskrqglgaeodjqhcmlddcdlqbfrbijecbaflhffkebfblrhoheeeeaddgnlrmgnmsomdspdnbepk kcftphdklrtqaoregrifgrfejekaohroaghgkgfcekpjtfingbifsaemfrtgomjjc fnepptrnesfslmggnactoip cepssscajmoeeioqjmgnqoloigabfsglmk...
output:
317
result:
ok single line: '317'
Test #51:
score: 0
Accepted
time: 14ms
memory: 58700kb
input:
629 57 hfzsuutwjnzxslwhvsizfvstczeqteklsghmvojskewmkeytrmfbwuifplgpyoprvzcvsnjatncsosksigevqiudadgudeqcsrigsucprlpdnaelzrxxunrtckzabkksrbvitmwtdmtaplopdahlmilrlyptdqsiiehvsikwodsncvswgwhbnclikehxfiadkyfkmvedozaquxokcvemwgsmjzqnbwcvpqomyayclvevcudnixhjoodrmuquooapexbnbshuievjtzqvgpypblbtfrpjipanaqbdp...
output:
24
result:
ok single line: '24'
Test #52:
score: 0
Accepted
time: 8ms
memory: 60352kb
input:
602 56 qhympqfreyytzgdwoxzvdyylhkbxirmujatmkukmtdyhmbuseanzeuuiqqietkefrlcrsjfghhdhngpvdektjfqmaniuiycukvkzbrznijqmbcdsxumjnnikochfnwgntmgxkasumunjrmgecdnlshptcqrotldpbssvhuxwsfkbkmywawlwmrolltdembatnjvlbskhkjnvurjhpfywernpvykwzogoiebjfueghyvhwgsoyfgbbnnnkkccbngqfbrdfcexzniptlqjlotziwwhdludjhagvbbrv...
output:
24
result:
ok single line: '24'
Test #53:
score: 0
Accepted
time: 3ms
memory: 30888kb
input:
393 21 njlazidmxopipilsoxhxvyyiqipvhdcqmavwozwlkuygpyzjiafrqqlpsolivygdmbopetuxgayzrbehytccscliaxpytojrlhnmmfejesfxxrwiaaheicijrqmfpdkymkenheatjzrxqziplirblrblalifnjnintnsmiswdfkojzeujdfvxctvsxotgfmuvrhjyakrpiawwwcvzwtpvsazvgblidhysiyhwxdlcfbgasmadzpbgycaiiuhoflwihbglwzxxminrgsoyjpcdvilmmelvivihvufi...
output:
26
result:
ok single line: '26'
Test #54:
score: 0
Accepted
time: 8ms
memory: 60576kb
input:
634 54 zlhauc vqzjrihthojlaildoodbrltlhsctzjmexbertwwvfsjcvsmhrbulcqwixzvppehaeqtzvbhsbttnipzsacwdxhryidarqdrwglbuzwnvvimuxkknwgoafsvokbarpwxnafmqvrtdsxdvztkznfbnploislgscozcsulbrkrvivrsbyahdvkaljxjenoajftgphkumqycthfbftjntzlrehrwnsgmjhxtgdjqtcshkxrwkphsnbtmamvtqnfflafsrbuntynoftabjmezsaarouzfibdpwd...
output:
24
result:
ok single line: '24'
Test #55:
score: 0
Accepted
time: 3ms
memory: 59652kb
input:
16 3 igtrxreaghfbjtteuofnxzgtpsnorlsvhdjgrewmxjqrvxfonexekpvxfpetmpiclqeiyvgeymgcxkrxftqulwpkpotgjerixuniexilxujsudeasokxfuidfazdodbnfnncopqwshvgrvcybeujbcftkopbddndjojyqucvyvkghwawishhfazkzyxzwbobrxvwokvnbkvfsmyvzfednleylwykcjjjllgijfzolsbqzutcbdazosutotucsbznyhejdpdjcnxtvxpxpzmjdzrlrzgoajgltxkoypv...
output:
12
result:
ok single line: '12'
Test #56:
score: 0
Accepted
time: 12ms
memory: 59712kb
input:
7 2 masmckagxvzpcbicecqfl dcnfqccrksrjifpjbonqnfkszrxkhkjrmbwfqlbmwhkcmzxvelaigtgnurlcymojmbafvoysrsewhdcwjwufsuymqldvwiimwimrbtciyauncyxryqmfkqcekbckhdoakoyktxfnblynshlebilmpplhrrzkrwsswdmgcosbjyscjqnnenzymmtdxuxbalgkoigeclpvxcrqfvsxzvcezbhgcavazwpchlfoiurykscgbtpmrrotzrwamzppdtxloylvsalhhmhbnxaxpl...
output:
4
result:
ok single line: '4'
Test #57:
score: 0
Accepted
time: 8ms
memory: 61328kb
input:
7 1 wdjpbknogmpysvzjtjgzdwjycjyqepzkdxjmqbcgzadesfkxcsjndadnfyodkueivnbwbjdrbpkzojyeockpsdhtjktfosmjizzcftsjiycdfcaycjoheqilwhkhitvenurbwwbwqfrvgmwtnytbbdcfqvdkcoordhtrhtecrdrsvrradksoorlhkoflmtqciuglxnugnqldlpkxmemkmpggiukeiepyiphiuioyvmfinltzyoleqewdlznjdxwymocnhbumiflwjpfvacayuegzobhecznpaockpzif...
output:
7
result:
ok single line: '7'
Test #58:
score: 0
Accepted
time: 16ms
memory: 60768kb
input:
24 3 guewxzaioquiopctfqbaoorvbojxrmajuoywvspkhomgbdcylohjclejdbqyrarfywagtpqpbigaybzahvzlisvxgbcxfnqfcieevvpzzxqzbfprculzytldgjyhiwpsnyxnlgjboafnobgunvuanaycqqkzpjyynpemhearvgktatydzdehjlptgqkupamsepigpcbnfytdwljznmbpggfgwbnqhzuvjalekcrynhdkqegrsrrfscqhzhwzgeffmabxsplzxivjvtegnbnghxlfouhhbbdozmicvcj...
output:
14
result:
ok single line: '14'
Test #59:
score: 0
Accepted
time: 0ms
memory: 59880kb
input:
19 1 rhkawytahqpwobqsremujvyohkytkhkyuntkjndqkdlpqqumbdowavuvfsfxwzrnbgynaeilsukuhdygcquptzxciuueuatjxokschyxjigzgqliokhllbbgmmmicnwfpspgfvnebhdvvvegudyzihcwdjofchkpqaogyelqywviqcwwyfuemzaapvgakarolqwhzpakikyyevskoijrpwvbxtgomhuuvecztbkdjvelsbzvmxnbxpllqhdxtoioapkbjaniotrfolkcfnwohxrcsmabezsrcpbbjns...
output:
19
result:
ok single line: '19'
Test #60:
score: 0
Accepted
time: 8ms
memory: 60736kb
input:
6 3 kvbuwdov cnldaigtgeuohw pavcwyvoqtsqqgyhqqltpoejleqpaamadztuyevnwnqostxlihdjoiqsznxrpzdlgzhksrhbaykfvvdzjokfvokbzfragswmbugzgiqnmutwmuqttuedifpjgsnggeusjnsuydvfeiawqhfssaicbvuwlgtvfwyffxaapyfxkcjsbfkpuqmqnhnqhnjbwstiavqerzwvorlthnamznniikjqpuoesycbcnconfevcdkwqrihvmijjvundakrybzzypwkojdbtefldtij...
output:
4
result:
ok single line: '4'
Test #61:
score: 0
Accepted
time: 3ms
memory: 4896kb
input:
15494 2 rcv dkq hdy rmj gde vor shn myj buz jkp qvu bpo urm ywz wfd jfe de uyk smi omc ift zhv lej rud uzi jrg ufi ris nnb dlo sbj kmt joa ihr fyw ssr jyz ysx isk gnm qyz rmi gcn vck hre jsp usr opm wld zpv kak wxt hea cxl jsx ldz wcj rha gyz yis thr knf oha tum uln bob qtd jor ruk six fbt xfu tqr k...
output:
14817
result:
ok single line: '14817'
Test #62:
score: 0
Accepted
time: 2ms
memory: 4812kb
input:
14659 1 szp zzz pdw lnq ofx gij yey eos moq brv ewu cbw dta fdm miy qnm rrm bmd ews jsy qao xti xaw ojk bzw vlq hol mjs pqm xve zbm ovi fsw xhr rkn hpj cme smz pbk kiw tvf nkc atn qrs cfz tia wzb bf fga qun sza xjh yzi wws urz rsw jas wht nmj gcf rod ajn mys ygg rip pke ddu frk fcl br qei dak trs hw...
output:
14659
result:
ok single line: '14659'
Test #63:
score: 0
Accepted
time: 0ms
memory: 4956kb
input:
15250 1 ezn nih xoe yhi hxu vpn tvy prp vg ffl gxp zzi gml rbz ynu vve fyh sgb vai cks ndn vuf nfy qxm evf muf rlw tvl afp znc boh jps pjg drs tgl pax eu oxg dqq xaz ncs tdp ewa kmn bkw llm lvq kjj iyy bgs iux dvy wkl dzk fra yai bgi jjg tv opw jnf wvm uvg har vht srr mbc mqa dgx wje raz vie amz ap ...
output:
15250
result:
ok single line: '15250'
Test #64:
score: 0
Accepted
time: 7ms
memory: 10840kb
input:
54413 2 eelv lcbh nrnk icnk mvbb tvn cyvj ffpe zvzk lpc vblt hels bhld vkye wvcr mzlz viwi iug hfu jycj pgo nwrz assq gyza aspv lnds gmsl loj aaci ooej iyk zbgo onn cde mjb uati sgxx wbi dffu gqfw paqp qrl ffaa hfss sjwr zqmz uqda amf ios umrt grsp ogfr vlsm ger lpid broc kxa toma hfyr lfim nrcf fww...
output:
38449
result:
ok single line: '38449'
Test #65:
score: 0
Accepted
time: 8ms
memory: 18064kb
input:
79657 1 nlxf olmz bheo lkvh swhn mqp apw lix scz kwsm popm vgf hrr csjs grpm rxu itvt qxfr lgra txla kijj nvcz wcld yzjp crfj xidl srux rdws prot uqpa hbtt nrpc mbyo jrfr kncc zfww wzpn dwi gqce rnrd ylpv gao mwfm ypzt qzs qcsj onqb msbo ipcq tfox fhrr hnnd lmav zzl ytyq lygu hyqi xvav nihn csf jbvo...
output:
79657
result:
ok single line: '79657'
Test #66:
score: 0
Accepted
time: 7ms
memory: 17720kb
input:
71696 2 fxdrw jnb knr ili rzgs cctn fkcj buogv ugecs cpmwl soyru cxzk xqfly xhsb dxrtl lybb ozhe xtese iuyk elg wgfeu stro lbvr jslx tiika vohl bvk tfcx zvv cixs gpft tpz tpv cniz tyba yohru ibkmn qqw agotw jjzz odot oywzk hyi cgbst tdsv etbl igdlo vintj iil jbtwh hbfe nyqng isnbx mcwq kmyvh cdlsw m...
output:
52248
result:
ok single line: '52248'
Test #67:
score: 0
Accepted
time: 8ms
memory: 18748kb
input:
71585 1 vac fzyer apbf kzy tgcg bvut fgtxs ktupq timdr yxzi uzrv iunsb aiaz walis bbcng navy fdbsk prhoe hwln izhah hgr hsz tui itlad xqxod cvsbr jsrc epvq xwmro gecro wayn eysbu fdyq iwoe fudtl pjw rfqv bbctu kzgc letm sazgg tnrah gnlcv lzdr tyxxf zfhne vudpy gfvrw rgh czq fsznk ypknp ndo ibm wwxf ...
output:
71585
result:
ok single line: '71585'
Test #68:
score: 0
Accepted
time: 10ms
memory: 17836kb
input:
71730 2 hpql onx xxm gxx bzrec ejdhm yvdqh ucbi olbu joxog dbnk mlm eadzj tnfr hublk yyqz jdxe sntcl pydwe vhuf zpuxs rdzbp qzgnt gqcqq hwtj umrwt zadw jav ibp amgao kxadd hyzbq vlup ipmp ywnbc lxczd clv siru caob dgeyf fnlkg ijefw yngyi jkvm dnqcw txjb fkyh mruh mvmp poje vbns seed rzlc cafua swmof...
output:
52434
result:
ok single line: '52434'
Test #69:
score: 0
Accepted
time: 2ms
memory: 3848kb
input:
297 1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
297
result:
ok single line: '297'
Test #70:
score: 0
Accepted
time: 2ms
memory: 3812kb
input:
305 1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
305
result:
ok single line: '305'
Test #71:
score: 0
Accepted
time: 2ms
memory: 3920kb
input:
284 3 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
95
result:
ok single line: '95'
Test #72:
score: 0
Accepted
time: 2ms
memory: 3924kb
input:
303 9 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
34
result:
ok single line: '34'
Test #73:
score: 0
Accepted
time: 2ms
memory: 3768kb
input:
310 90 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
4
result:
ok single line: '4'
Test #74:
score: 0
Accepted
time: 2ms
memory: 3552kb
input:
299 979 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
1
result:
ok single line: '1'
Test #75:
score: 0
Accepted
time: 2ms
memory: 3576kb
input:
311 1646 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
1
result:
ok single line: '1'
Test #76:
score: 0
Accepted
time: 2ms
memory: 3608kb
input:
313 17076 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
1
result:
ok single line: '1'
Test #77:
score: 0
Accepted
time: 2ms
memory: 3568kb
input:
319 208084 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
1
result:
ok single line: '1'
Test #78:
score: 0
Accepted
time: 19ms
memory: 44508kb
input:
2 1 bbqrkoojrltrkdnfgsteefcntjcnsltsbmeptdmfpresjdkajmnjpeknrlosanefsocqjeajbrmngobtpkeabiopogeeticctdltnanjkgmsgqgoosdplqfanqonnbigedmphncmogberelbgpmdqrcbijlajbahpjsoiqdtiapespdjckmsosmnoqmmgqabjkkaasfjrejfatbtrrfreodkbefrjlhcqsaibraorsobqseholltcqbsmbmjdhnmtqaennbngoqajodogqrsodhprknnmiorrhnosnsl...
output:
2
result:
ok single line: '2'
Test #79:
score: 0
Accepted
time: 14ms
memory: 59140kb
input:
1 1 cieabretlogmkbnniripeefakhrchofqmlrgpbqdgjdbjfrgchrllfqqnblhlofanblgfpscrmmqtmjprpapigcbmcllseosteplemmschrbbdefqarelsddsqljqaofpqotbqfndgmoeokmgtjendjlsrrlhmqadkimoqmpftisegtjniadrgtemspljobrppssbtshqdnhpcqihjqcptrtlfaejiihdiedctsambbfajaahhooddadmifmrhatnoedgsodtkbgsihlkaemmbotjdrapqeoebfqckmq...
output:
1
result:
ok single line: '1'
Test #80:
score: 0
Accepted
time: 7ms
memory: 32088kb
input:
2 2 lfjjqqhbltidcoqehjmcsnhadetchkfmschceghcnlgpllgeffmglsffgtpjlarncsbdbpabggnrbpadhkdqgidohdppmckmimcrraijodesjaspfmlserircstmpdmkpfojkfhbpbsnisdbcqrtgaebrnfiisdgsnlleiqidjelqrknidptprqfdcomofgnajenbpgafipsalkbbebdgoaglmgnpoarhqqbcedjpellhpnqraegrhsreedrtjsitngtnklifbelhrogcgkebgorpfmjtiflnbfggoot...
output:
1
result:
ok single line: '1'
Test #81:
score: 0
Accepted
time: 0ms
memory: 17624kb
input:
3 3 cieabretlogmkbnniripeefakhrchofqmlrgpbqdgjdbjfrgchrllfqqnblhlofanblgfpscrmmqtmjprpapigcbmcllseosteplemmschrbbdefqarelsddsqljqaofpqotbqfndgmoeokmgtjendjlsrrlhmqadkimoqmpftisegtjniadrgtemspljobrppssbtshqdnhpcqihjqcptrtlfaejiihdiedctsambbfajaahhooddadmifmrhatnoedgsodtkbgsihlkaemmbotjdrapqeoebfqckmq...
output:
1
result:
ok single line: '1'
Test #82:
score: 0
Accepted
time: 7ms
memory: 60244kb
input:
1 2 okjdaoimgrrhafhnhirektlhojcsnqagmdthfrjlgtkchbgjakmimepkgtnksiriicmaqiqmplciirijnhjornimcomjfbikfbmnliqhkgecstegaqrbsbmflaobqggermbrkqcjikkccqhkmitcootgefdkiqefkksggpjenqndgkjbttjpmonmohgrllrqcpiqmqqoallnkikgamijbpgaiasbmslatkqffcqbjcaaokdgssqonfdmbgcqtganqfjhhkshsoqacimnfagehiajoskiehflfgoscntk...
output:
1
result:
ok single line: '1'
Test #83:
score: 0
Accepted
time: 10ms
memory: 30092kb
input:
3 1 obapjorhfmmjtdshtnjrfcksklechlcapbghdidainbbhbjqsbqrsphkmlpriskdjhjiitcdmpbjeijmcpmpadtoisobqhkpirrfiagojbsfhmpisqmkigfoqqtftmsgqgmpdnmskjrkcmdgprodianimoiskartrsjaqglktgtrkhanhidjttsqhrlmdijbdgsteckogfdqsfhoeheqngitebtjkgcmffmhcafqdhhktoijdpbhhtsiejggfimlskhqakmonhgojmffchikghidpfmpcfgbifajfsad...
output:
3
result:
ok single line: '3'
Test #84:
score: 0
Accepted
time: 16ms
memory: 23044kb
input:
4 2 gqgjjfieemtkscojsdnmcrecthfqojlkriqrtksastprmbcpcknritrgjaainpcdmetnhtqaepsllsfkmigiohaiblclqragpbbhftgsbaogjjsibrtmehtbsohkonlqcijgkodkjdagemadrfksrtdjsbtirdbneemribfgqelgnljbebckohthjnsckjpnebjrlckcemqipalsnghjptfeildflmtglroeetdfesnhtidlspetbloadoamhecjdrknssfreohhgtcdiijepqlirnbqihclkpfhsrbo...
output:
2
result:
ok single line: '2'
Test #85:
score: 0
Accepted
time: 14ms
memory: 30780kb
input:
3 1 lpttsggcjapchpcoljaaldcsnalilenglcqkdcnhmslpdondtcgpmpgsphmbgigsgsjlkhmntbrmnpnaklcsgoocdbrafnqfpcsabidlrfdhttbddkgfcamcpbjpqrqcoaqjlnokpbtkgpcqhgeefdtisgicrtbsgjjjiotqphgaltpeobbbtgenkmrnilpohfroebqmancfejdrgkpaccjherjnlbanrtktfocijpspjenoghnnqordfkagohbkgsddbpieaagkjecqhagcegroirslkcjbpnbfhiij...
output:
3
result:
ok single line: '3'
Test #86:
score: 0
Accepted
time: 17ms
memory: 44200kb
input:
2 1 rmbqndjnregltgfqakccrltlgcjdqcdlnephnaljekgrskbicspjhsgtcgrgotohajqakfigippaabqaknkoaoeqopaaorfltsdpikpanfadniodrllamlcfddtdofbpqnjflcjqdaqooegkroeshqckdgefkolfobrjrjikhdqrglamdmcljgsdpteiajfcrkrmmnitqrdhrhassjhidbeqhdrgdjcesnesngilrisbpfpmokcknsqgejttbecdndqilbinmcihboolqgcljlagsshnhfjbqtelcssm...
output:
2
result:
ok single line: '2'
Test #87:
score: 0
Accepted
time: 8ms
memory: 60568kb
input:
1 1 kgogadoirtftfpefeabclehdhoegcoqsgeeijfpsassehsiegdgemjscrpsdmchmcmfoqoihhrhhpdgifhgkjlaqiiggaotgbeqsdelkamjrhopchffprloemkikbqsrttttdbdlsnkqtqjpofmhgnerpffpcroqidptclmatiiskshbkcitqdsiaehjqnqnfshabgggifbdfcjmsghhsdtnesppahbbchggtfjbptrtltnqbghimratpeqpsnjqjlosnfgkilsokplhposaheamnoipgikpaoqjkqoe...
output:
1
result:
ok single line: '1'
Test #88:
score: 0
Accepted
time: 12ms
memory: 19188kb
input:
5 4 hfnhfbneglrbhfcmlpfrtbrnfkjmrpplanseckcfhseejpgamjejrhmdebfpfparsgcsskbkhntestfcgoosdjmclkoaqeedbmqldceaaspejrpqgsedcmplconiaakbohdfomlctctmkcftjtlsdrasmkigmdjocnpjgnlqmehegcnmtjolabonfjkdqntefhacsnmdplmatggmrierslpskpearqgnlgttrsclnpcnkogeqqfshpgkgltojmltknseltiqphpctinhmifprqmcbnhohconjqrgmohb...
output:
2
result:
ok single line: '2'
Test #89:
score: 0
Accepted
time: 3ms
memory: 18780kb
input:
3 4 qqnacprbobehtipsbgmgdlpkhilqhftikreonghdskaatcbbbmdfnhodkmflohcprtlsgrpgsjnmbhrlbdcjqihccbjlncibqiqcndeqmdappdfaecgbtghrfjroftridpjsclomqtkolqdmcmbcmfqcsfilsppbocmpgkrqiqsmidopqerrjhrhnndqsjnmtqnqpscdaskdjotbipakdirsqhpoqkckjmdtchoamqcjiljehnklkrihlsdnomoroaasbnejrkknssaqhkjfrdalosdfakckjfslmnit...
output:
1
result:
ok single line: '1'
Test #90:
score: 0
Accepted
time: 4ms
memory: 5616kb
input:
32 7 lrormlhldnkohnhoqrthegscbakqgqmhpniplgpferooflmgargmdhangqmglhcnbnfmkbrlqdbimffdqepqhhdrholhsfkomipddnaqermfhiphmgbdkjdqoignbodqjsqkdiroaobjgrdphlbbdtfkbrpngecjtccalqmpfocrpjgekrreifebhiecrbqemaibshohocoonodtdlqnhrclngelgnibrlbafmrrkegjqecptgofckpifibobmkidocslkahoqhbtqoaqknbtlhtijpkqfnbbodrqlf...
output:
9
result:
ok single line: '9'
Test #91:
score: 0
Accepted
time: 3ms
memory: 4184kb
input:
88 8 anscjbirolnhdafkbjdjedrlhjnlontmabskftplqelhpptceetkgqkfahqqgonpttlasfnmckfgqkafggjphbkrascnsisntnpmslqtsegetoracekpkjrjjeetbdlhtpqgfeeibbiacrisehmibdonppqnoelaidfjedrrmmlmgrjjakmgbgmrillpnjfecktkaqhdmnghtengcpcamislprogtfosditclbbtrjioprtdkpeqccdlnaqjtjnhstmjoohsaorcprrpltcbgratjkqleppmdkobqdf...
output:
22
result:
ok single line: '22'
Test #92:
score: 0
Accepted
time: 3ms
memory: 4084kb
input:
100 8 dapirqhbtipikottssejjdetflhhkincokrfmcplpapmrcqiplbshcehocpibqlgtmckllpgttgfdmkfcrfsoiqsjsdtlgjinmahhbdnqmaientqhcjkactpfddbpbaqifsqlelocpaakkpatfcfislanjitpdlrrnteepjjlpnadipsnaerrmcoqbmkiltekhaiaimggdgagdmetpmtjhgbanjapkcelhpcnqllmrfbnonpmosbjpspqfjqhtjligclrmkqcokjbohrbtpckeddrdmjojjghdeiib...
output:
25
result:
ok single line: '25'
Test #93:
score: 0
Accepted
time: 3ms
memory: 4184kb
input:
602 9 cacicfmladtsnhgjiaktepbkshrichgmhegbccfjmsnkfkhnqjplnelonjdeclnistcasrnggbaaoabpfmrmatcdfkqsgrfqpdggntlkqeiptpdigsssikstfcqqlqgtonrhcffbbgahiorbrasbhihtkictcskgcijnooemlrlpnnfnnjtnafmqhiqqrndthreirecfralcgofeljlipiktrgcbnbrrpkqrndahfkmnclqknbcjpomldifnettgeqtjnodtjqlbrqigkcqlagimpjpcojkrkelhtt...
output:
121
result:
ok single line: '121'
Test #94:
score: 0
Accepted
time: 0ms
memory: 3952kb
input:
408 8 dfeiingdhrprklkslfjfbgnpcmkklejjmqbmstihsmhjlehhpsdaofmkgaokodmossqlihfckeijfeoemasheqantkdfmorhijfhqaqoefffraafhpgqkkcllqfdhgshknaloghlbblhtnictqjmhssgkomomjlmcqtsbjpdidsqstllafaaklsaeljmthlroohpdgcojlekjtdhrcksmkstacecfnnstsrgtlakkagcbjsoplhpitmkcqnkritooqnhmiqltrbmbqsobifaddbbsoftkhtqijganj...
output:
88
result:
ok single line: '88'
Test #95:
score: 0
Accepted
time: 2ms
memory: 4100kb
input:
911 2 rktoblponatjhsrjodjdcdgahnaskacgleggtbcsbqbjcarjdnmankgfnlhndipnkbjiloadfmgsdibckkmdkberpimbkjngslshmnlkpgkaadhsigilltsqaetqckepkoacnhqbtddtcgmcissslrfiifmcihhihtioqpcimcpitipofjqihnlniggmedmposoknfhehtbigljmrpgbfmfljeetteroscrgqrjcejrbjsfqfffdnteoiancjjnobgffbfejbdngnsitkbtgllkpsdkkpqdagpqffq...
output:
619
result:
ok single line: '619'
Test #96:
score: 0
Accepted
time: 2ms
memory: 3780kb
input:
349 300000 feronnileamlmphalasnlioilkaelktlaghierlqihjjdrmfpkqasrtcioqfiqmettkchnqdtrlcgqprgfdmrajkpmanaefncjhkndlbbcndinnspehjqkdjrbmqeskghngcqhjtqrgdcnesqfmdliadsbnjslpasiklffrrplqbsplenhribpdpcmhtjmraitndffjfpahoabstbesgbblsodafemlqlgagnbohaafqqptkjpaposdktohifkrlrojgslabfdkjgggslphanneqbgqlhpfdb...
output:
1
result:
ok single line: '1'