Description

There are many unsolvable problem in the world.It could be about one or about zero.But this time it is about bigger number. 
Given an integer n(2 <= n <= 10 9).We should find a pair of positive integer a, b so that a + b = n and [a, b] is as large as possible. [a, b] denote the least common multiplier of a, b.
 

Input

The first line contains integer T(1<= T<= 10000),denote the number of the test cases. 
For each test cases,the first line contains an integer n.
 

Output

For each test cases, print the maximum [a,b] in a line.
 

Sample Input

3
2
3
4
 

Sample Output

1
2
3
 
#include <iostream>
using namespace std;
int gcd(int a,int b){
int c=b%a;
while(c>){
b=a;
a=c;
c=b%a;
}
return a;
} int main()
{
int t;cin>>t;int n;
while(t--){
__int64 sum=,i;
cin>>n;
for(i=n/;i>;i--){
if(gcd(i,n-i)==)
{
sum=i*(n-i);
break;
}
}
cout<<sum<<endl;
}
return ;
}

the least common multiplier的更多相关文章

  1. HDU 4627 E(Contest #3)

    Description There are many unsolvable problem in the world.It could be about one or about zero.But t ...

  2. HDU/杭电2013多校第三场解题报告

    今天悲剧了,各种被虐啊,还是太年轻了 Crime 这道题目给的时间好长,第一次就想到了暴力,结果华丽丽的TLE了. 后来找了一下,发现前24个是1, 2, 6, 12, 72, 72, 864, 17 ...

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

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

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

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

  5. 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 ...

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

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

  7. Appendix A. Common application properties

    Appendix A. Common application properties Prev  Part X. Appendices  Next URl链接:https://docs.spring.i ...

  8. Spring Boot Common application properties(转载)

    转自官方文档:http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.h ...

  9. Socket聊天程序——Common

    写在前面: 上一篇记录了Socket聊天程序的客户端设计,为了记录的完整性,这里还是将Socket聊天的最后一个模块--Common模块记录一下.Common的设计如下: 功能说明: Common模块 ...

随机推荐

  1. goahead 移植

    1.网上下载goahead-3.1.-0-src.tgz包 2.解压 tar -zxvf goahead-3.1.-0-src.tgz 3.编译 cd goahead-3.1.-0 make CC=a ...

  2. 开源网络库的分析libev libevent nginx ....

    最经看关于网络编程的一些书,对于网络编程中的一些基本东西,开源库已经封装的很好了,但是库归根结底还是使用的基本API,所以就想着分析一下,尤其是在看了各个库的介绍以后,所以这段时间想在这个方向投入一点 ...

  3. HDU 3909 DLX

    http://blog.csdn.net/sr_19930829/article/details/39756513 http://www.kuangbin.net/archives/hdu4069-d ...

  4. 显示器中关于HS,VS,HBP,VBP参数浅析

    先来解释几个缩写的含义 HSYNC : 水平同步信号(horizontal synchronization signal) VSYNC :  垂直同步(Vertical Sync):场同步 FR : ...

  5. Maven创建项目: Failed to execute goal org.apache.maven.plugin( mvn archetype:create)

    一.概述: 在使用mvn 命令mvn archetype:create -DgroupId=com.chuanliu.c11 -DartifactId=c11searcher在控制创建maven项目和 ...

  6. php __autoload使用

    官方介绍: void __autoload ( string $class ) 你可以通过定义这个函数来启用类的自动加载. 转载一篇文章: PHP autoload机制详解 (1) autoload机 ...

  7. swift 关于 toolbar 学习笔记

    import UIKit class ViewController: UIViewController { @IBOutlet weak var toolBar: UIToolbar! @IBOutl ...

  8. muduo 与 libevent2 吞吐量对照

    libevent 是一款很好用的 C 语言网络库,它也採用 Reactor 模型,正好能够与 muduo 做一对照. 本文用 ping pong 測试来对照 muduo 和 libevent2 的吞吐 ...

  9. aop编程 环绕round

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  10. Swift 初见

    http://numbbbbb.gitbooks.io/-the-swift-programming-language-/chapter1/02_a_swift_tour.html 本页内容包括: 简 ...