Advertisement
raisul82

UVA 12502 Three families

Apr 3rd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. double x,y,z,k,result;
  6. int t;
  7. scanf("%d",&t);
  8. while(t-- && scanf("%lf%lf%lf",&x,&y,&z)==3)
  9. {
  10. k=(x+y)/3;
  11. result=(z/k)*(x-k);
  12. if(result<=0)
  13. {
  14. result=0;
  15. }
  16.  
  17. printf("%.0lf\n",result);
  18. }
  19.  
  20. return 0;
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement