Woburn Challenge 2015-16 Round 2 - Junior Division
You might be aware that the events of the Star Wars saga took place a
long time ago, in a galaxy that was rather far away. But just how far
away was it? We can try to describe it by repeating the word far
a
certain number of times in the following sentence format:
In the above example, the word far
is repeated twice. However, we'd
instead like to repeat it exactly
times without
changing the rest of the sentence at all. There should be a comma right
after each occurrence except for the last one.
Given , can you produce the correct sentence?
Input Specification
The input consists of a single integer .
Output Specification
Output on a single line the appropriate sentence with far
repeated
times. It must match the correct answer exactly!
Sample Input 1
1
Sample Output 1
A long time ago in a galaxy far away...
Sample Input 2
4
Sample Output 2
A long time ago in a galaxy far, far, far, far away...
Comments
Good problem, took me a while to solve this.
I can see that my output is printing out correctly but it keeps saying “Your output is clipped”. Hmm what could I do to fix?
Cause the output's too long. You can't fix it, that's on purpose.
Is the above expecting 3 inputs, sentence, word to be repeated and count ?
The input consists of a single integer
N
.Only one input, number of times you should repeat the word
"far"
.The base sentence is "A long time ago in a galaxy [something] away..."
Very nice challenge! I was stuck on it at first but noticed the pattern :) . Very good problem. Thank you SourSpinach.
Trying to figure out what I'm doing wrong. I'm confident I'm solving the problem efficiently:
What did I do wrong? Thanks in advance.
Thanks. Missed the '...'!