http://acm.hdu.edu.cn/showproblem.php?pid=4627

分类讨论一下就可以

代码:

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<set>
using namespace std; typedef long long ll;
typedef pair<double,double>ppd;
const double PI = acos(-1.);
const double eps = (1e-9);
const int N=2005;
const int M=2000000;
const int K=27; int main()
{
//freopen("data.in","r",stdin);
int T;
scanf("%d",&T);
while(T--)
{
ll n;
cin>>n;
if(n==2)
{cout<<"1"<<endl;continue;}
ll a=n/2;
ll b=n-a;
if(a!=b)
{cout<<(a*b)<<endl;continue;}
if((a&1)==0)
{cout<<(a-1)*(a+1)<<endl;continue;}
cout<<(a-2)*(a+2)<<endl;
}
return 0;
}

hdu 4627 The Unsolvable Problem的更多相关文章

  1. hdu 4627 The Unsolvable Problem【hdu2013多校3签到】

    链接: http://acm.hdu.edu.cn/showproblem.php?pid=4627 The Unsolvable Problem Time Limit: 2000/1000 MS ( ...

  2. hdu 4627 The Unsolvable Problem(暴力的搜索)

    Problem Description There are many unsolvable problem in the world.It could be about one or about ze ...

  3. HDU 4627 The Unsolvable Problem(简单题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4627 题目大意:给定一个整数n(2 <= n <= 109),满足a+b=n并且[a,b] ...

  4. HDU 4627 The Unsolvable Problem 2013 Multi-University Training Contest 3

    给你一个数 n ( 2 <= n <= 109 ),现在需要你找到一对数a, b (a + b = n),并且使得LCM(a, b)尽可能的大,然后输出最大的 LCM(a, b). (为什 ...

  5. HDU 4627 The Unsolvable Problem 杭电多校联赛第三场1009 数学题

    题意描述:给出一个n,要求在所有满足n = a+b的a和b里面求a和b的最小公倍数最大的两个数的最小公倍数. 解题报告:比赛的时候看到这个题的第一反应就是寻找这两个数一定是在a和b比较接近的地方找,这 ...

  6. 2013多校联合3 G The Unsolvable Problem(hdu 4627)

    2013-07-30 20:35 388人阅读 评论(0) 收藏 举报 http://acm.hdu.edu.cn/showproblem.php?pid=4627 The Unsolvable Pr ...

  7. HDU 4627(最小公倍数最大问题)

    HDU 4627 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u   Descript ...

  8. The Unsolvable Problem

    The Unsolvable Problem 题目链接:http://acm.hust.edu.cn/vjudge/problem/visitOriginUrl.action?id=45783 题意: ...

  9. HDU 5832 A water problem(某水题)

    p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...

随机推荐

  1. mongoDB 修改器()

    -----------------------------------2016-5-26 15:56:57-- source:[1],MongoDB更新操作符

  2. 展讯DTS路径及编译

    DTS路径:/kernel/arch/arm/boot/dts 如何查找修改当前TP的DTS配置(分辨率)的文件:1.查找make file,找关键字都包含CONFIG_MACH,在/kernel/a ...

  3. SVN标准目录结构

    Trunk 这是SVN目录的主分支,表示日常开发中的项目,任何时候Trunk里包含的都是最新的开发代码. 这里的代码将会工作到你的下一个主要发布版本. Trunk应该只被用来开发将会成为你的下一个重要 ...

  4. ttttttttttt

    http://www.2cto.com/kf/201606/519504.html http://a67474506.iteye.com/blog/2079590 spring boot: http: ...

  5. 转:Teach Yourself Programming in Ten Years——用十年教会自己编程

    转自:http://blog.csdn.net/UndeadWraith/article/details/6140455 作者:Peter Norvig 译者:刘海粟 本文原文为:http://nor ...

  6. hiho_1079_离散化

    题目 在长度为L的宣传栏上张贴N张海报,将宣传栏分为L个长度为1的单位,海报长度为整数,且高度和宣传栏相同,左右边界和宣传栏单位之间缝隙重合(即海报总是跨越整数个单位).后贴的海报可能会覆盖之前贴的海 ...

  7. mongodb数据库js查询

    #健康风险-disease db.disease.find({versions:'2'}).forEach(function(item){ item.diseaseDetail && ...

  8. Linux下软件安装方法即路径设置

    Linux下软件安装方法即路径设置 http://www.cnblogs.com/edward259/archive/2010/07/02/1770066.html

  9. reveal 1.6.3 本机破解及使用

    reveal 强大的iOS UI调试工具 1: 去官网下载最新版本:1.6.3 http://revealapp.com/download/ 2: 安装到mac上,即,解压下载的包,把app拖到mac ...

  10. noip赛前小结3

    嗯,这是第三份小结. 连续三天的小结. 这几天状态逐渐回来了. 前天3道题rk8左右. 昨天上午3道题rk7,但是有一道题考后1minAC了. 昨天晚上2道题AK了. 今天也3道题rk1了. 这个趋势 ...