Find the median
Problem Description
Given the marks of all students, calculate the median
Input:
The first line of input takes the number of test cases, T. Then T test cases follow. Each of the T test cases takes 2 input lines.The first line of each test case takes the number of students, N.The second line of each test case takes N space separated integers denoting the marks of all the students
Output:
Print the floor value of the median for each test case on a new line
Logic Test Case 1
Input (stdin)
2
4
56 67 30 79
4
78 89 67 76
Expected Output
61
77
Logic Test Case 2
Input (stdin)
2
3
34 44 67
5
87 44 32 69 74
Expected Output
44
69
CODE AREA
0 Comments