TEST - Life, the Universe, and Everything


Your program is to use the brute-force approach in order to find the Answer to Life, the Universe, and Everything. More precisely... rewrite small numbers from input to output. Stop processing input after reading in the number 42. All numbers at input are integers of one or two digits.

Example

Input:
1
2
88
42
99

Output:
1
2
88

Information

In case of any problems with your code, you can take a look in the forum, you'll find the answer, only for this problem, in various languages.


hide comments
chungnv: 2020-02-20 08:40:50

Last edit: 2020-02-21 04:29:45
nguyen ngoc son: 2020-01-16 11:32:04

[Output]
- The total number of pipes that fuel can flow to
Case #1
5
Case #2
15
Case #3
29

nguyen ngoc son: 2020-01-16 11:31:34

- The number of test case T (T <= 50)
- In each TC, the first row will give :
+ The size of the map N x M (5 <= N, M <= 50)
+ The location of fuel tank (start position) (0-based index)
+ The limit of the pump P (1 <= P <= 20)
- Detail of the map will be given at next N rows, the value C of each cell represent the pipes (total 7 kind of pipes, 0 <= C <= 7), value 0 mean there is no pipe at that location.
5 => Total 5 test cases
5 6 2 1 3 => The size of the map is 5 x 6, starting point is (2,1), the limit of pump is 3
0 0 5 3 6 0 => The first row of the map
0 0 2 0 2 0 => The second row of the map
3 3 1 3 7 0
0 0 0 0 0 0
0 0 0 0 0 0
5 6 2 2 6
3 0 0 0 0 3
2 0 0 0 0 6
1 3 1 1 3 1
2 0 2 0 0 2
0 0 4 3 1 1
10 10 4 3 9
0 0 0 0 0 0 0 0 0 0
0 0 0 7 5 0 5 0 0 0
0 0 3 2 2 6 0 0 0 0
0 4 7 2 2 2 7 0 0 4
0 3 0 1 1 2 2 0 0 5
0 5 6 1 1 1 1 6 2 5
7 4 1 2 0 0 4 6 0 0
5 3 1 7 0 2 2 6 5 7
7 3 2 1 1 7 1 0 2 7
3 4 0 0 4 0 5 1 0 1
...

mrstom: 2020-01-15 07:03:42

So, here's the list of the best <a href"https://www.fitthemes.com/category/free-wordpress-themes/">free WordPress themes </a> that you can use for your next project: Shapely (Most Popular) Divi (Premium) Jevelin (Premium) Webify (Premium) Salient (Premium) Illdy (Trending) Tyche. Allegiant.

sachsri: 2020-01-13 10:37:20

Why is 99 there in the example input? Shouldn't the input list have ended at 42?

jason_nelligan: 2020-01-10 13:40:33

I am using JavaScript and getting this error runtime error (NZEC)

whateve_273: 2020-01-01 08:50:28

the example is really confusing. the input and output need to be together

tenshikn: 2019-12-27 20:42:56

I'm using python and my code accepts user inputs and puts it in an array until the user presses the Enter key and outputs the numbers until 42 is reached but I keep getting a runtime error NZEC error even the though my code runs perfectly on my IDE. Please help asap.

godmatter_1996: 2019-12-22 11:36:53

how do we take the input? do we make it user input or give a sample input?

kingfran1907: 2019-12-18 21:26:44

[deleted]

Last edit: 2019-12-18 21:29:01

Added by:mima
Date:2004-05-01
Time limit:10s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All
Resource:Douglas Adams, The Hitchhiker's Guide to the Galaxy

Problem's scores 2 votes

Concept difficulty
Concept difficulty 6%
Implementation difficulty
Implementation difficulty 7%
349 69