SP28451 ADACITY - Ada and Cities

Description

Ada the Ladybug and her friends are on trip in Bugraine. Most of them are in different cities at the moment. They want to spread as much as possible, make hologram-skype to show all others the city. They have agreed, to make this call in time **T**. The cities are connected with bi-directional roads. Each of the road has some length (which equals to time it takes to travel between two cities).

Input Format

The first line will contain the number of test-cases. The first line of each test-case begins with four integers: **N,M,F,T**, number of cities, number of roads, number of friends (Ada inclusive) and time they have: **1 , 0** Then a line with **F** integers follows, **1 , the city, where **i** $ ^{th} $ friend currently is.** Afterward **M** lines follow, with three integers **A,B,L**, **1 , indicating a road, which connect cities **A,B** with length of **L**** PS: There might exist multiple roads between two cities and there might also be a "circular route" which begins and ends in the same city!

Output Format

For each test-case, print maximal number of different cities Ada and her friends can end up at after **T** time!