CF13D.Triangles

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Little Petya likes to draw. He drew NN red and MM blue points on the plane in such a way that no three points lie on the same line. Now he wonders what is the number of distinct triangles with vertices in red points which do not contain any blue point inside.

输入格式

The first line contains two non-negative integer numbers NN and MM ( 0<=N<=5000<=N<=500 , 0<=M<=5000<=M<=500 ) — the number of red and blue points respectively. The following NN lines contain two integer numbers each — coordinates of red points. The following MM lines contain two integer numbers each — coordinates of blue points. All coordinates do not exceed 10910^{9} by absolute value.

输出格式

Output one integer — the number of distinct triangles with vertices in red points which do not contain any blue point inside.

输入输出样例

  • 输入#1

    4 1
    0 0
    10 0
    10 10
    5 4
    2 1
    

    输出#1

    2
    
  • 输入#2

    5 5
    5 10
    6 1
    8 6
    -6 -7
    7 -1
    5 -1
    10 -4
    -10 -8
    -10 5
    -2 -8
    

    输出#2

    7
    
首页