当前位置: 首页 > news >正文

URAL 1614. National Project “Trams” (图论大YY)

1614. National Project “Trams”

Time limit: 0.5 second
Memory limit: 64 MB
President has declared the development of tram service a priority national project. As a part of this project, Yekaterinburg will receive enough budget funds to carry out a complete reconstruction of the city's tram network.
There are 2 n tram stops in Yekaterinburg. In the course of reconstruction, the stops will be left in their places and no new stops will be built, but new tram railways will be laid so that it will be possible to go by tram from every tram stop to any other tram stop without any intermediate stops.
Having studied messages at the tram forum, the city authorities found out that citizens would be satisfied with the reconstruction only if for every pair of tram stops there would be a tram route connecting these stops without any intermediate stops. It is clear that the network of  n(2 n − 1) routes consisting of only two stops each satisfies this requirement. However, Yekaterinburg Mayor wants exactly  n routes to be left after the reconstruction, and each tram must make exactly 2 n stops (including the final ones) on its route. Trams must go along these routes in both directions. Suggest a plan of reconstruction that will satisfy both citizens and Mayor.

Input

The only input line contains the integer  n, 1 ≤  n ≤ 100.

Output

Output  n lines describing tram routes. Each route is a sequence of integers in the range from 1 to 2 n separated by a space. A route may go through a stop several times. If the problem has several solutions, you may output any of them. If there is no solution, output one line containing the number −1.

Sample

input output
3
1 6 2 1 3 4
2 3 6 5 4 6
5 1 4 2 5 3
Problem Author: Alexander Ipatov (idea — Magaz Asanov)
Problem Source: The 12th Urals Collegiate Programing Championship, March 29, 2008
Tags:  tricky problem   ( hide tags for unsolved problems )

相关文章:

  • glibc中malloc的详细解释_转
  • [笔记] php常见简单功能及函数
  • SQLServer 理解copyonly备份操作
  • pycharm2016序列号失效问题解决办法
  • ASP.NET Core DI 手动获取注入对象
  • 深入浅出 spring-data-elasticsearch - 基本案例详解(三)
  • 远程桌面无法复制粘贴的解决方法
  • 《vSphere性能设计:性能密集场景下CPU、内存、存储及网络的最佳设计实践》一1.2.1 CPU基础设施基准...
  • “智能云”战略新品震撼发布,开发者如何快速上手?
  • 对于startActivity的使用改进
  • [设计模式][c++]状态切换模式
  • POJ2117-Electricity
  • HTML/CSS 知识点
  • java并发编程之:线程共享数据的方式
  • 《2017年全球数据库安全市场趋势》
  • Angular Elements 及其运作原理
  • echarts的各种常用效果展示
  • Linux快速复制或删除大量小文件
  • MySQL的数据类型
  • MySQL用户中的%到底包不包括localhost?
  • PHP 小技巧
  • windows下使用nginx调试简介
  • Yeoman_Bower_Grunt
  • 包装类对象
  • 浮动相关
  • 构建二叉树进行数值数组的去重及优化
  • 聊聊flink的BlobWriter
  • 如何正确配置 Ubuntu 14.04 服务器?
  • 三分钟教你同步 Visual Studio Code 设置
  • 提醒我喝水chrome插件开发指南
  • 跳前端坑前,先看看这个!!
  • 问:在指定的JSON数据中(最外层是数组)根据指定条件拿到匹配到的结果
  • #pragma once与条件编译
  • $refs 、$nextTic、动态组件、name的使用
  • ( 用例图)定义了系统的功能需求,它是从系统的外部看系统功能,并不描述系统内部对功能的具体实现
  • (TipsTricks)用客户端模板精简JavaScript代码
  • (附源码)ssm跨平台教学系统 毕业设计 280843
  • (附源码)计算机毕业设计SSM智能化管理的仓库管理
  • (力扣记录)1448. 统计二叉树中好节点的数目
  • (七)c52学习之旅-中断
  • (三) prometheus + grafana + alertmanager 配置Redis监控
  • (三)c52学习之旅-点亮LED灯
  • (三分钟了解debug)SLAM研究方向-Debug总结
  • (算法)Travel Information Center
  • (学习日记)2024.02.29:UCOSIII第二节
  • **PHP分步表单提交思路(分页表单提交)
  • .“空心村”成因分析及解决对策122344
  • .net 7 上传文件踩坑
  • .NET Core 控制台程序读 appsettings.json 、注依赖、配日志、设 IOptions
  • .NET/ASP.NETMVC 大型站点架构设计—迁移Model元数据设置项(自定义元数据提供程序)...
  • .NET关于 跳过SSL中遇到的问题
  • /使用匿名内部类来复写Handler当中的handlerMessage()方法
  • @Autowired和@Resource的区别
  • @RequestMapping用法详解
  • [ 渗透工具篇 ] 一篇文章让你掌握神奇的shuize -- 信息收集自动化工具