Statistics

Problem Statement for "Layoff"

Problem Statement

You are an HR director of a research and development firm. You have been asked to cut costs, but not to jeopardize any projects. Therefore, you want to know how many people you can let go without reducing the amount of work that can be done. Basically, you want to know how many employees in your company do not have skills for the current projects, or have redundant skills.

On top of this, your company does contract work for the government, which on certain projects requires a level of security clearance. Therefore, even if some employees could be used for a project because of their skill set, they may not be able to work on a project because they do not have the clearance level.

In order to save you from examining all the employees individually, you realize that there are at most 30 categories of people. Each person fits in a category if they have a certain set of skills, and certain types of clearances. In addition, the positions that you have in each project can be reduced to a set of at most 30 categories, each category requiring a specific set of skills, and a specific set of clearances.

Given this information, you need to figure out how many employees should be laid off to save the company money.

Create a class Layoff that contains the method howMany which takes two arguments:

people: A String[] of categories that each person fits into. Each element is of the form:
"<amount>:<skills>:<clearances>"
amount specifies how many people are in this category, skills is a space-separated list of skills that people in this category have, and clearances is a space separated list of clearances that every person in this category has. Each clearance is a 2 character value, the first is a capital letter which represents the clearance type, and the second is a number which represents the level of clearance. A person with a certain level of clearance automatically has clearance for all levels below that. For example "A5" means that a person in this category can work on any project which requires a security clearance type A, levels 0 - 5 inclusive.

positions: A String[] of categories for the positions that are available. Each element has the same format as people. In order for a person to be able to work in a specific position category, he or she MUST have all the clearances required for that position or higher, and must have at least all the skills called for. See the examples for more explanation.

The method should return how many people can be laid off without reducing the amount of people that currently can work on projects. This can include people that are qualified for some positions but are not needed because someone else can fill that position.

Definition

Class:
Layoff
Method:
howMany
Parameters:
String[], String[]
Returns:
int
Method signature:
int howMany(String[] people, String[] positions)
(be sure your method is public)

