#P8984. [北大集训 2021] 末日魔法少女计划
[北大集训 2021] 末日魔法少女计划
Background
CTT2021 D1T1
Problem Description
For given , you need to construct a matrix that contains only , where , satisfying:
- .
- .
- For , .
- If and , then there exists such that .
- For , .
You need to output every such that and . Let the number of such pairs be .
If your output does not meet the requirements, you will get no score for that test point. If your output meets the requirements, then you will be scored based on .
Input Format
One line with two integers .
Output Format
The first line contains an integer . The next lines each contain two integers , which represent each pair satisfying and .
3 2
1
0 2
Hint
- .
- .
Each corresponds to a subtask with total score . The score of each subtask is the minimum score among all test points in that subtask.
The score of each test point equals the total score of its subtask multiplied by $\max\left(0,1-\sqrt{\max\left(0,\frac{m}{n\cdot f(k)}-1\right)}\right)$.
Translated by ChatGPT 5