o do google foi mais divertido :)<div><br></div><div><br></div><div>2012/1/29 Daniel Mantovani <<a href="mailto:daniel.oliveira.mantovani@gmail.com">daniel.oliveira.mantovani@gmail.com</a>></div><div>Agora que a fase um ja terminou, podemos brincar com os problemas.</div>

<div><br></div><div>O Wesley Seidel, me chamou hoje no Google Talk e comentou sobre os problemas. Ele me mandou os problemas e me pareceram bem legais, eu parei para mexer em apenas um deles hoje:</div><div><br></div><div>

Alphabet Soup</div><div><br></div><div><br></div><div>Alfredo Spaghetti really likes soup, especially when it contains alphabet pasta. Every day he constructs a sentence from letters, places the letters into a bowl of broth and enjoys delicious alphabet soup.</div>

<div><br></div><br><div class="gmail_quote">2012/1/29 Daniel Mantovani <span dir="ltr"><<a href="mailto:daniel.oliveira.mantovani@gmail.com">daniel.oliveira.mantovani@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word">Agora que a fase um ja terminou, podemos brincar com os problemas.<div><br></div><div>O Wesley Seidel, me chamou hoje no Google Talk e comentou sobre os problemas. Ele me mandou os problemas e me pareceram bem legais, eu parei para mexer em apenas um deles hoje:</div>

<div><br></div><div><span style="color:rgb(51,51,51);font-family:'lucida grande',tahoma,verdana,arial,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:bold;letter-spacing:normal;line-height:20px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none">Alphabet Soup</span></div>

<div><br></div><div><br></div><div><div style="margin-top:10px;margin-bottom:10px;font-size:11px;line-height:16px;color:rgb(51,51,51);font-family:'lucida grande',tahoma,verdana,arial,sans-serif;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)">

<p style="margin-top:1em;margin-right:0px;margin-bottom:1em;margin-left:0px">Alfredo Spaghetti really likes soup, especially when it contains alphabet pasta. Every day he constructs a sentence from letters, places the letters into a bowl of broth and enjoys delicious alphabet soup.</p>

<p style="margin-top:1em;margin-right:0px;margin-bottom:1em;margin-left:0px">Today, after constructing the sentence, Alfredo remembered that the Facebook Hacker Cup starts today! Thus, he decided to construct the phrase "HACKERCUP". As he already added the letters to the broth, he is stuck with the letters he originally selected. Help Alfredo determine how many times he can place the word "HACKERCUP" side-by-side using the letters in his soup.</p>

<h3 style="font-size:13px;color:rgb(51,51,51);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px">Input</h3><p style="margin-top:1em;margin-right:0px;margin-bottom:1em;margin-left:0px">

The first line of the input file contains a single integer T: the number of test cases. T lines follow, each representing a single test case with a sequence of upper-case letters and spaces: the original sentence Alfredo constructed.</p>

<h3 style="font-size:13px;color:rgb(51,51,51);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px">Output</h3><p style="margin-top:1em;margin-right:0px;margin-bottom:1em;margin-left:0px">

Output T lines, one for each test case. For each case, output "Case #t: n", where t is the test case number (starting from 1) and n is the number of times the word "HACKERCUP" can be placed side-by-side using the letters from the sentence.</p>

<h3 style="font-size:13px;color:rgb(51,51,51);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px">Constraints</h3><ul style="list-style-type:none;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px">

<li>1 < T ≤ 20</li><li>Sentences contain only the upper-case letters A-Z and the space character</li><li>Each sentence contains at least one letter, and contains at most 1000 characters, including spaces</li></ul><div>

<br></div></div><div style="color:rgb(51,51,51);font-family:'lucida grande',tahoma,verdana,arial,sans-serif;font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:14px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)">

<div style="zoom:1;margin-left:20px;margin-right:20px"></div></div></div><div>Eu anexei o input "alphabet_soup.txt" ,a saida "certo.txt" e o meu script "<a href="http://script.pl" target="_blank">script.pl</a>".</div>

<div><br></div><div><br></div><div></div></div><br><div style="word-wrap:break-word"><div></div><div></div></div><br><div style="word-wrap:break-word"><div></div><div></div></div><br><div style="word-wrap:break-word"><div>

</div><div><br></div><div><br><div>
<div style="word-wrap:break-word"><div style="word-wrap:break-word">-- <br>Software Engineer<br>Just Another Perl Hacker<br>Daniel Mantovani <a href="tel:%2B5511%208538-9897" value="+551185389897" target="_blank">+5511 8538-9897</a><br>

XOXO</div></div>
</div>
<br></div></div><br>=begin disclaimer<br>
   Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/" target="_blank">http://sao-paulo.pm.org/</a><br>
 SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org">SaoPaulo-pm@pm.org</a><br>
 L<<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>><br>
=end disclaimer<br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><font size="1" color="#333333">Saravá,</font></div><div><font size="1" color="#333333">Renato CRON Santos</font></div><div><div style="text-align:right">

<font size="1" color="#333333"><a href="http://www.renatocron.com/blog/" target="_blank">http://www.renatocron.com/blog/</a></font></div></div><div style="text-align:right"><font size="1" color="#333333"><a href="http://twitter.com/#!/renato_cron" target="_blank">@renato_cron</a><br>

</font></div><div style="text-align:right"><br></div><br>