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.
 

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

  1. #pragma comment(linker, "/STACK:1024000000,1024000000")
  2. #include<iostream>
  3. #include<cstdio>
  4. #include<cstring>
  5. #include<cmath>
  6. #include<math.h>
  7. #include<algorithm>
  8. #include<queue>
  9. #include<set>
  10. #include<bitset>
  11. #include<map>
  12. #include<vector>
  13. #include<stdlib.h>
  14. using namespace std;
  15. #define ll long long
  16. #define eps 1e-10
  17. #define MOD 1000000007
  18. #define N 1000000
  19. #define inf 1e12
  20. int x,y;
  21. int main()
  22. {
  23. int t;
  24. scanf("%d",&t);
  25. while(t--){
  26. scanf("%d%d",&x,&y);
  27. printf("%d\n",*x*y);
  28.  
  29. }
  30. return ;
  31. }

hdu 5605 geometry(几何,数学)的更多相关文章

  1. B. Tell Your World(几何数学 + 思维)

    B. Tell Your World time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  2. C. Polygon for the Angle 几何数学

    C. Polygon for the Angle 几何数学 题意 给出一个度数 ,问可以实现的最小的n的n边形是多少 思路 由n边形的外角和是180度直接就可以算出最小的角是多少 如果给出的度数是其最 ...

  3. HDU - 6242 Geometry Problem (几何,思维,随机)

    Geometry Problem HDU - 6242 Alice is interesting in computation geometry problem recently. She found ...

  4. BestCoder Round #68 (div.2) geometry(hdu 5605)

    geometry Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Su ...

  5. PostGIS解析Geometry几何对象

    一.Geometry转WKT select st_astext(geom) where tableName; 二.PostGIS常用函数 wkt转geometry st_geomfromtext(wk ...

  6. HDU 4816 Bathysphere(数学)(2013 Asia Regional Changchun)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4816 Problem Description The Bathysphere is a spheric ...

  7. HDU 5584 LCM Walk 数学

    LCM Walk Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5584 ...

  8. HDU 4336 Card Collector 数学期望(容斥原理)

    题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=4336 题意简单,直接用容斥原理即可 AC代码: #include <iostream> ...

  9. HDU 5570 balls 期望 数学

    balls Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5570 De ...

随机推荐

  1. Oracle数据库使用存储过程实现分页

    注:本示例来源于韩顺平[10天玩转oracle数据库]视频教程 1.创建包同时创建游标 create or replace package pagingPackage is type paging_c ...

  2. JS~delegate与live

    在jquery里有两个方法可以用来绑定自动追加出来的DOM对象,它们是live和delegate,事实上,这两个方法是bind方法的一个变体,在对于固定DOM对象时,我们通常使用bind就可以了,而对 ...

  3. linux下php扩展curl的安装

    方法一 安装cURL wget http://curl.haxx.se/download/curl-7.17.1.tar.gz tar -zxf curl-7.17.1.tar.gz ./config ...

  4. pt-online-schema-change解读

    [用途]在线改表 [注意风险]因为涉及到修改表的数据和结构,所以在使用前要小心测试并做好备份,工具默认不会改表,除非你添加了--execute参数 [工具简介] pt-osc模仿MySQL内部的改表方 ...

  5. 【降维解法:最大字段和->最大子矩阵和->最终版最大子长方体和】【UVA10755】Garbage Heap

    突然感觉刷完这一套专题后 码力有了质的飞跃,fighting 努力会有结果! 最大字段和是一个很经典的问题 O(n)算法 而对于最大子矩阵和 可以思考一个这样的想法 枚举上下边界i,j把i到j这一段的 ...

  6. 不同SQL Server数据库之间的跨数据库查询

    --不同SQL Server数据库之间的跨数据库查询 EXEC sp_addlinkedserver @server=N'OldDatabase', --自己定义别名 @srvproduct=N'', ...

  7. java学习之i/o

    基本的输入输出  这里有两种方法,其中一种被注释了,可以换着注释后测试一遍 class TestSystem { public static void main(String[] args) { /* ...

  8. OSError: [Errno 13] Permission denied: '/etc/cron.d/1sandbox_registration'

    使用Hortonworks 的twitter tutorial: http://hortonworks.com/hadoop-tutorial/how-to-refine-and-visualize- ...

  9. Appium项目搭建 For windows

    1.appium又安装了最新版本,更新了,1.4.16.1,然后整理电脑的时候发现自动更新的时候不是在原来的地方进行覆盖,所以就重新安装了一遍,注意需要看下环境变量是否配置了(用户变量:C:\Appi ...

  10. MVC 授权过滤器 AuthorizeAttribute

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...