QOJ.ac

QOJ

時間限制: 3 s 記憶體限制: 512 MB 總分: 100

#9503. 六花与三角形

统计

Rikka 在二维笛卡尔坐标系上放置了 $n$ 个点。第 $i$ 个点的坐标为 $(x_i, y_i)$。她想要选择三个点来制作一件武器,然后用它来对抗“无形边界”的管理部门。

为了使这件武器更强大,Rikka 将三角形的形状限制为锐角三角形。制作武器的合法方案可能有多种。Rikka 希望你计算所有这些方案中三角形面积的总和。

如果两个方案中至少有一个点不同,则认为它们是不同的。

注意:你可以在程序中使用 __int128

输入格式

第一行包含一个整数 $T$ ($1 \le T \le 5$),表示测试用例的数量。

对于每个测试用例,第一行包含一个整数 $n$ ($3 \le n \le 2000$),表示点的数量。接下来 $n$ 行,每行包含两个整数 $x$ 和 $y$ ($|x|, |y| \le 10^{18}$),表示一个点的坐标。输入保证没有两个点是相同的。

输出格式

设 $S$ 为面积之和,可以证明 $2 \times S$ 是一个整数。

由于答案可能非常大,你只需要输出 $2 \times S$ 对 $998244353$(一个质数)取模的结果。

样例

输入 1

3
3
1 1
2 2
2 3
3
1 1
2 3
3 2
4
1 1
3 1
4 1
2 3

输出 1

0
3
10

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.