您的位置:首页 > 其它

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.

简单推理,来自官方题解:

#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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: