Codeforces - 1194E - Count The Rectangles - 扫描线

NoSuchKey