编程介的小学生 2017-10-12 09:49 采纳率: 20.3%
浏览 1450
已采纳

Puncher

Description

Puncher is a device with several needles for making holes in tickets. At the factory there is a rectangular form with M rows and N columns, as shown in the picture (M=3, N=4), to make different punchers with 1, 2, ... , M*N needles. The rows and columns of needles are perpendicular to each other. The distance between rows is equal to the distance between columns. Obviously, it is possible to make 2M*N-1 different punchers in this way.

However, sometimes it is not possible to distinguish tickets that are perforated by different punchers. Let us assume that while punching two opposite borders of the ticket are parallel to the rows of the needles, the other pair of opposite borders being parallel to the columns of the needles. The number of the holes in a perforated ticket is always equal to the number of the needles in the corresponding puncher. A composition of the following transformations is allowed:
a ticket may be perforated on any side (axial symmetry),
it may be inserted into the puncher with any of its four borders downwards (rotation by 90, 180 and 270 degrees),
parallel translations are also available.

Your task is to write a program to determine how many actually different punchers can be made with an M*N form. Two punchers are considered actually different, if it is impossible to match using any combination of the above described operations the holes in the two tickets perforated by these punchers.
Input

The input file consists of two positive integer numbers M (not greater than 4) and N (not greater than 8) separated by a single space.
Output

The output file consists of a single integer indicating the number of the actually different punchers.
Sample Input

3 3
Sample Output

85

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-10-30 13:54
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 ogg dd trandata 报错
  • ¥15 高缺失率数据如何选择填充方式
  • ¥50 potsgresql15备份问题
  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错