hdu 5605 geometry(几何,数学)

Problem Description
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|.
 
Input
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.
 
Output
T lines,each line contains a number,means the answer to each test case.
 

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

hdu 5605 geometry(几何,数学)

 #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",*x*y); }
return ;
}
上一篇:使用lua实现99乘法口诀表,就这么简洁


下一篇:【模板】关于c++的代码模板