Advertisement
Guest User

winner#1

a guest
Oct 22nd, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. cho = input("");
  2. num = [int(s) for s in cho.split()];
  3.  
  4.  
  5. out = [0, 0, 0];
  6. out[0] = -24 * num[0] + 6 * num[1] + 12 * num[2];
  7. out[1] = -6 * num[1] + 12 * num[2];
  8. out[2] = 4 * num[0] +  num[1] - 2 * num[2];
  9. canary = True;
  10. for n in out:
  11.     if n % 24 != 0 or n < 0:
  12.         canary = False;
  13.        
  14. if canary:
  15.     print("{:d} {:d} {:d}".format(int(out[0]/24),int(out[1]/24),int(out[2]/24)));
  16. else:
  17.     print("Error");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement