CF553D Nudist Beach
Description
Nudist Beach is planning a military operation to attack the Life Fibers. In this operation, they will attack and capture several cities which are currently under the control of the Life Fibers.
There are $ n $ cities, labeled from 1 to $ n $ , and $ m $ bidirectional roads between them. Currently, there are Life Fibers in every city. In addition, there are $ k $ cities that are fortresses of the Life Fibers that cannot be captured under any circumstances. So, the Nudist Beach can capture an arbitrary non-empty subset of cities with no fortresses.
After the operation, Nudist Beach will have to defend the captured cities from counterattack. If they capture a city and it is connected to many Life Fiber controlled cities, it will be easily defeated. So, Nudist Beach would like to capture a set of cities such that for each captured city the ratio of Nudist Beach controlled neighbors among all neighbors of that city is as high as possible.
More formally, they would like to capture a non-empty set of cities $ S $ with no fortresses of Life Fibers. The strength of a city ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF553D/327104f0a95a1976121514a888c2d90724b0e13e.png) is defined as (number of neighbors of $ x $ in $ S $ ) / (total number of neighbors of $ x $ ). Here, two cities are called neighbors if they are connnected with a road. The goal is to maximize the strength of the weakest city in $ S $ .
Given a description of the graph, and the cities with fortresses, find a non-empty subset that maximizes the strength of the weakest city.
Input Format
N/A
Output Format
N/A
Explanation/Hint
The first example case achieves a strength of 1/2. No other subset is strictly better.
The second example case achieves a strength of 1. Note that the subset doesn't necessarily have to be connected.