Triway Cup '19 Summer Junior P3 - Thor Goes for the Papaya

View as PDF

Submit solution

Points: 5
Time limit: 1.25s
Memory limit: 256M

Authors:
Problem type

DISCLAIMER: This problem statement contains NO spoilers to the film Avengers: Endgame and is in no way, shape, or form affiliated to Marvel Entertainment. Uses of characters, settings, and scenes are parodical only.


After missing Thanos' head, Thor has been trying to find Thanos. Wallowing in his sadness, Thor has found distinctive purple papayas on each planet (Thanos seems to have a knack for agriculture).

He decides to consult Iron Man, and together, they convince residents of N planets to conduct a thorough census of the number of Purple Papayas on these N planets.

Once he had received the numbers, Iron Man has discovered something interesting about the results.

You, as the head programmer of the Avengers, are tasked with decoding the information to find out where Thanos is.

The process is as follows, in Iron Man's words: "To crack the code, you must multiply the number of Purple Papayas on each planet with the one following it. Then, you must find the remainder of when you divide the number by 26 and match it to a letter. For example, 0 is A, 1 is B… 25 is Z."

It is your task to find out where Thanos is so that Thor can defeat him!

Input Specification

Line 1: 1 integer N

Next N lines: A sequence of integers in the sequence D, representing the number of Purple Papayas per planet.

Constraints

2 \le N \le 10^3

1 \le D_i \le 500

Output Specification

A string starting with Thanos is on Planet:  and then the planet Thanos is on.

Sample Input

5
55
23
498
12
45

Sample Output

Thanos is on Planet: ROWU

Explanation

N is 5, meaning that there are 5 survey results.
The first 2 numbers, 55 and 23, are multiplied together to give 1\,265. The remainder of dividing 1\,265 by 26 is 17. 17 corresponds to R.
The same is done with the next two numbers, 23 and 498. 23 \times 498 = 11\,454. The remainder of dividing 11\,454 by 26 is 14 and 14 corresponds to O.
The next two numbers are 498 and 12. 498 \times 12 = 5\,976. The remainder of dividing 5\,976 by 26 is 22 and 22 corresponds to W.
The next two numbers are 12 and 45. 12 \times 45 = 540. The remainder of diving 540 by 26 is 20 and 20 corresponds to U.


Comments

There are no comments at the moment.