Tower Capturing Codeforces
Tower Capturing Codeforces
|
NguyenDucHien | Logout
HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP
PROBLEMS SUBMIT CODE MY SUBMISSIONS STATUS HACKS ROOM STANDINGS CUSTOM INVOCATION
Count the number of attack plans of minimal length. Note that it might not be possible to
Submit
capture all towers, in which case the answer is 0.
Since the answer may be large, output it modulo 998 244 353 .
→ Score table
Input
The first line contains a single integer t (1 ≤ t ≤ 250 ) — the number of test cases. Score
Problem A 444
The first line of each test case contains a single integer n (4 ≤ n ≤ 100) — the number of
Problem B 666
towers.
Problem C1 666
4 4
The i -th of the next n lines contains two integers x i and yi (−10 ≤ x i , yi ≤ 10 ) — the Problem C2 1110
location of the i -th tower. Initially, you own towers (x 1 , y1 ) and (x 2 , y2 ) .
Problem D 2220
All towers are at distinct locations, no three towers are collinear, and no four towers are Problem E 2664
concyclic.
Problem F 2664
The sum of n over all test cases does not exceed 1000 . Problem G 3552
Problem H 4440
Output
For each test case, output a single integer — the number of attack plans of minimal length Successful hack 100
after which you capture all towers, modulo 998 244 353 . Unsuccessful hack -50
Unsuccessful submission -50
Example
Resubmission -50
input Copy
* If you solve problem on 00:42 from the first attempt
3
5
1 1
2 5
3 3
4 2
5 4
6
1 1
3 3
1 2
2 1
https://codeforces.com/contest/1984/problem/H 1/2
6/9/24, 10:17 PM Problem - H - Codeforces
3 10000
19 84
7
2 7
-4 -3
-3 6
3 1
-5 2
1 -4
-1 7
output Copy
1
0
10
Note
In the first test case, there is only one possible attack plan of shortest length, shown below.
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).
Supported by
https://codeforces.com/contest/1984/problem/H 2/2