##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
| # | Title | Points | Solved | Admin | |
|---|---|---|---|---|---|
You are given a bipartite graph. The graph has vertices on the left side and vertices on the right side.
The vertices are numbered from to . Vertices are on the left side, and vertices are on the right side.
Each vertex has a positive weight .
A set of vertices is called a cover if every edge has at least one endpoint in the set.
The weight of a cover is the sum of weights of its vertices. Let be the minimum possible weight of a cover.
You do not need to find an optimal cover. You only need to output any cover whose weight is at most twice .
In other words, if the weight of your cover is , your output is accepted if .
The input is given in the following format:
For each edge, and .
For each test case, first output an integer , the number of vertices in your cover.
Then output distinct integers , the vertices you choose.
The chosen vertices must form a cover. If the weight of your cover is , it must satisfy .
The output format is:
If , the second line for that test case may be empty.
The chosen vertices cover all edges: every edge has its left endpoint among .
The total weight is .
The minimum possible cover weight is . For example, is a cover with total weight . The shown output is not optimal, but .