fork download
  1. # your code goes here
  2. n, m = map(int, input().split())
  3. x1, y1, x2, y2 = 0, 0, 0, 0
  4. image = [[0]*100 for _ in range(100)]
  5. cnt = 0
  6.  
  7. for _ in range(n):
  8. x1, y1, x2, y2 = map(int, input().split())
  9. for i in range(x1, x2 + 1):
  10. for j in range(y1, y2 + 1):
  11. image[i][j] += 1
  12.  
  13. for k in range(100):
  14. for l in range(100):
  15. if image[k][l] > m:
  16. cnt += 1
  17.  
  18. print(cnt)
Runtime error #stdin #stdout #stderr 0.14s 26088KB
stdin
1 0
1 1 100 100
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 11, in <module>
IndexError: list index out of range