2432 - I2P(I)2021_Hu_lab5-B Scoreboard

Time

2021/11/22 18:30:00 2021/11/22 20:30:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
13312 Grab the Banana, Kris!
13349 Karpet Agak Ribet

13312 - Grab the Banana, Kris!   

Description

While venturing in a Cyber's World, Kris came across a box containing a bunch of magic letters. The letters can change to any character in the keyboard and if they are used to form a word, the letters will turn into that object. As Kris was inspecting the box, his 'acquintance', Queen, told him to 'Grab the Banana'. Without a banana in sight, Kris decided to make a banana using the words in the box.

 

 

Kris can use the words to create a single string which must be spelled as 'BANANA' or else the magic letters won't work. To do this, Kris will input a character one by one into the string. However because the words are very hard to control and that Kris has eaten too much moss, Kris is bound to make many spelling errors. Luckily, he can transform the letter to the '/' sign to delete his mistake So if he accidentally spelled ' BANANP', he can use a '/' to change it back to 'BANAN', and continue from there.

While Kris is doing the work, Queen will keep count of the number of letters Kris got right so far, so if the string so far is 'BANA', Queen will output '4'. If the string Kris created is wrong (e.g. 'BANANP'), Queen will output '-1'.

If he manages to create the string 'BANANA', Queen will output 'Potassium!', and every other character in the input will be ignored. (e.g. 'BANANANANANA' will still output 'Potassium!' since the word 'BANANA' is made) 

On the other hand, if he accidentally puts a number 0 into the string, no more letters can be added. The letters in the box can also run out. In this case, Queen will output 'No Potassium.' in disappointment.

Help Kris make a banana with the magic letters.

hint: It is better to use counters to keep track of the letters and examine whether the string so far is correct.

Input

A string of characters (special characters included and all alphabetical letters will be uppercase) Scan until EOF

Output

If the banana is successfully made, print:

'Potassium!'

else print:

'No potassium.'

with a newline character trailing both.

Sample Input  Download

Sample Output  Download

Tags

1



Discuss




13349 - Karpet Agak Ribet   

Description

Agak Ribet means a little bit complicated in Indonesian.  This problem can be solved with recursion, similar to Sierpinski. 

     

RH, a green sock, loves programming and overcomplicating things. 

After finishing Sierpinski's Carpet, he think that it was way too simple, So he designed a cooler looking carpet and named it Karpet Agak Ribet.  

The square in the center should be of length 8 units.

The construction is decribed as follow.

For a Carpet that has depth 1, consists of 1x1 square colored black.

For depth 2, it has side length 4, its 4 corners are made up of depth 1 Carpet with a 2x2 center square.

For depth 3, it has side length 10, its 4 corners are made up of depth 2 Carpet with a 4x4 center square.

For carpet with depth of n, its 4 corners are made up of depth (n-1) carpet, without the opposite diagonal of each corner and a 2n-1 center square.

For a clear picture, the following figures are the carpet with Depth 1, 2, and 3.

                                            

The following figure is the carpet with depth 5.

The square in the center should be of length 16 units.

Input

Input contains only one line with single integer n (1 <= n < 12).

Output

Output the carpet with depth n and use ' ' (space) to represent white, '*' to represent black.
Remember to add a newline character at the end of line.

Sample Input  Download

Sample Output  Download

Tags




Discuss