Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int t, n;
- cin >> t;
- assert(1 <= t && t <= 10);
- while(t--) {
- cin >> n;
- assert(1 <= n && n <= 1000);
- vector<int> a(n), b(n);
- for(int i = 0; i < n; ++i) {
- for(int j = 0; j < n; ++j) {
- cin >> a[j];
- assert(1 <= a[j] && a[j] <= 100000);
- }
- sort(a.begin(), a.end());
- b[i] = a[n/2];
- }
- sort(b.begin(), b.end());
- cout << b[n/2] << "\n";
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment