301253: CF234G. Practice

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Practice

题意翻译

本题需要文件读入读出。 输入文件:`input.txt`。 输出文件:`output.txt`。 ### 题目描述 现在有 $n$ 个人进行比赛(编号从 $1$ 到 $n$),每次把这 $n$ 个人不遗漏地分成两队进行比赛。 请构造一种比赛方式,使得比赛次数尽可能少,并且每两个人之间都在不同队比赛过。 ### 输入格式 一行一个整数 $n(2 \leq n \leq 1000)$。 ### 输出格式 第一行一个整数 $m$,表示最少比赛次数。 接下来 $m$ 行,第 $i$ 行输出若干个整数,其中先输出一个整数 $f_i(1 \leq f_i \leq n)$,表示其中一队的人数;再输出 $f_i$ 个整数,表示该队中每个人的编号。 输出一种可行的方案即可。

题目描述

Little time is left before Berland annual football championship. Therefore the coach of team "Losewille Rangers" decided to resume the practice, that were indefinitely interrupted for uncertain reasons. Overall there are $ n $ players in "Losewille Rangers". Each player on the team has a number — a unique integer from 1 to $ n $ . To prepare for the championship, the coach Mr. Floppe decided to spend some number of practices. Mr. Floppe spent some long nights of his holiday planning how to conduct the practices. He came to a very complex practice system. Each practice consists of one game, all $ n $ players of the team take part in the game. The players are sorted into two teams in some way. In this case, the teams may have different numbers of players, but each team must have at least one player. The coach wants to be sure that after the series of the practice sessions each pair of players had at least one practice, when they played in different teams. As the players' energy is limited, the coach wants to achieve the goal in the least number of practices. Help him to schedule the practices.

输入输出格式

输入格式


A single input line contains integer $ n $ ( $ 2<=n<=1000 $ ).

输出格式


In the first line print $ m $ — the minimum number of practices the coach will have to schedule. Then print the descriptions of the practices in $ m $ lines. In the $ i $ -th of those lines print $ f_{i} $ — the number of players in the first team during the $ i $ -th practice ( $ 1<=f_{i}&lt;n $ ), and $ f_{i} $ numbers from $ 1 $ to $ n $ — the numbers of players in the first team. The rest of the players will play in the second team during this practice. Separate numbers on a line with spaces. Print the numbers of the players in any order. If there are multiple optimal solutions, print any of them.

输入输出样例

输入样例 #1

2

输出样例 #1

1
1 1

输入样例 #2

3

输出样例 #2

2
2 1 2
1 1

Input

题意翻译

本题需要文件读入读出。 输入文件:`input.txt`。 输出文件:`output.txt`。 ### 题目描述 现在有 $n$ 个人进行比赛(编号从 $1$ 到 $n$),每次把这 $n$ 个人不遗漏地分成两队进行比赛。 请构造一种比赛方式,使得比赛次数尽可能少,并且每两个人之间都在不同队比赛过。 ### 输入格式 一行一个整数 $n(2 \leq n \leq 1000)$。 ### 输出格式 第一行一个整数 $m$,表示最少比赛次数。 接下来 $m$ 行,第 $i$ 行输出若干个整数,其中先输出一个整数 $f_i(1 \leq f_i \leq n)$,表示其中一队的人数;再输出 $f_i$ 个整数,表示该队中每个人的编号。 输出一种可行的方案即可。

加入题单

算法标签: