#696. Binary Craziness
Binary Craziness
Description
Walk Alone has a graph of nodes and bi-directional edges. He defines a function of $f(u, v)=(\deg_u \oplus \deg_v)(\deg_u | \deg_v)(\deg_u \& \deg_v)$, where denotes the number of edges that associated with node , and denotes bitwise xor, bitwise or and bitwise and. He wants you to calculate $\left(\sum_{i=1}^n \sum_{j=i}^n f(i, j)\right) \bmod 998\ 244\ 353$.
Format
Input
The first line of the input contains two integers () denoting the number of nodes and edges.
Each of the following lines contains two integers () representing a bi-directional edge .
The graph might have duplicated edges and self-loops. Remind that a self-loop on node will contribute to .
Output
Output a single integer denoting the answer.
Samples
6 6
1 3
2 3
1 4
2 5
3 6
4 6
30
Limitation
1s, 1024KiB for each test case.
相关
在下列比赛中: