fork download
  1. #include <iostream>
  2. using namespace std;
  3. int t;
  4. int a,b,c;
  5. int get(){
  6. cin>>a>>b>>c;
  7. return 0;
  8. }
  9. int favor(){
  10. if(a>b and a>c){ //
  11. b=a-b+1;
  12. c=a-c+1;
  13. a=0;
  14. cout<<a<<" "<<b<<" "<<c<<endl;
  15. }
  16. else if(b>a and b>c){
  17. a=b-a+1;
  18. c=b-c+1;
  19. b=0;
  20. cout<<a<<" "<<b<<" "<<c<<endl;
  21. }
  22. else if(c>b and c>a){
  23. a=c-a+1;
  24. b=c-b+1;
  25. c=0;
  26. cout<<a<<" "<<b<<" "<<c<<endl;
  27. }
  28. else {
  29. a=1;
  30. b=1;
  31. c=1;
  32. cout<<a<<" "<<b<<" "<<c<<endl; }
  33. return 0;
  34. }
  35.  
  36. int main(){
  37. cin>>t;
  38. for(int i=0;i<t;i++){
  39. get();
  40. favor();
  41. }
  42. }
Success #stdin #stdout 0.01s 5320KB
stdin
1
1 2 2
stdout
1 1 1