ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Алгоритмы и Структуры Данных > задача:


20. Two Sets

Задачи сборника

• 12. D. Love-Hate
• 13. Repetitions
• 14. Increasing Array
• 15. Bit Strings
• 16. Josephus Queries
• 17. Number Spiral
• 18. Apartments
• 19. Ferris Wheel
• 20. Two Sets
• 21. Distinct Numbers
• 22. Creating Strings
• 23. Apple Division
• 24. Coin Piles
• 25. Josephus Queries
• 26. Exponentiation
• 27. Dice Combinations
• 28. Minimizing Coins

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Сложность Альфа


Your task is to divide the numbers 1,2,…,n into two sets of equal sum.

Input

The only input line contains an integer n.

Output

Print "YES", if the division is possible, and "NO" otherwise.

After this, if the division is possible, print an example of how to create the sets. First, print the number of elements in the first set followed by the elements themselves in a separate line, and then, print the second set in a similar way.

Constraints
1≤n≤106

Example 1
Input:
7

Output:
YES
4
1 2 4 7
3
3 5 6

Example 2
Input:
6

Output:
NO

Для отправки решений необходимо выполнить вход.

www.contester.ru