atcoder#ABC220H. [ABC220H] Security Camera
[ABC220H] Security Camera
Score : points
Problem Statement
AtCoder Town has intersections and roads. Road connects Intersections and .
Takahashi, the mayor, has decided to install zero or more surveillance cameras at the intersections. Each intersection can be installed with zero or one surveillance camera.
How many of the ways to install surveillance cameras monitor an even number of roads?
Here, Road is said to be monitored when the following condition is satisfied:
a surveillance camera is installed at one or both of Intersections and .
Constraints
- if .
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
3 2
1 2
2 3
6
The sets of towns to install surveillance cameras to satisfy the condition are: $\{ \} , \{ 2 \} , \{ 1,2 \} ,\{1,3\},\{2,3\},\{1,2,3\}$. Note that it is allowed to install no surveillance camera.
20 3
5 6
3 4
1 2
458752
The town may not be connected.