fork download
  1. def m(h,f,o,t):C=100;b=[24/(50/h)*1000,min(2000,[-f/10*~9,f][f%2]<<h+2)][h<5];x=(o|2-t)*-2*b/C*C;y=~o*t*b/C*C;return-x-y-y,x,y,y
  2.  
  3. cases = [
  4. [(1, 22, 0, 1), (1100, -500, -300, -300)],
  5. [(1, 22, 0, 0), (1000, -1000, 0, 0)],
  6. [(3, 25, 1, 0), (4800, -4800, 0, 0)],
  7. [(3, 106, 1, 0), (12000, -12000, 0, 0)],
  8. [(4, 20, 0, 1), (5200, -2600, -1300, -1300)],
  9. [(4, 24, 1, 1), (11700, -3900, -3900, -3900)],
  10. [(4, 25, 1, 0), (9600, -9600, 0, 0)],
  11. [(4, 40, 0, 1), (8000, -4000, -2000, -2000)],
  12. [(5, 88, 1, 1), (12000, -4000, -4000, -4000)],
  13. [(7, 25, 1, 1), (18000, -6000, -6000, -6000)],
  14. [(9, 50, 0, 0), (16000, -16000, 0, 0)],
  15. [(12, 64, 0, 0), (24000, -24000, 0, 0)],
  16. [(13, 130, 1, 0), (48000, -48000, 0, 0)],
  17. ]
  18.  
  19. for input_, output in cases:
  20. assert sorted(m(*input_)) == sorted(output)
Success #stdin #stdout 0s 9024KB
stdin
Standard input is empty
stdout
Standard output is empty