CF949C Data Center Maintenance

Description

BigData Inc. is a corporation that has $ n $ data centers indexed from $ 1 $ to $ n $ that are located all over the world. These data centers provide storage for client data (you can figure out that client data is really big!). Main feature of services offered by BigData Inc. is the access availability guarantee even under the circumstances of any data center having an outage. Such a guarantee is ensured by using the two-way replication. Two-way replication is such an approach for data storage that any piece of data is represented by two identical copies that are stored in two different data centers. For each of $ m $ company clients, let us denote indices of two different data centers storing this client data as $ c_{i,1} $ and $ c_{i,2} $ . In order to keep data centers operational and safe, the software running on data center computers is being updated regularly. Release cycle of BigData Inc. is one day meaning that the new version of software is being deployed to the data center computers each day. Data center software update is a non-trivial long process, that is why there is a special hour-long time frame that is dedicated for data center maintenance. During the maintenance period, data center computers are installing software updates, and thus they may be unavailable. Consider the day to be exactly $ h $ hours long. For each data center there is an integer $ u_{j} $ ( $ 0

Input Format

The first line of input contains three integers $ n $ , $ m $ and $ h $ ( $ 2

Output Format

In the first line print the minimum possible number of data centers $ k $ ( $ 1

Explanation/Hint

Consider the first sample test. The given answer is the only way to conduct an experiment involving the only data center. In such a scenario the third data center has a maintenance during the hour 1, and no two data centers storing the information of the same client have maintenance at the same hour. On the other hand, for example, if we shift the maintenance time on hour later for the first data center, then the data of clients 1 and 3 will be unavailable during the hour 0.