Beispiel #1
0
        static void Main()
        {
            var ss = new StreamScanner(new StreamReader(Console.OpenStandardInput()));
            var sw = new StreamWriter(Console.OpenStandardOutput())
            {
                AutoFlush = false
            };

            new Program().Solve(ss, sw);
            sw.Flush();
        }
Beispiel #2
0
        void Solve(StreamScanner ss, StreamWriter sw)
        {
            //---------------------------------
            var N        = ss.Next(int.Parse);
            var X        = ss.Next(int.Parse, N);
            var seq      = X.OrderBy(x => x).ToArray();
            var midLeft  = seq[seq.Length / 2 - 1];
            var midRight = seq[seq.Length / 2];

            foreach (var x in X)
            {
                sw.WriteLine(x >= midRight ? midLeft : midRight);
            }
            //---------------------------------
        }