编程介的小学生 2019-06-11 21:11 采纳率: 20.5%
浏览 275

根据星图计算有多少星星构成的区域问题,要求的是采用的C语言的程序编写的设计的源代码怎么才能实现的呢?

Problem Description
Lucy loves stars very much. There are N (1 <= N <= 1000) stars in the sky. Assume the sky is a flat plane. All of the stars lie on it with a location (x, y), -10000 <= x, y <= 10000. Now, Lucy wants you to tell her how many squares with each of four vertices formed by these stars, and the edges of the squares should parallel to the coordinate axes.

Input
The first line of input is the number of test case.
The first line of each test case contains an integer N. The following N lines each contains two integers x, y, meaning the coordinates of the stars. All the coordinates are different.

Output
For each test case, output the number of squares in a single line.

Sample Input
2
1
1 2
4
0 0
1 0
1 1
0 1

Sample Output
0
1

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
    • ¥15 数据可视化Python
    • ¥15 要给毕业设计添加扫码登录的功能!!有偿
    • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
    • ¥15 微信公众号自制会员卡没有收款渠道啊
    • ¥15 stable diffusion
    • ¥100 Jenkins自动化部署—悬赏100元
    • ¥15 关于#python#的问题:求帮写python代码
    • ¥20 MATLAB画图图形出现上下震荡的线条
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