BUCT OJ 2264: The Unsolvable Problem
来源:互联网 发布:微信造假软件 编辑:程序博客网 时间:2024/05/21 06:20
题目描述
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 <= 109).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.
输入
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.
输出
For each test cases,print the maximum [a,b] in a line.
样例输入
3234
样例输出
123
上代码~
#include <stdio.h> #define ll long long int main() { ll n, n_case; scanf("%lld", &n_case); while(n_case--){ scanf("%lld", &n); if(n==2) printf("1\n"); else { if(n%2) printf("%lld\n", (n/2)*(n-n/2)); else { if((n/2)%2==0) printf("%lld\n", (n/2-1)*(n/2+1)); else printf("%lld\n", (n/2-2)*(n/2+2)); } } } return 0; } /************************************************************** Problem: 2264 User: 2012014425 Language: C Result: 正确 Time:12 ms Memory:768 kb ****************************************************************/
0 0
- BUCT OJ 2264: The Unsolvable Problem
- hdu - 4627 - The Unsolvable Problem
- HDU 4267 The Unsolvable Problem
- HDU-4627-The Unsolvable Problem
- hdu 4627 The Unsolvable Problem
- HDU 4627 The Unsolvable Problem
- HDU 4627 The Unsolvable Problem 解题报告
- hdu 4627 The Unsolvable Problem (数论)
- HDU 4627 The Unsolvable Problem 数学
- HDU 4691 The Unsolvable Problem 后缀数组
- hdu 4627 The Unsolvable Problem(暴力)
- Buct oj
- hdu 4627 The Unsolvable Problem 多校第三场
- hdu 4627 The Unsolvable Problem【hdu2013多校3签到】
- HDOJ 4627 - The Unsolvable Problem 打表观察..
- 2013 Multi-University Training Contest 3 (g) The Unsolvable Problem
- Buct oj 1012
- Buct oj 1013
- 【cocos2d-x 3.0】瞬间明白std::bind与CC_CALLBACK_N
- MTC及Testin错误,原因分享
- 华为C8813精简三网破解刷机包 基于B177最新版制作 自带归属地
- 解读C的声明(用英语来阅读)
- 练习题(4) -- 一道简单而有有趣的题目
- BUCT OJ 2264: The Unsolvable Problem
- mysql使用sql导入数据中文乱码问题
- web.py 0.3 新手指南 - db.select 查询
- JavaScript中获取事件源的小例子
- oracle之存储过程,临时表,游标示例
- Eigen笔记——初步体验
- Android取得Activity和Service信息
- 基于Android的VoIP系统实现原理
- jdbc 连接mysql 代码