fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main(){
  4. int t;cin>> t;
  5. while (t--){
  6. int a,b,r;cin>>a>>b>>r;
  7. int x;int y;
  8. for (int i=-25;i<=25;i++){
  9. for (int j=-25;j<=25;j++){
  10. if ((((a-i)*(a-i))+((b-j)*(b-j)))==r*r){
  11. x=i;
  12. y=j;
  13. break;
  14. }
  15. }
  16. }
  17. cout << x << " "<<y <<'\n';
  18. }
  19. }
Success #stdin #stdout 0s 592KB
stdin
Standard input is empty
stdout
0  0
0  0