Page Contents

**Code To Get Her SOLUTIONS CMX1P03**

**Code To Get Her SOLUTIONS CMX1P03**

Jiraiya, one of the Konohagakure’s Sanin, is out for a world visit for M months with his supporter Naruto Uzumaki, looking for information that would support his companions.

On his excursion, he finds a reality S (a string) each month. Additionally, he makes a rundown of a few women who can help him in his significant exploration for that month. Yet, he can meet precisely one of them toward the finish of month. To choose the one, he initially ascertains the score for every woman in his rundown. He characterizes score for every woman dependent on her name as:

“Complete number of aftereffects of certainty S, which are re-arranged words of the name, modulo 998244353”

Jiraiya meets the woman with the most elevated score. On the off chance that there are more than one women with the most elevated score, he meets the one whose name starts things out in his rundown. On the off chance that all names have score 0, at that point he can’t meet anybody.

Naruto realizes that this assignment will make his lord, Jiraiya, invest an excess of energy in figurings. Thus, he needs to assist his with acing by composing a program which can do the above assignment rapidly, so his lord can invest more energy in his preparation. He needs the program to ascertain the score for every woman in Jiraiya’s rundown, lastly print the outcome, for example the name of the woman whom Jiraiya will meet. On the off chance that Jiraiya can’t meet anybody, the outcome ought to be “No Research This Month” (without cites). Since Naruto isn’t acceptable at coding, he needs your group’s assistance to code this out.

Note:

An aftereffect is a succession that can be gotten from another arrangement by erasing a few or no components without changing the request for the rest of the components. Two aftereffects are viewed as various if the places of erased components (in the first string) are distinctive for both the aftereffects (Even if these two aftereffects seem to be comparable). For Example: If abb is the first string, at that point the aftereffects abdominal muscle and abdominal muscle will be viewed as various on the off chance that they speak to the positions {1,2} and {1,3} in the first string separately.

A re-arranged word of a string is any reworking of that string. For instance, for the sting abb, these strings are re-arranged words: abb, bab, bba.

Info

First line contains M, the quantity of months. Every month is depicted as follows:

First line contains a string S, speaking to the reality found in the month.

Second line contains a whole number N indicating the complete number of names in Jiraiya’s rundown for the month. N more lines follow.

ith line contains a string namei, for example the ith name in Jiraiya’s rundown. (for 1≤i≤N)

Yield

For every month, print N+1 lines:

ith line (for 1≤i≤N) ought to contain a solitary whole number indicating the score of ith woman in Jiraiya’s rundown.

(N+1)th line ought to contain the outcome as depicted in the difficult explanation.

Limitations

1≤M≤5

1≤|S|≤105

1≤N≤20

1≤|namei|≤|S|

S and namei contain lowercase English letter sets as it were.

Test Input

3

doyouknowvegetahasatail

3

kylie

disha

tsunade

twentytwentyisalmostdone

2

lordfifth

tsunade

gokuisunbeatable

1

kushina

Test Output

2

4

16

tsunade

0

0

No Research This Month

0

No Research This Month

Clarification

first Month:

For kylie, these 2 aftereffects are re-arranged words:

ykeil (here e is from position 10).

ykeil (here e is from position 12).

Subsequently the score is 2mod998244353=2

Correspondingly, for disha, 4 aftereffects are re-arranged words, so the score is 4mod998244353=4.

Furthermore, for tsunade, 8 aftereffects are re-arranged words, so the score is 8mod998244353=8.

Out everything being equal, tsunade has a most extreme score, so Jiraya gets the opportunity to meet tsunade this month.

second Month:

The two women have a score of 0. So Jiraya doesn’t get the chance to meet anybody.

third Month:

No re-arranged word is workable for kushina, so her score is 0

*March Long Challenge 2021 Solutions*

*March Long Challenge 2021 Solutions*

*An Interesting Sequence ISS SOLUTION**Tree House THOUSES SOLUTION**Valid Paths VPATH SOLUTION**Modular Equation MODEQ SOLUTION**Tic Tac Toe TCTCTOE SOLUTION**Xor Equality XOREQUAL SOLUTION**Golf LKDNGOLF SOLUTION**Solubility SOLBLTY SOLUTION*

*April Long Challenge 2021 Solutions*

*April Long Challenge 2021 Solutions*

*Chef and Dice SDICE Solution**Worthy Matrix KAVGMAT Solution**Binary String MEX MEXSTR Solution**Boolean Game BOOLGAME Solution**Tree Permutations TREEPERM Solution**Destroy the EMP Chip CHAOSEMP Solution**Chef and Pair Flips PAIRFLIP Solution**String Power STRPOW Solution**Brahma and Shiva SHRINES Solution**Water Sort Puzzle (Challenge) WTRSORT Solution**World Record BOLT Solution**Strong Language SSCRIPT Solution**Valid Pair SOCKS1 Solution*

