#P10193. Traffic-Convenient Tourist Destinations

    ID: 12186 Type: Default 1000ms 256MiB

Traffic-Convenient Tourist Destinations

Traffic-Convenient Tourist Destinations

Farmer John wants to promote his Bessla electric tractor series by showcasing its charging network. On a map, there are $N$ interest points labeled from $1$ to $N$. The first $C$ points are charging stations and the remaining ones are tourist destinations. The points are connected by $M$ bidirectional roads: the $i$-th road connects two distinct points $u_i$ and $v_i$ with a length of $l_i$ miles.

The Bessla tractor can travel at most $2R$ miles on a full charge, which enables it to make a round trip between a charging station and any destination within $R$ miles. A tourist destination is said to be traffic-convenient if it is reachable (with a one-way distance not exceeding $R$) from at least $K$ different charging stations.

Your task is to determine and output the set of traffic-convenient tourist destinations. Tourist destinations are those interest points with labels from $C+1$ to $N$.

inputFormat

The input starts with a line containing five integers: $N$, $M$, $C$, $R$, and $K$, which denote the total number of interest points, the number of roads, the number of charging stations, the maximum one-way distance $R$, and the minimum number of charging stations required, respectively.

Each of the following $M$ lines contains three integers $u_i$, $v_i$, and $l_i$, describing a bidirectional road between interest points $u_i$ and $v_i$ with length $l_i$ miles.

Note: Interest points $1$ through $C$ are charging stations, and points $C+1$ through $N$ are tourist destinations.

outputFormat

First, output a line containing an integer $T$, the number of traffic-convenient tourist destinations. On the next line, output $T$ space-separated integers in increasing order, representing the labels of these destinations.

sample

4 4 2 5 2
1 3 3
2 3 4
1 4 6
2 4 2
1

3

</p>