Пример #1
0
            public void Solve()
            {
                int N = NextInt(), x = NextInt();

                if (x == 1 || x == 2 * N - 1)
                {
                    "No".WL();
                    return;
                }

                if (N == 2)
                {
                    "Yes".WL();
                    new int[] { 1, 2, 3 }.WL();
                    return;
                }

                var range   = Enumerable.Range(1, 2 * N - 1).ToList();
                var section = x == 2 ? new Li {
                    x + 1, x, x - 1, x + 2
                } : new Li {
                    x - 1, x, x + 1, x - 2
                };

                section.ForEach(k => range.Remove(k));

                var ans = new Li();

                var queue = range.ToQueue();

                (N - 2).REP(i => ans.Add(queue.Dequeue()));
                ans.AddRange(section);
                ans.AddRange(queue);
                "Yes".WL();
                ans.WL();
            }