#P9994. [Ynoi Easy Round 2024] TEST_132
[Ynoi Easy Round 2024] TEST_132
Problem Description
Given distinct points on the plane, each point has a weight, initially .
There are operations in total:
- Update operation: given , change the weight of every point satisfying to .
- Query operation: given , compute the sum of weights of all points satisfying .
The answer should be taken modulo .
Input Format
The first line contains two integers .
The next lines each contain three integers .
The next lines each contain two integers. An update operation is written as , and a query operation is written as .
Output Format
For each query operation, output one line containing the answer.
5 10
1 3 597843412
1 1 613307236
1 2 488247075
1 4 29761102
1 5 101159431
1 1
2 2
1 1
2 2
2 1
2 2
1 1
1 1
2 3
1 1
577359197
27079329
482035359
27079329
220579797
Hint
Idea: ccz181078, Solution: ccz181078, Code: ccz181078, Data: ccz181078.
For of the testdata, , , , and .
For of the testdata, .
For another of the testdata, there are no update operations.
For another of the testdata, are independently chosen uniformly at random from .
For the remaining of the testdata, there are no special constraints.
Translated by ChatGPT 5