Life, the Universe, and Everything

Code Chef Problem Link: Life, the Universe, and Everythin
Solved By: Niloy
Runtime: 0.00 sec
Algo Used: Adhoc

Problem Hints:
Here, in the problem statement, brute force algo is mentioned. But here you don't need to use brute force. Just take the inputs until the program gets '42'. One tricks the problem setters add here is quite interesting! After getting '42', you also need to take the next inputs, but you must need to print the numbers taken before '42' appears.

Sample Input:
45
65
65
65
98
26
98
26
78
65
18
46
34
26
79
42
32
95
64
97

Sample Output:
45
65
65
65
98
26
98
26
78
65
18
46
34
26
79

Sample Input:
45
42
65
65
65
98
26
98
26
78
65
18
46
34
26
79
32
95
64
97

Sample Output:
45


Solution of The Problem:

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS