fork download
  1. # your code goes here
  2. a = int(input())
  3. b = int(input())
  4. k = int(input())
  5.  
  6. result1 = (a % k + b % k) % k
  7. result2 = (a % k * b % k) % k
  8. result3 = (a % k - b % k + k) % k
  9.  
  10. print(result1)
  11. print(result2)
  12. print(result3)
  13.  
Success #stdin #stdout 0.07s 14060KB
stdin
5
6
4
stdout
3
2
3