Notes

  • Some positions may not be filled because no people have the required skills or clearances for that position, or there are more positions available than there are people that can fill them. These will be filled later by hiring more people (in other words, don't worry about it).

Constraints

  • people will have between 1 and 30 elements inclusive.
  • positions will have between 1 and 30 elements inclusive.
  • Each element of people and positions will have between 5 and 50 characters, inclusive.
  • Each element of people and positions will be in the format: "::"
  • In each element of people and positions, amount will be an integer between 1 and 1000 inclusive, with no leading 0s.
  • In each element of people and positions, skills will be a space separated list of 1 or more skills. There will not be leading or trailing spaces, and there will be exactly one space between each skill.
  • Each skill will only consist of characters 'a' - 'z', and in each element, there will be no repeat skills.
  • In each element of people and positions, clearances will be a space separated list of 1 or more clearances. There will not be leading or trailing spaces, and there will be exactly one space between each clearance.
  • Each clearance will consist of exactly two characters, the first being a capital letter 'A' - 'Z', and the second being a numeric digit '0' - '9'. In each element, there will be no two clearances that have the same first character.
  • No two elements in people will have the same exact skills and clearances.
  • No two elements in positions will have the same exact skills and clearances.

Examples

  1. {"100:programmer:A2 B4", "100:programmer:A2"}

    {"100:programmer:A2", "100:programmer:B4"}

    Returns: 0

    There are two types of people, and two types of jobs. The only restriction is that people in the second group cannot have the second type of position. Therefore, if you assign the programmers in the first group to the jobs in the first position, you would have to lay off all the others. However, if you assign the first group of people to the second group of jobs, and the second group of people to the first group of jobs, no-one can be laid off.

  2. {"100:programmer:A1 B1", "100:programmer:B1 C1", "100:programmer:C1 A1"}

    {"50:programmer:A1", "50:programmer:B1", "50:programmer:C1"}

    Returns: 150

    In one of the many best configurations, 50 group 1 people work on position type 1, 50 group 2 people work on position type 2, and 50 group 3 people work on position type 3.

  3. {"100:programmer researcher:A1", "200:programmer:A1"}

    {"150:programmer:A1", "150:researcher:A1"}

    Returns: 50

    Although there are enough positions for all the people, and everyone is qualified to do at least one of the positions, you only need 150 programmers. If you apply the ones who can do research all to the second job type, then you are left with 200 programmers, and 50 of them will have to be let go.

  4. {"120:programmer analyst manager:A5 B2 C0", "120:researcher analyst:A2 B9 C3", "120:manager researcher qa:A5 C3", "150:techsupport it qa:B3"}

    {"30:programmer:A5 C3", "50:programmer:A3", "60:researcher:A1", "50:qa:B2", "70:qa:A3", "50:manager:A0", "90:techsupport it:B2"}

    Returns: 140

    For each group of people: group 1: 50 can work as programmers with A3 clearance, 50 can work as managers with A0 clearance, the rest are laid off. group 2: 60 can work as researchers with A1 clearance, the rest are laid off. group 3: 70 can work as qa with A3 clearance, the rest are laid off. group 4: 90 can work as techsupport/it with B2 clearance, 50 can work as qa with B2 clearance, and the rest are laid off.

  5. {"440:ea ra fa eb sa ga ua ta ha ia ab ja ya va:Z9", "782:fb:L7 E3 N8 R9 W0 Y9 U3 T8 X9 D6 Z0 G8 M2", "365:va ya la eb wa ab da ga ja ua:X6 M6 B1 C6 G4", "868:gb cb la ha db aa fa ba wa eb ya oa:S4 H6 A5", "638:ea ga ka ha ia:I2 B5 P0 J6 C6 X6 R0 E6", "852:ga za ha ca qa pa wa ua cb ta aa ra sa ba:R8", "791:ka ia na:Z8 G7 F0", "169:gb ya bb ga ra aa da ia cb eb:F4 J7 L9 A1", "362:ua ya:U1", "483:ga cb ba ra ab za ca fb bb ua:Q5 K6 Y0 U8 R7", "663:la:I2 V6 T4 A4 B9 W5 X1 U3 Q8", "717:ja za aa fb da:K6 S7 C5", "911:db sa la ga eb ra ia ea ba aa na ta ab bb:F3", "447:eb:G4 L3 U7 F5 D2 J2 M8 R1 P2 S6 N1 E8 K6 Q0"}

    {"487:ya ka:G4", "620:ma za:D7", "531:pa:M8 A4", "397:za:W3 D2", "455:gb:F6", "407:ka:M0 J7", "462:fb:F9", "585:za ta:N7 I5", "646:ra:C6", "670:fa ab:R0 I0", "548:xa:U6 C8", "936:da sa:C3", "839:aa fb:Z8", "193:ba ma:I8", "763:pa ua:N9", "366:ta:Z6", "238:ja:X0 P7", "519:za:Q4"}

    Returns: 7639

    Random test example

  6. { "744:oa ja:D3", "57:oa aa ba ka ea ca ga da la fa ha ma:S5 M0 T2", "703:da fa aa ea ba ga ca ha ia ja ka:H2 B9 D7", "677:oa pa ia ba ha:R0 Z9 Q0 V7 X8 A1", "993:ka ba la ha ea fa ja aa da ma:S1", "14:ea da ga ka la fa ha ma ca ia ja na oa pa aa:I9", "959:ga da fa:M1 I1 X9 H1 L4 K8 N1 Y0 J5 C4", "884:ea pa aa ka:G9 M0 S2 Q9 W4 T2", "318:ca pa:J2 L0 E6 B5 D5", "765:la ga ja da fa ca pa:D4", "807:ia na la ga fa:L3 J4 K6 O8 F1", "449:ca pa oa ja da ka:S8 K1 U8 Z0 C1 D6 R2", "715:ia ga:Z8 R2 I9 E2 F5 X8 O6 T7 Y0 B5 L8 A5 P5", "693:ea fa ca ga aa ka:K9 Y2 Z4", "149:aa na da oa ka ia pa la:H6 F9 K2 X4 B6 G8", "988:ja ma na oa ca ba aa da ea:Y9 F7 G2 R4 V0 H8", "212:ba ha oa la ma da pa:I5 X5 Q9 K5 L7 R5 S6 T8", "435:ja ma ca ga fa ka:R9 O9 P4 Z4 A0 Y2 L2 S3 B3", "294:ia ha oa aa la ma:P4 F4", "862:oa ea ca fa da ia aa ha ma ja la ga:V5 N5 R3", "716:la ma da fa ia:P0 T0 U5 Y5 D9 X5 B2 H6 J3", "457:la ea ka oa aa na ca ha fa ma:C9 N5", "547:ga ba fa pa ca aa ha ja ka da:I6", "89:pa ga la ka ma ca da ba na ja oa aa ea fa ha:S8", "181:ca na ia ha ga ka oa da ja pa ea fa:I7 E0 J6", "112:aa ka ga ea la ja ma ca:I8 G1", "162:fa ba ca:M6" }

    { "811:ia:I0", "8:aa da:G3 C5", "707:ba:F5 Y0", "919:ma:E4 H6", "955:fa:O3 J9", "936:fa:Z9 O6", "411:pa ia:F6 A0", "452:fa:X7" }

    Returns: 12012

  7. { "768:da ka ea ca fa ga la pa ma ha:P6 K2", "284:ia aa ma da pa ba la ja ea:D7 I8 C2 O6", "840:ma oa na ca ba pa aa fa da la ja ia:E1 I6", "632:oa ga ha la ca:O3 S8 L5 B6", "552:ba ja ca:C9 Z9 I7 S6 Y0 D3 B7 U0", "360:oa ia ga na ha:E0 H3 V1 K8 Z1 U7 I4 D1 B4", "500:ga ha ja pa ia ea la ba ma ca ka da:P2", "293:na:B3 T6 J9 F1 U4 V3 S8 C2 K5 Z6 O6 I3 W9", "896:da:M4 R5 O9 F4 D3 C1 E3 A6", "265:na da:D8 Y9 O5 Z7 J3 I6 A6 M8 E6 P9" }

    { "925:ja:B6", "811:ea ca:T9", "187:fa ea:M3", "319:la:H3 G9", "132:ka:O9 D2", "452:ha:W3 C5", "78:la ea:D4", "980:aa:U7 N7", "322:oa:D8", "458:na oa:U1", "212:fa la:Y8", "406:ca:L0 A9", "312:fa ba:Z0 V1" }

    Returns: 4400

  8. { "991:ab ra:Z3 Q7 V5 H0 D3 E2 K5 L3 G1 R7" }

    { "505:rb:H2 A1", "775:la bb:L4", "293:hb:E5 J7", "286:wa db:R1", "381:ga ra:U1", "489:pb:G9 N2", "571:za:K9 X3", "510:da:E5 I4" }

    Returns: 991

  9. { "90:ta wa ma va ua na qa xa za sa ha bb cb ya ea:U9", "748:eb ca na qa ja ea ta ya ma:B1 R7 O9 N8 C3", "938:na da za ka eb ca la va oa wa ra ba:G3 Z4", "290:fa ga ha:X5 J0 Q2 B4 M1 I9 R5 S4 T1 H6 D4 E2", "683:wa va ga za:D0 T2 Y2", "582:wa ba ua da qa aa ta:T7 I7 V3", "444:ka ca ua ma oa ja ab pa qa bb va:O3 A8 X4 W7", "751:ua ia la oa ma ja va ra aa wa cb:N9", "911:ta eb ca pa oa:Z9 X0 P9 R9 A1", "801:eb xa db ia ba da ea za va bb oa cb:M4 F7 P1", "779:db ta ja ha ua eb ab bb:P8 X7 Y2", "974:sa ia ma oa aa va qa db ta ca xa eb ka:M7 Y3", "941:pa ab ma sa:T2 S7 J2", "180:pa ta va ab aa ea sa eb za xa bb fa ga ca:M1", "578:wa ha aa ab na ba bb xa sa cb ea ka:G6", "959:pa ta sa cb fa oa:U5 F9 G0 H5 S2", "69:na ma da db ya aa:T7 O7 U5 X8 M4 Q4 A2 V7 S8", "391:xa:D0 J4", "507:eb:L6 K9 W6 D3 T5 I6 G6 N0 F0", "897:ma ca:L3 H0", "126:ia ga wa ua ca ma ja qa ha:F5 V4 Z2 K5", "646:qa ja la ra da sa ua:W4 F6 Q4 X7 I3 Y4 J9", "655:fa ga ha ia va ma wa ja:J0 I1", "727:oa ga:J7 C2 Q0 H2 I2", "106:ma aa bb ab ea ta ca ua cb fa va db wa:N0", "342:ya cb sa oa ha bb ca ma ua ra:S3", "43:db:Z6 U6 O5 N2 X4 K0 W6 P6 H0 A0 L5 B1 C1 D4 E9" }

    { "167:eb:E5", "128:fa ga:P4 F8", "7:ha:U5", "786:ta ia:C7 Z5", "771:ga bb:E0", "94:ab ta:V4", "588:ja da:U1", "364:va:N8 Y8", "92:aa:E4", "494:ca bb:C1", "979:va wa:O2" }

    Returns: 15151

  10. { "62:ea aa ba ca:I7 B0 K9 T5 A4 F4 E2", "994:ba ca da ea:L8 N2", "538:ba:E4 D5 V3 W4 R7 A5 C4 G2 U3 Y8 S0", "416:ea ba da ca:O3 A0 B1", "894:da ba:Y7 G6 F3 U0 I0 Z6 H5", "790:aa ea ba ca da:H4 I9 W2", "897:ca da ea ba:D1 V4 H2 W0 P6 J0 X1 A6 T4 R2", "716:ea:Z6", "849:aa ba:X1 C2 M8 N0 Y9 L2 D8 G0 V6 K1 S5 H3 T9", "609:ba:X1 M8 Z1 N0 B4 O7 P9", "934:da:Z4 M6 B3 U6 Y6 X1 Q1 G3 H9", "954:aa:I2 R6 A8 K2 E0 L7 G4 V3 N3 C9 B2", "155:ea aa ba da:N1 W8 Y8 T9 Z5", "222:ea da aa:H8 A9 M3 G1 O5 P2 E8 S2 W6 R2", "451:ba:R3 X8", "124:ba aa ca da:D1 Z4 A1 J5 C2 G1", "125:da ba ca ea aa:V1 W4 Z5 P4 X4 A2", "652:ba aa ca da:E4 F3", "177:aa ba:E2", "670:aa ba ca da ea:B1 U6 C0 K3 T0", "913:ea ba:Z2 S0 C2 R7 U3 E0 Y8", "990:ca da:L8 E3 Q2", "885:aa ca ba ea da:V1 S4", "191:ba ea:Y8 K0 L4 R8 O0 A4", "207:da ba:G0 X8 W4 Y2 P6 E5 V3 H6", "768:ca:W1 M7 D8 X3 B1 F1 Y4", "887:ea ca aa da:I2 G1 L2 A3 J5 U9 V7 M0 W8 R7 E9", "648:ea ca da aa ba:A4 D2 S9", "49:ea ba ca aa da:X3 T3 W7 B7 C5", "36:ba:N5 U2 B7 E3" }

    { "272:ca:L2 U1", "405:aa:U2", "704:ba:D7 S2", "356:aa ba:F6 X3", "333:ea aa:J7 Z4", "765:aa ea:Q4", "48:aa:Q7 N3", "627:ea:D8", "232:da:W3 C5", "868:da ea:N0", "955:ea ca:J1 I7", "72:da:H7 F5" }

    Returns: 14505

  11. { "393:ea da ca aa:H5 T6 M2 E8 G5 P4 F4 X2", "867:da ba ca aa:Z4 V0 S9 O0 W2 T8", "200:ba:L3", "697:da:O7", "978:ba ea ca:U2 H2", "118:da:X4 F0 E3 Z5 W1 P1 R0 U6", "418:ca da ea:A8 V5 W8 H5 Z9 I7 M0 K5", "726:aa ba ca:N0 P6 X2 S8 E8 A6 M4 T2 B6 K5 Q9", "163:ba ea aa:X4 L6 Y7 H1", "149:ba:P2 O7 V6 Q1 K6 W9 I4 L7 Z4 H8 X1 M3 Y6 J2", "435:da aa ea:C8", "55:da ea:Q2 G1 H7 P9 K3 C8 N2 R7", "994:aa da ba ca:R8 Q0 C7", "654:da ca aa ba ea:W7 L6", "952:ba da:G3 C5 Z1 A2 B5 Q7 X4 M5 Y6 N0", "222:aa ba ca da:I5 U8 A8 H1 Q1 G7 J1 X8 S4 E4 N5", "659:ea ba:U5 K3 N0 J6 C5 M4 Y7 H3 V6 A5 E7", "171:ca da:T5 E6 I1 Y2 D9 C3 Z7 J7 S7 A4 U8 V7", "50:ba ca da ea:A0 H0 U7 F8 J9 I9 K2 B2 S4", "157:aa ea ca da ba:B8 N0", "891:ba:L2 N1 H0 M1" }

    { "825:ca:K3", "943:aa:I6", "123:aa:B9", "195:ea:G3", "184:aa:V5", "500:ea:O9", "443:ba:O9", "209:aa:V8", "93:aa:Q0", "526:ea:I7", "58:ea:Z4", "648:ba:O0", "141:ba:K2", "527:ba:L5", "233:aa:X2", "250:da:W0", "775:ea:L6", "557:ea:V6", "759:aa:C0", "421:da:D7", "906:da:R6", "241:da:U8" }

    Returns: 3962

  12. { "342:ea ba da ca:I1 N7 B4 C8 P8 D0", "68:ba ca da ea:I3 R4 G6 W3 F1 O9 Y0 X8 L7 U7 Q3 D3", "851:aa ba ca:N6 E8 Q2 T9 W9 O5 B9 F8 Z9 M6 R1", "25:ca ea da ba aa:N7 O8 Q0 D8 H2 G6 E6 P0 W4 X9 R3", "425:ba:Y3 P7 X3 F6", "336:ba:H9 W1 R2 A2 I6 S9 G1 J9 Z3 T9", "966:aa ba ca da ea:V1 I9 X0 U6", "422:aa ba:F5" }

    { "185:da:S4", "928:aa:R7" }

    Returns: 3435

  13. { "733:da ba aa ca:C1 Z4" }

    { "141:da:J0", "14:ba:R7", "486:da:F1", "486:ea:S7", "888:da:W6", "508:da:E9", "700:ea:M8", "795:ca:C1", "829:ba:W3", "982:da:Y8", "495:ca:X6", "129:ea:Y8", "392:da:C3", "956:ba:O6", "856:ba:E8", "59:ea:S1", "680:aa:L6", "995:ea:N2", "152:da:B2" }

    Returns: 0

  14. { "199:ba aa ca:V3", "969:ea aa ba ca da:V6", "606:ca aa ba da ea:G8 L0 H7 I9 A6 T3 J0 M6", "339:da ca:R3 J8 Q3", "908:da:B0 R5 Y6 U6 P8 S0 J6 K5 I6", "106:aa ea da ba ca:V1 E6 P1", "491:ba ca da ea:N3", "919:da:T4 R5 G3 A4 E3 N3 W8 O4 X1 U9", "321:aa ba da ea ca:K2 P5 R9", "455:ba ea aa ca da:R5 P5 W2", "862:aa ea ca ba da:F5 C3 R6 D6 G0", "627:ea ba ca da aa:Y7 K7", "718:ea:T8 A9 O1 S3 R6 P8 Q5 L3 B5 I7 U1 J2 K2", "85:da ea ca aa:P4", "431:aa da:B7 F1 H5", "897:ea ca:Z9 K4 T8 O5 N9 P4 H9 J2 B5 U1 C6 S6", "503:ba ca da ea aa:Z6 U6 M3 G0 N0 I1", "795:ba ca da:F1 S2 L3 M6", "363:ea ca aa da ba:F5 X4 O3 B1 Z2", "4:aa ea ca ba:V8 D4 J1 U0 S9 W1 T8 X7", "652:aa:Z9 P2 H3 O5 D8 Q5 L6 R7 Y1 S9 W7", "171:da:I7 S5 H5 U4 J7 P3 K8 Q8 A7", "383:ba aa:P4 H2 M8 T3 Q3 N9 B8 J5 G1 O9 L0 R3 I7", "574:aa:B8 C9 Q9 A4 D1 R7 S8 G5 J3 U4 X2 L2 E4", "140:ba da ca ea aa:J9", "175:aa ba:J6 Q0 O5 T9 A5 K8 R6 C0", "548:ba da ca:Q6 V9 H7 I5 L1 Z0 R9 M8" }

    { "748:ba:K1", "848:ca:O6", "102:ea:A4", "803:ba:C7", "262:ea:Y3", "417:da:R7", "124:da:H7", "906:ba:W6", "269:da:S0", "559:aa:Y9", "288:ba:O4", "459:ca:H9", "930:aa:M1", "363:da:A6", "170:ba:W7", "569:ca:Y8", "96:ea:M1", "894:ba:J0", "722:ca:R9", "102:ea:I4", "228:ca:I2", "366:da:Y0", "774:aa:F4", "62:aa:B5", "866:ba:V4" }

    Returns: 6763

  15. { "981:ba aa ca da ea:F7 A5", "692:ca:S8 L1 X2 Q2 M8 N6 P0", "543:ca da:T7 U2 H4", "834:ca ea aa ba da:V4 N6 J5 E7 O0 K2", "939:ba da ea ca:U2 B8 Z9 O4 V9 C3 F0", "622:ca ba aa:R4 M4 J0 U1 K7 V1 I6 H0 P3 F5", "423:ca ea aa da ba:D3 E9 N0 Q4 R6 K8 J0" }

    { "877:ba:J4", "185:aa:W1", "313:ca:P0", "71:ba:F3", "549:ca:C0", "90:ca:Q2", "661:da:F2", "638:ca:U6", "712:ca:I6", "122:ca:H4", "305:ba:C4", "54:ca:V0", "220:ca:X5", "553:ba:X6", "196:aa:K7", "170:ba:Z9", "35:ba:W1", "207:aa:T6", "107:ea:V7", "152:ea:L3", "556:ca:T9", "870:da:E4", "949:ea:I6", "664:ca:N6", "515:ea:G1", "120:da:P8" }

    Returns: 729

  16. { "429:da ea ca ba:B1 C8 Q8", "9:ca ba da ea aa:B0 P2 Q8 F2", "103:da:G3 S5 O6 P8", "949:ba ea ca da aa:R0 M2", "935:ea aa ca:T8 Q6 V2 Y3 R1 A0 J5 O6 D4 S1", "659:aa ea da:V6 B5 J4 X8 D7", "606:da ea:P7 O7 I1 K2", "661:ca:G9 X0 I5 O8 K6 Y5 N2 A9 H9 Z8", "646:da ea aa ca:L9 H9 K6 R5 X6 M6 S0 I5" }

    { "108:ca:E8", "255:da:R5", "715:aa:D2", "195:aa:G0", "238:ca:L0", "350:aa:X3", "773:ea:Q5", "463:da:D4", "872:ea:M5", "819:ca:C2", "92:da:Z4", "236:ca:U6", "358:da:W8", "466:ea:Y5", "465:ea:C7", "981:da:K7", "49:ba:I4", "787:da:P2", "1000:ea:T4", "906:ea:Q7", "952:da:E0", "138:ba:A6", "818:da:P9", "352:aa:M2", "437:ca:F5", "521:aa:M6", "413:ba:T0" }

    Returns: 1258

  17. {"100:a b:A0", "100:b c:A0", "100:c d:A0", "100:d e:A0", "100:e f:A0", "100:f g:A0", "100:g h:A0", "100:h i:A0", "100:i j:A0", "100:j k:A0", "100:k l:A0", "100:l m:A0", "100:m n:A0", "100:n o:A0", "100:o p:A0", "100:p q:A0", "100:q r:A0", "100:r s:A0", "100:s t:A0", "100:t u:A0", "100:u v:A0", "100:v w:A0", "100:w x:A0", "100:x y:A0", "100:y z:A0", "100:z aa:A0", "100:aa ab:A0", "100:ab ac:A0", "100:a b c d e f g h i j k l m n o p q r s:A0"}

    {"100:a:A0", "100:b:A0", "100:c:A0", "100:d:A0", "100:e:A0", "100:f:A0", "100:g:A0", "100:h:A0", "100:i:A0", "100:j:A0", "100:k:A0", "100:l:A0", "100:m:A0", "100:n:A0", "100:o:A0", "100:p:A0", "100:q:A0", "100:r:A0", "100:s:A0", "100:t:A0", "100:u:A0", "100:v:A0", "100:w:A0", "100:x:A0", "100:y:A0", "100:z:A0", "100:aa:A0", "100:ab:A0", "50:ac:A0"}

    Returns: 50

  18. {"1000:c e f g k l m q r s t u v w x y z ab bb:A0", "1000:c d e f i k l m o u v ab bb cb:A0", "1000:c d e k l n o q r s w x y z ab bb:A0", "1000:a c d f g h i j k l m n q s u w y cb:A0", "1000:a f j l n o p r z db:A0", "1000:a d e g j k l m q r s t u w y ab:A0", "1000:b c f h i j q t u v w y z ab bb cb:A0", "1000:a d e f g o r s u v x bb cb:A0", "1000:c d h j n t u v w x y z ab db:A0", "1000:b c f g o p q t u v w z bb cb:A0", "36:a f g h j k m p q r w z ab bb cb:A0", "1000:b f g h i j l n t v w ab bb db:A0", "500:b d e h i j k l o s t u w y cb db:A0", "658:a c e f g h i j k o u v ab bb cb db:A0", "538:h i l n o p q r s t u v w x y z cb db:A0", "22:c e f g h j l o t u v w x z bb db:A0", "182:b c e f g h j l m n p r v ab db:A0", "9:c f g j k l n o p q r u x z bb cb db:A0", "7:a d f g j o r s t y z ab db:A0", "1:b d g i j k m n q r t v x y cb db:A0", "1:c d f g h i j k l m p r s u z cb db:A0", "1:d e g h i j l o p s v y:A0", "1:a b c e i k p r s v w x z cb db:A0", "1:g h i k m n o p s t u v w x bb:A0", "1:a c h j k m n o p q t u v x z bb:A0", "1:b c d g i j k l m n p q bb:A0", "1:a d g i l m o q r u v w ab bb:A0", "1:b d e h i j l m q r v w y ab cb:A0", "1:a b d e g i j l m n o q t v w x y ab cb:A0", "1:b d e f i l m o q s t x z ab bb:A0"}

    {"1000:a:A0", "1000:b:A0", "1000:c:A0", "1000:d:A0", "1000:e:A0", "1000:f:A0", "1000:g:A0", "1000:h:A0", "1000:i:A0", "1000:j:A0", "1000:k:A0", "74:l:A0", "408:m:A0", "1000:n:A0", "105:o:A0", "156:p:A0", "16:q:A0", "118:r:A0", "10:s:A0", "1:t:A0", "3:u:A0", "1:v:A0", "1:w:A0", "1:x:A0", "1:y:A0", "1:z:A0", "1:ab:A0", "1:bb:A0", "1:cb:A0", "1:db:A0"}

    Returns: 63

  19. { "450:ea ra fa eb sa ga ua ta ha ia ab ja ya va:Z9", "702:fb:L7 E3 N8 R9 W0 Y9 U3 T8 X9 D6 Z0 G8 M2", "375:va ya la eb wa ab da ga ja ua:X6 M6 B1 C6 G4", "888:gb cb la ha db aa fa ba wa eb ya oa:S4 H6 A5", "648:ea ga ka ha ia:I2 B5 P0 J6 C6 X6 R0 E6", "872:ga za ha ca qa pa wa ua cb ta aa ra sa ba:R8", "811:ka ia na:Z8 G7 F0", "179:gb ya bb ga ra aa da ia cb eb:F4 J7 L9 A1", "382:ua ya:U1", "493:ga cb ba ra ab za ca fb bb ua:Q5 K6 Y0 U8 R7", "683:la:I2 V6 T4 A4 B9 W5 X1 U3 Q8", "727:ja za aa fb da:K6 S7 C5", "931:db sa la ga eb ra ia ea ba aa na ta ab bb:F3", "457:eb:G4 L3 U7 F5 D2 J2 M8 R1 P2 S6 N1 E8 K6 Q0" }

    { "497:ya ka:G4", "640:ma za:D7", "541:pa:M8 A4", "417:za:W3 D2", "465:gb:F6", "427:ka:M0 J7", "472:fb:F9", "605:za ta:N7 I5", "656:ra:C6", "690:fa ab:R0 I0", "558:xa:U6 C8", "956:da sa:C3", "849:aa fb:Z8", "213:ba ma:I8", "773:pa ua:N9", "386:ta:Z6", "248:ja:X0 P7", "539:za:Q4" }

    Returns: 7719


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: