CF149C Division into Teams
Description
Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).
The key in football is to divide into teams fairly before the game begins. There are $ n $ boys playing football in the yard (including Petya), each boy's football playing skill is expressed with a non-negative characteristic $ a_{i} $ (the larger it is, the better the boy plays).
Let's denote the number of players in the first team as $ x $ , the number of players in the second team as $ y $ , the individual numbers of boys who play for the first team as $ p_{i} $ and the individual numbers of boys who play for the second team as $ q_{i} $ . Division $ n $ boys into two teams is considered fair if three conditions are fulfilled:
- Each boy plays for exactly one team ( $ x+y=n $ ).
- The sizes of teams differ in no more than one ( $ |x-y|
Input Format
The first line contains the only integer $ n $ ( $ 2
Output Format
On the first line print an integer $ x $ — the number of boys playing for the first team. On the second line print $ x $ integers — the individual numbers of boys playing for the first team. On the third line print an integer $ y $ — the number of boys playing for the second team, on the fourth line print $ y $ integers — the individual numbers of boys playing for the second team. Don't forget that you should fulfil all three conditions: $ x+y=n $ , $ |x-y|
Explanation/Hint
Let's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups ( $ |2-1|=1