1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
#include <iostream> #include <math.h> #include <stdio.h> using namespace std; int main() { int t,x,y,r; cin>>t; while(t--) { cin>>x>>y>>r; double l=sqrt((double)(x*x+y*y)); if(l<0) l*=-1; double a=r-l; if(a<0) a*=-1; double b=r+l; if(b<0) b*=-1; printf("%.2lf %.2lf\n",a,b); } return 0; } |