HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Linear Data Structures: Arrays > problem:


51092 - Even and Odd

Guest
• Review clarifications (1)

Section problems

• 51116 - The Star Triangle
• 51042 - The most frequent k-mer
• 50271 - Factorial
• 50382 - Parkside's Other Triangle
• 51171 Question 3
• 51093 - rgb2gray
• 51165 Question 1
• 51175 Question 2
• 51092 - Even and Odd
• 51095 - Normal and Trace
• 50423 - Numbers square
• 50300 - Matrix
• 50319 - Toll Plazas
• 50977 - Gaussian Elimination
• 50380 - Sum of the Numbers in the ...
• 50318 - Product Info
• 50326 - Matrix Operations

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
bfs.

Even and Odd

Question: Given a 2D matrix, the task is to print even numbers then odd numbers

 

Input specification: In the first line you will be given the dimensions of the matrix (1<=m,n<=500) then in the following lines you have to read the matrix size of  m by n. Where each element of matrixes is: 1<=element<=100.

Output specification: Show even numbers in the first line then odd numbers in the second line.

Sample Input I 

10 5
42 98 87 63 11
15 73 94 60 51
97 89 12 98 82
93 15 29 58 88
71 87 16 85 77
17 79 31 79 14
32 32 5 12 88
47 94 63 3 23
73 69 17 2 92
82 38 61 16 77

Sample Output I

 42 98 94 60 12 98 82 58 88 16 14 32 32 12 88 94 2 92 82 38 16
87 63 11 15 73 51 97 89 93 15 29 71 87 85 77 17 79 31 79 5 47 63 3 23 73 69 17 61 77

 

 
Для отправки решений необходимо выполнить вход.

www.contester.ru