This page is still under construction.

Parts of this page are still being built. What you see may change.

Quarantine Station Placement

Time limit10sMemory limit512 MB

Summary
Place quarantine stations on the fewest islands so every liner touches a station, or report that K stations cannot cover all liners.
Level

Medium7 of 10

Topics
Backtracking, Graph
Solved
No attempts yet

Problem

Your country declared a state of emergency because MOFU syndrome is spreading. Anyone who catches it cannot get out of bed in the morning. You are a programmer at the Department of Health, and you have to put a measure in place quickly.

The country has NN islands numbered from 1 to NN, and ocean liners run between some pairs of islands. The Department of Health decided to build quarantine stations on a few islands and stop infected people from travelling. For the plan to work, there must be no liner whose two endpoint islands both lack a quarantine station. The trouble is that the budget covers at most KK stations.

Decide whether such a placement exists. If it does, find the smallest number of quarantine stations it needs.

Input

The first line contains three integers NN, MM, and KK (2≤N≤30002 \le N \le 3000, 1≤M≤300001 \le M \le 30000, 1≤K≤321 \le K \le 32).

Each of the next MM lines contains two integers aia_i and bib_i (1≤ai≤N1 \le a_i \le N, 1≤bi≤N1 \le b_i \le N). This means the ii-th liner connects island aia_i and island bib_i. For every ii, ai≠bia_i \ne b_i, and at most one liner runs between any pair of islands.

Output

If no placement of quarantine stations satisfies the requirement, print Impossible. Otherwise print the smallest number of quarantine stations.

Examples4

  1. Example 1

    Input
    3 3 2
    1 2
    2 3
    3 1
    
    Expected output
    2
    
  2. Example 2

    Input
    3 3 1
    1 2
    2 3
    3 1
    
    Expected output
    Impossible
    
  3. Example 3

    Input
    7 6 5
    1 3
    2 4
    3 5
    4 6
    5 7
    6 2
    
    Expected output
    4
    
  4. Example 4

    Input
    10 10 10
    1 2
    1 3
    1 4
    1 5
    2 3
    2 4
    2 5
    3 4
    3 5
    4 5
    
    Expected output
    4