Sunday, June 26, 2016

Published June 26, 2016 by with 0 comment

UVA 12704 Solution

#include<cstdio>
#include<math.h>
using namespace std;

int main()
{
    int tc;
    scanf("%d",&tc);
    while (tc--)
    {
        double x,y,r,dis;
        scanf("%lf%lf%lf",&x,&y,&r);
        dis=sqrt(x*x+y*y);
        printf("%.2lf %.2lf\n",r-dis,r+dis);
    }
    return 0;
}
      edit

0 comments:

Post a Comment