Codeforces Global Round 26
H
Tower Capturing
Codeforces
3300
原题
← G→
翻译中…

There are $n$ towers at $n$ distinct points $(x_1, y_1), (x_2, y_2), \ldots, (x_n, y_n)$, such that no three are collinear and no four are concyclic. Initially, you own towers $(x_1, y_1)$ and $(x_2, y_2)$, and you want to capture all of them. To do this, you can do the following operation any number of times:

翻译中…
  • Pick two towers $P$ and $Q$ you own and one tower $R$ you don't own, such that the circle through $P$, $Q$, and $R$ contains all $n$ towers inside of it.
  • Afterwards, capture all towers in or on triangle $\triangle PQR$, including $R$ itself.
翻译中…

An

翻译中…

attack plan

翻译中…

is a series of choices of $R$ ($R_1, R_2, \ldots, R_k$) using the above operations after which you capture all towers. Note that two attack plans are considered different only if they differ in their choice of $R$ in some operation; in particular, two attack plans using the same choices of $R$ but different choices of $P$ and $Q$ are considered the same.

翻译中…

Count the number of attack plans of minimal length. Note that it might not be possible to capture all towers, in which case the answer is $0$.

翻译中…

Since the answer may be large, output it modulo $998\,244\,353$.

翻译中…

Input

翻译中…

The first line contains a single integer $t$ ($1 \leq t \leq 250$) — the number of test cases.

翻译中…

The first line of each test case contains a single integer $n$ ($4 \leq n \leq 100$) — the number of towers.

翻译中…

The $i$-th of the next $n$ lines contains two integers $x_i$ and $y_i$ ($-10^4 \leq x_i, y_i \leq 10^4$) — the location of the $i$-th tower. Initially, you own towers $(x_1, y_1)$ and $(x_2, y_2)$.

翻译中…

All towers are at distinct locations, no three towers are collinear, and no four towers are concyclic.

翻译中…

The sum of $n$ over all test cases does not exceed $1000$.

翻译中…

Output

翻译中…

For each test case, output a single integer — the number of attack plans of minimal length after which you capture all towers, modulo $998\,244\,353$.

翻译中…

Note

翻译中…

In the first test case, there is only one possible attack plan of shortest length, shown below.

翻译中…

image

翻译中…
  • Use the operation with $P =$ tower $1$, $Q =$ tower $2$, and $R =$ tower $5$. The circle through these three towers contains all towers inside of it, and as a result towers $3$ and $5$ are captured.
  • Use the operation with $P =$ tower $5$, $Q =$ tower $1$, and $R =$ tower $4$. The circle through these three towers contains all towers inside of it, and as a result tower $4$ is captured.
翻译中…

In the second case, for example, you can never capture the tower at $(3, 10\,000)$.

翻译中…

样例

Input #1
3
5
1 1
2 5
3 3
4 2
5 4
6
1 1
3 3
1 2
2 1
3 10000
19 84
7
2 7
-4 -3
-3 6
3 1
-5 2
1 -4
-1 7
Output #1
1
0
10
InputCopy OutputCopy
题目信息
题号
1984H
时间限制
2 s
内存限制
256 MB
标签
组合数学
动态规划
计算几何

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。