5404: Delete Edges

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:0 解决:0

题目描述

A complete graph is a graph in which each pair of vertices is joined by an undirected edge and there's no self-loop or multiple edges. Given a complete graph with n vertices numbered from 1 to n . You can delete the edges in the graph several times. Each time you need to choose 3 vertices x,y,z under the condition that the edges (x,y),(y,z),(z,x) are not deleted, then delete these 3 edges.

You need to find a solution to make the number of the rest edges less than n.

 

输入

An integer n(3≤n≤2000) --- the number of vertices in the complete graph.

输出

The first line contains an integer m --- the number of times you delete edges.

In the next m lines, each line contains three integers x,y,z--- the vertices you choose each time.

If there are multiple solutions, print any of them. Note that you just need to make the number of the rest edges less than n. You don't need to minimize the number.

样例输入 复制

3

样例输出 复制

1
1 2 3