hdu 5605 geometry(几何,数学)
2016-01-27 19:15
741 查看
[align=left]Problem Description[/align]
There is a point P at coordinate (x,y). A line goes through the point, and intersects with the postive part of X,Y axes at point A,B. Please calculate the minimum possible value of |PA|∗|PB|.
[align=left]Input[/align]
the first line contains a positive integer T,means the numbers of the test cases. the next T lines there are two positive integers X,Y,means the coordinates of P. T=500,0<X,Y≤10000.
[align=left]Output[/align]
T lines,each line contains a number,means the answer to each test case.
简单推理,来自官方题解:
View Code
There is a point P at coordinate (x,y). A line goes through the point, and intersects with the postive part of X,Y axes at point A,B. Please calculate the minimum possible value of |PA|∗|PB|.
[align=left]Input[/align]
the first line contains a positive integer T,means the numbers of the test cases. the next T lines there are two positive integers X,Y,means the coordinates of P. T=500,0<X,Y≤10000.
[align=left]Output[/align]
T lines,each line contains a number,means the answer to each test case.
简单推理,来自官方题解:
#pragma comment(linker, "/STACK:1024000000,1024000000") #include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<math.h> #include<algorithm> #include<queue> #include<set> #include<bitset> #include<map> #include<vector> #include<stdlib.h> using namespace std; #define ll long long #define eps 1e-10 #define MOD 1000000007 #define N 1000000 #define inf 1e12 int x,y; int main() { int t; scanf("%d",&t); while(t--){ scanf("%d%d",&x,&y); printf("%d\n",2*x*y); } return 0; }
View Code
相关文章推荐
- O2O难解餐饮行业趋势下行之困
- 关于uisliderview 监听停止滑动的状态
- 近期知识点
- 实用技巧数据库自增数字ID转成六位数字和字母的串。(如不想暴露ID的注册邀请码)
- 2016第一发
- 理论: 博弈1:术语讲解
- ImageLoader: java.io.FileNotFoundException: /storage/sdcard0/Android/data/[...]/cache/uil-images/jo
- TCP/IP协议学习之IP协议首部格式
- linux 测试端口是否开启
- 限制Map大小的实现方法
- BeanCreationException及java.lang.IllegalArgumentException: Page directive: invalid value for import
- 时间管理分享,让你分身有术!
- 跟着ZHONGHuan学习设计模式--桥接模式
- Thinkphp结合PHPMailer发邮件
- Java笔记--Session:避免表单的重复提交
- 推迟中断事件到线程中处理
- linux 下vi中关于删除某段,某行,或者全部删除的命令
- iOS开发:UILabel无法响应点击事件的问题
- Educational Codeforces Round 6 A
- How to learn C++ and find all STL Algorithm reference