首页 > 其他分享 >HDU 5605 geometry

HDU 5605 geometry

时间:2022-11-09 20:05:17浏览次数:62  
标签:PB HDU point geometry 5605 int PA line include



Problem Description

There is a point HDU 5605	 geometry_#include at coordinate HDU 5605	 geometry_HDU_02. A line goes through the point, and intersects with the postive part of HDU 5605	 geometry_#include_03 axes at point HDU 5605	 geometry_ios_04. Please calculate the minimum possible value of HDU 5605	 geometry_#include_05.


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.

HDU 5605	 geometry_#include_06,HDU 5605	 geometry_#include_07.


Output



T lines,each line contains a number,means the answer to each test case.


Sample Input


1
2 1

Sample Output



4

in the sample P(2,1)P(2,1),we make the line y=-x+3y=−x+3,which intersects the positive axis of X,YX,Y at (3,0),(0,3).|PA|=\sqrt{2},|PB|=2\sqrt{2},|PA|*|PB|=4∣PA∣=√2,∣PB∣=2√2,∣PA∣∗∣PB∣=4,the answer is checked to be the best answer.




数学题


#include<map>
#include<stack>
#include<queue>
#include<cmath>
#include<string>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;
typedef long long LL;
const int maxn = 1e5 + 10;
int T, x, y;

int main()
{
scanf("%d", &T);
while (T--)
{
scanf("%d%d", &x, &y);
printf("%d\n", 2 * x*y);
}
return 0;
}

标签:PB,HDU,point,geometry,5605,int,PA,line,include
From: https://blog.51cto.com/u_15870896/5838692

相关文章

  • HDU 1329 Hanoi Tower Troubles Again!
    DescriptionPeoplestoppedmovingdiscsfrompegtopegaftertheyknowthenumberofstepsneededtocompletetheentiretask.Butontheotherhand,they......
  • HDU 2475 Box
    DescriptionThereareNboxesontheground,whicharelabeledbynumbersfrom1toN.Theboxesaremagical,thesizeofeachonecanbeenlargedorreduc......
  • HDU 5432 Pyramid Split
    ProblemDescriptionXiaoMingisacitizenwho'sgoodatplaying,hehaslot'sofgoldconeswhichhavesquareundersides,let'scallthempyramids.Anyo......
  • HDU 5496 Beauty of Sequence
    ProblemDescriptionSequenceisbeautifulandthebeautyofanintegersequenceisdefinedasfollows:removesallbutthefirstelementfromeveryconse......
  • HDU 5433 Xiao Ming climbing
    ProblemDescriptionDuetothecursemadebythedevil,XiaoMingisstrandedonamountainandcanhardlyescape.Thismountainisprettystrangethat......
  • HDU 1542 Atlantis
    ProblemDescriptionThereareseveralancientGreektextsthatcontaindescriptionsofthefabledislandAtlantis.Someofthesetextsevenincludemaps......
  • HDU 3308 LCIS
    ProblemDescriptionGivennintegers.Youhavetwooperations:UAB:replacetheAthnumberbyB.(indexcountingfrom0)QAB:outputthelength......
  • HDU 5874 Friends and Enemies
    ProblemDescriptionOnanisolatedisland,livedsomedwarves.Aking(notadwarf)ruledtheislandandtheseasnearby,thereareabundantcobblestones......
  • HDU 5876 Sparse Graph
    ProblemDescriptioncomplement ofagraph G isagraph H onthesameverticessuchthattwodistinctverticesof H areadjacentifand......
  • HDU 5877 Weak Pair
    ProblemDescriptionrooted treeof N nodes,labeledfrom1to N.Tothe ithnodeanon-negativevalue ai isassigned.An order......