Forgot Password ?
New password will be sent to following email id
Chotu and Goblet of fire
Problem Code : HP4
2 3 4
Time Limit :
C , C++ , Java , Python 2
Login to submit your response.
"<i>Welcome today, champions. Now you've waited, you've wondered, and finally, the moment has arrived. A moment only four of you can fully appreciate." - Albus Dumbledore </i> <br> <img src = "https://s23.postimg.org/xh9pzyrzf/e1243b2.png"><br><br> Albus Dumbledore announces that Hogwarts will host the Triwizard Tournament where three magical schools will test their might, in three daunting challenges. The champions taking part, as selected by the Goblet of Fire are, Cedric Diggory of Hufflepuff representing Hogwarts, Viktor Krum representing Durmstrang Institute, and Fleur Delacour for the Beauxbatons Academy of Magic.<br><br> The Goblet unexpectedly chose a fourth champion: <b>Chotu</b>. <br><br> As the tournament's first task, the champions must each retrieve a golden egg guarded by a dragon. After the successfull retrieval of golden eggs by the three contestants, now it's Chotu's turn. As he is quite nervous, his friend Hermione told him that if he casts a spell of size <b>N</b>, he can beat the dragon. <br> In the world of wizards, a spell comprises of three magical letters <b>'I', 'L', 'U'</b>. A spell is of the form <b><font size = 3>I<sup>p</sup> L<sup>q</sup> U<sup>r</sup></font></b>. A spell of size <b>N</b> is valid if <b>p + q + r = N</b> and <b>p, q, r > 0.</b> <br><br> Now Chotu is wondering how many different spells can he cast to defeat the dragon. <b>A spell is different from another spell, if atleast one of p, q, r is different. </b>
First line contains an integer <b>T</b> denoting number of test cases.<br> Next <b>T</b> lines contains an integer <b>N</b>.
For each test case output the number of spells.
1 <= <b>T</b> <= 100.<br> 3 <= <b>N</b> <= 10<sup>5</sup>
For first test case there is only 1 way- <b>ILU</b> <br> For second test case there are 3 ways- <b>IILU ILLU ILUU</b>