fork download
  1. P,Q,W = map(int,input().split())
  2. for i in range(W):
  3. if Q == 0:
  4. if P == 0:
  5. print("0 0")
  6. else:
  7. print('{} {}'.format(W//P,Q))
  8. else:
  9. a = W-(P*(i))
  10. if a%Q == 0:
  11. health = i
  12. mana = (W-(P*(i)))//Q
  13. break
  14. print("{} {}".format(health, mana))
Runtime error #stdin #stdout #stderr 0.02s 7360KB
stdin
1 2 1
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 1, in <module>
  File "<string>", line 1
    1 2 1
      ^
SyntaxError: invalid syntax