P10897 AGC022F Checkers Story 2
Background
> "The everlasting past, the future that gradually fades away."
>
> Taking something as a price, taking some price as an opportunity...?
>
> "I'm not crazy, my reality is just different to yours."
>
> Yellow sand rolls with wild winds, and the courtyard remains as it was.
Description
Let $x=40^{76^{93}}$. There are $n$ points on the plane, and the coordinates of the $i$-th point are $(x^i,0)$.
Perform $m$ operations. In each operation, choose two points $A$ and $B$, rotate $A$ clockwise around $B$ by $60°$, and delete $B$.
Find how many possible positions the centroid of all remaining points can have in the end, modulo $998244353$.
$2 \le n\le 407693$, $1\le m\le n-1$.
Input Format
One line with two integers $n,m$.
Output Format
One line: the answer modulo $998244353$.
Explanation/Hint
This problem has only one Subtask. You can score only if you pass all testdata.
```
No matter how unreal the dream is,
no matter how faint the hope is,
sadness, pain, and despair—don’t be afraid.
It’s okay, they are all the same.
Forget the unreal dream,
give up the faint hope.
The happy and beautiful scene—let’s do it again,
how about it?
```
Translated by ChatGPT 5