HDU 1016 Prime Ring Problem 素数环
来源:互联网 发布:淘宝卖家软件检测违规 编辑:程序博客网 时间:2024/05/22 00:32
Problem Description
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.
Note: the number of first circle should always be 1.
Note: the number of first circle should always be 1.
Input
n (0 < n < 20).
Output
The output format is shown as sample below. Each row represents a series of circle numbers in the ring beginning from 1 clockwisely and anticlockwisely. The order of numbers must satisfy the above requirements. Print solutions in lexicographical order.
You are to write a program that completes above process.
Print a blank line after each case.
You are to write a program that completes above process.
Print a blank line after each case.
Sample Input
68
Sample Output
Case 1:1 4 3 2 5 61 6 5 2 3 4Case 2:1 2 3 8 5 6 7 41 2 5 8 3 4 7 61 4 7 6 5 8 3 21 6 7 4 3 8 5 2
- HDU 1016 Prime Ring Problem 素数环
- hdu 1016 Prime Ring Problem (素数环)
- hdu 1016 Prime Ring Problem 素数环
- hdu 1016 Prime Ring problem(dfs 素数环)
- Hdu 1016 Prime Ring Problem (素数环经典dfs)
- HDU 1016 Prime Ring Problem(素数环)
- hdu-1016 Prime Ring Problem(素数环 dfs)
- hdu 1016 Prime Ring Problem(素数环,超时)
- HDU 1016 Prime Ring Problem(DFS 素数环问题)
- hdu 1016 Prime Ring Problem(素数环)
- hdu-1016Prime Ring Problem(素数环 dfs)
- hdu-1016 Prime Ring Problem(素数环) DFS解法
- HDU 1016 Prime Ring Problem 素数环 搜索
- HDU 1016 Prime Ring Problem(素数环)
- hdu 1016 Prime Ring Problem(dfs,素数环)
- hdu 1016 Prime Ring Problem(素数环)
- HDU (dfs)1016 Prime Ring Problem素数环
- hdu 1016Prime Ring Problem dfs经典题 素数环
- 使用Qtopia的PDA皮肤!
- 顾此失彼啊!望来年翻身农奴把歌唱啊
- MySQL命令
- oscache应用简介
- 一页纸项目管理方法(OOPM)背后的思想
- HDU 1016 Prime Ring Problem 素数环
- VirtualPrinter 问题相关
- 实时系统的资料接收与处理(2)
- 洞房花猪的博客
- Google 应用
- 几年的工作心得
- 如何提高博客访问量
- php大型网站架构解决方案
- 利用SQLSERVER的事件探测器掌握用友系统的表结构