Array Mathematics

  • + 1 comment

    My compact solution…

    import sys
    import numpy as np
    
    _ = input()  # We don't need N or M.  Skip them!
    a, b = np.split(np.loadtxt(sys.stdin, int), 2)
    
    print(a + b, a - b, a * b, a // b, a % b, a**b, sep='\n')