Problem description

You are given a rectangular board of M × N squares. Also you are given an unlimited number of standard domino pieces of 2 × 1 squares. You are allowed to rotate the pieces. You are asked to place as many dominoes as possible on the board so as to meet the following conditions:

1. Each domino completely covers two squares.

2. No two dominoes overlap.

3. Each domino lies entirely inside the board. It is allowed to touch the edges of the board.

Find the maximum number of dominoes, which can be placed under these restrictions.

Input

In a single line you are given two integers M and N — board sizes in squares (1 ≤ M ≤ N ≤ 16).

Output

Output one number — the maximal number of dominoes, which can be placed.

Examples

Input

2 4

Output

4

Input

3 3

Output

4
解题思路:题目很简单,要求在一个m*n的矩形中用一张2*1的扑克牌按方格尽量铺满,并且不能超过矩形界限但可以贴着矩形边缘,直接取矩形面积的一半即可,水过!
AC代码:
 #include <bits/stdc++.h>
using namespace std;
int main()
{
int m,n;
cin>>m>>n;
cout<<(m*n/)<<endl;
return ;
}

C - Domino piling的更多相关文章

  1. CodeForces - 50A Domino piling (贪心+递归)

    CodeForces - 50A Domino piling (贪心+递归) 题意分析 奇数*偶数=偶数,如果两个都为奇数,最小的奇数-1递归求解,知道两个数都为1,返回0. 代码 #include ...

  2. codeforces水题100道 第三题 Codeforces Beta Round #47 A. Domino piling (math)

    题目链接:http://www.codeforces.com/problemset/problem/50/A题意:一个NxM的举行中最多能放多少个1x2的矩形.C++代码: #include < ...

  3. codeforcess水题100道

    之所以在codeforces上找这100道水题的原因是为了巩固我对最近学的编程语言的掌握程度. 找的方式在codeforces上的PROBLEMSET中过的题最多的那些题里面出现的最前面的10个题型, ...

  4. Codeforces初体验

    Codeforces印象 这两天抽时间去codeforces体验了一把. 首先,果然有众多大牛存在.非常多名人一直參加每周一次的比赛.积分2000+,并參与出题. 另外.上面题目非常多.预计至少一千题 ...

  5. BPM Domino集成解决方案

    一.需求分析 Lotus Notes/Domino是IBM的协同办公平台,在国内有广泛的用户. 但由于推出年头较早.采用文档数据库等特点, 导致其流程集成能力弱.统计分析难.不支持移动办公等问题,很多 ...

  6. 【转载】给那些想多学习,多进步的Domino初学者

    在这个社区里面,包括QQ技术群里面混了很久了.遇到了很多Domino初学者,也认识了很多致力于Domino这个技术领域的朋友,很开心.很久没有写长篇大论给大家了.我要把一些想法写出来,共大家参考.讨论 ...

  7. FineReport中Domino数据库连接方法

    1. 概述 Domino是文档型数据库而非关系型数据库,连接Domino可以使用JDBC方式或者ODBC方式,使用JDBC方式需要安装Lotus Domino Driver for JDBC并且此方法 ...

  8. IBM Domino 9 出现 Server Controller 未在主机上运行或未在端口2050监听 解决方案

    如果在网上搜索的方法,比如防火墙开端口还没有解决的话,那么我的解决方案可能会解决你的问题. 出现的场景: 我先装了Notes,Designer,后装Domino Server, 配置Domino服务器 ...

  9. CF 405B Domino Effect(想法题)

    题目链接: 传送门 Domino Effect time limit per test:1 second     memory limit per test:256 megabytes Descrip ...

随机推荐

  1. redis --------- 使用命令(每天一个)

    Key(键) Del     语法:DEL  Key [key ...]     删除给定的一个或者多个key  不存在的key会被忽略. 返回值: 被删粗key的数量# 删除单个 key redis ...

  2. 基于fpga uart学习笔记

    2018年7月24日 uart 接收 部分测试成功,多谢开源骚客 邓堪文老师 ,想学的同学可以微信公众号搜索开源骚客 好啦!言归正传. 1.先附上老师的时序图,自己有点懒不想画,rx_t.rx_tt. ...

  3. 在vue中通过js动态控制图片按比列缩放

    1.html 通过外层的div来给img对应的class,隐藏的img是得到img图片请求回来时的原始尺寸.外层div是固定大小,因此,图片有两种情况去适应外部div的尺寸.一种是宽度大于高度的情况, ...

  4. H5 应用程序缓存(离线缓存)

    离线缓存这个功能的实现有以下步骤: 1,以nginx做web服务器为例,在mime.types文件中添加一行:text/cache-manifest     manifest,作用是为了让服务器识别该 ...

  5. MySQL多表连接操作

    select * from userinfo ,dapartment where userinfo.part_id = dapartment.id; --左连接: 左边全部显示 select * fr ...

  6. (蓝桥杯)第八届A组C/C++跳蚱蜢

    #include<iostream> #include<memory.h> #include<stack> #include<string> #incl ...

  7. HTML5本地存储——Web SQL Database与indexedDB

    虽然在HTML5 WebStorage介绍了html5本地存储的Local Storage和Session Storage,这两个是以键值对存储的解决方案,存储少量数据结构很有用,但是对于大量结构化数 ...

  8. C#关键字详解第二节

    base:基类 在有些书中base的解释为表示父类,没错,base可以表示父类,但我更想理解成基类,因为更原始更具象,既 然是类,那么他就符合面向对象的设计规则和特点,我们知道面向对象的三个特点是封装 ...

  9. 【codeforces 515A】Drazil and Date

    [题目链接]:http://codeforces.com/contest/515/problem/A [题意] 每次只能走到相邻的四个格子中的一个; 告诉你最后走到了(a,b)走了多少步->s ...

  10. hdu_1272_小希的迷宫_201403091527

    小希的迷宫 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submi ...