signedmain() { int T = read(); for (int t = 1; t <= T; ++ t) { memset(s, 0, sizeof s); yh.clear(); int i, x, ret(0), n = read(); int minv = inf, maxv = -inf; for (i = 1; i <= n; ++ i) { x = read(); x = 10000 - (100 - x) * (100 - x); minv = min(minv, x), maxv = max(maxv, x); if (! s[x]) ++ ret; ++ s[x]; } int cnt = 0, pdbad = 0; for (i = minv; i <= maxv; ++ i) if (s[i] > cnt) cnt = s[i];
for (i = minv; i <= maxv; ++ i) if (s[i] == cnt) ++ pdbad; printf ("Case #%lld:\n", t); if (ret == 1) { for (i = minv; i <= maxv; ++ i) { if (s[i]) { cout << i << '\n'; break; } } continue; } if (pdbad == ret) {puts("Bad Mushroom"); continue;} for (i = minv; i <= maxv; ++ i) if (s[i] == cnt) yh.push_back(i); for (i = 0; i < (int)yh.size() - 1; ++ i) cout << yh[i] << ' '; cout << yh[(int)yh.size() - 1] << '\n'; } return0; }