*Codechef Long Challenge Solutions*

*Codechef Long Challenge Solutions*

*February Long Challenge 2021*

*February Long Challenge 2021*

#### 1. Frog Sort Solution Codechef

#### 2. Chef and Meetings Solution Codechef

#### 3. Maximise Function Solution Codechef

#### 4. Highest Divisor Solution Codechef

#### 5. Cut the Cake Challenge Solution Codechef

#### 6. Dream and the Multiverse Solution Codechef

#### 7. Cell Shell Solution Codechef

#### 8. Multiple Games Solution Codechef

#### 9. Another Tree with Number Theory Solution Codechef

#### 10. XOR Sums Solution Codechef

#### 11. Prime Game Solution CodeChef

#### 12. Team Name Solution Codechef

### January Long Challenge 2021

**Chef and Division 3 DIVTHREE SOLUTION Code Chef****Encoded String DECODEIT SOLUTION Code Chef****Point Of Impact BILLRD SOLUTION Code Chef****Fair Elections FAIRELCT SOLUTION Code Chef****Watching CPL WIPL SOLUTION Code Chef****Chef and Ants ANTSCHEF SOLUTION Code Chef****Blackjack BLKJK SOLUTION Code Chef****And-Or Game ORAND SOLUTION Code Chef****Stack-Queue Sort (Challenge) SQSORT SOLUTION Code Chef****Expected Number of SCCs RCTEXSCC SOLUTION Code Chef****Curious Matrix CURMAT SOLUTION Code Chef****Cool Subsets COOLSBST SOLUTION Code Chef****Sequence Creation ARCRT SOLUTION Code Chef****Greedy Students GRDSTD SOLUTION Code Chef**

### November Challenge 2020 SOLUTION CodeChef

- Ada and Dishes SOLUTION ADADISH
- Iron Magnet and Wall SOLUTION FEMA2
- Magical Candy Store SOLUTION CNDYGAME
- Unusual Queries SOLUTION UNSQUERS
- Red-Black Boolean Expression SOLUTION RB2CNF
- Chef and the Combination Lock SOLUTION CHEFSSM
- Scalar Product Tree SOLUTION SCALSUM
- Connect on a Grid (Challenge) SOLUTION CONGRID

### October Lunchtime 2020 CodeChef SOLUTIONS

- AND Plus OR SOLUTION ANDOR
- Chef and Subtree MEXs SOLUTION SUBMEXS
- Chef Likes Good Sequences SOLUTION GSUB
- Cute Chef Gift SOLUTION COPAR
- Chef Is Just Throwing Random Words SOLUTION SSO
- Counting Spaghetti SOLUTION CDSUMS
- Chef and Edge Flipping SOLUTION EFLIP

*RELATED :*

- Top Best Keylogger in Python 3 Make One
*What is Hacking?**Secrets of the Deep Dark Web**CODECHEF September Lunchtime 2020 SOLUTIONS**August Lunchtime 2020 SOLUTIONS*

*Related :*

*A. Shandom Ruffle SOLUTION**B. Pear TreaP SOLUTION**C. Sneetches and Speeches 3 SOLUTION**D. The Grim Treaper SOLUTION**Y. Sneetches and Speeches 1 SOLUTION**Z. Trick or Treap SOLUTION**A. Floor Number SOLUTION CODE FORCES**B. Symmetric Matrix SOLUTION CODE FORCES**C. Increase and Copy SOLUTION CODE FORCES**D. Non-zero Segments SOLUTION CODE FORCES**E. Rock, Paper, Scissors SOLUTION CODE FORCES**F. Number of Subsequences SOLUTION CODE FORCES*

*Related :*

*Chef and Easy Queries SOLUTIONS CHEFEZQ**Covid Run SOLUTIONS CVDRUN OCTOBER CHALLENGE**Positive AND SOLUTIONS POSAND**Replace for X SOLUTIONS REPLESX**Village Road Network SOLUTIONS VILLNET**Random Knapsack SOLUTIONS RANDKNAP**D-Dimensional MST SOLUTIONS DDIMMST**Compress all Subsegments SOLUTIONS SEGCOMPR**Adding Squares SOLUTIONS ADDSQURE**Inversions SOLUTIONS INVSMOD2 OCOTBER CHALLENGE**Rooted Minimum Spanning Tree SOLUTIONS ROOTMST*