PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#CC0000061. Hình chữ nhật không có cạnh trên (Tokitsukaze and Strange Rectangle)
HỌC THEO LỘ TRÌNH
2 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Hình chữ nhật không có cạnh trên (Tokitsukaze and Strange Rectangle)
Tokitsukaze and Strange Rectangle
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
There are distinct points. Choose real numbers and and select precisely the points with and . The selected region has no upper boundary. Count the distinct nonempty selected sets, counting identical sets only once.
Input
The first line contains . The next lines give point coordinates .
Output
Print the number of distinct nonempty point sets obtainable.
Subtasks
- Subtask 1 (20 points): ; ; all point pairs are distinct.
- Subtask 2 (30 points): ; ; all point pairs are distinct.
- Subtask 3 (50 points): ; ; all point pairs are distinct.
Examples
Input
4
2 1
2 2
3 1
3 2
Output
6
Explanation
There are 2 selected sets of size one, 3 of size two, and 1 of size four. No set of three points is obtainable, so the answer is 6.