Submit | All submissions | Best solutions | Back to list |
RPL_T1 - Find our next planet! |
Andreina the hobbit, a famous scientist from Rainbowland is trying to make communication with other planets through a very rare object, Andreina receives the signal by her headphones connected to the object, if she hears at least N signals on an interval of K consecutive minutes (each minute the object makes a turn and points out to another direction in the space slightly different from the last one) then she could have find another living planet.
Sometimes the signal can be weak, sometimes the signal can be strong, and sometimes the signal can be static (this will be represented by a negative integer). they will variate every minute, as the object points to another direction slightly different from the last one.
Your task is simple, given the N signals Andreina needs to discover and the maximum interval of K minutes to do it, output if she found or not a planet.
INPUT:
The first line of the test data will start with an integer T representing the T test cases, then, T cases will follow, each of the cases starts with three integers N, K and C denoting the number of signals to find a planet, the maximum minutes that Andreina can use to find the planet and C signals test that were evaluated.
OUTPUT:
You must output the string “Scenario #i: “, where i is the test case you are evaluating, followed by the string “We are not alone” if Andreina finds another planet, otherwise print “Rainbowland is our home”
SAMPLE DATA:
INPUT |
OUTPUT |
3 6 2 6 1 2 3 1 2 3 6 3 6 1 2 3 3 2 1 3 2 6 1 1 1 2 1 1 |
Scenario #1: Rainbowland is our home Scenario #2: We are not alone Scenario #3: We are not alone |
CONSTRAINTS:
1 <= T <= 10
Small input (30%):
1 <= C <= 1000
1 <= K <= C
-1000 <= N <= 1000
-1000 <= Ni <= 1000
Large input (70%):
1 <= C <= 10^6
1 <= K <= C
-10^9 <= N <= 10^9
-10^9 <= Ni <= 10^9
Added by: | david_8k |
Date: | 2012-06-19 |
Time limit: | 0.200s-1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | Own Problem used for the RPL Warm-up session |