#Lutece1952. handsome_yhyの旅行

handsome_yhyの旅行

Migrated from Lutece 1952 handsome_yhyの旅行

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

TQL!!!TQL!!! 刷了一天的题后,集训队最 帅气/可爱 的handsomeyhyhandsomeyhy决定去春熙路散散步.

假设handsomeyhyhandsomeyhy初步计划了NN个散步点,分别被标为1,2,3...N1,2,3...N,这些点之间有MM条道路.每条道路双向连接不同的两个点,且要走完这条道路会花费固定的时间.

初始时handsomeyhyhandsomeyhy在标号为11的点,她的最终目的地是标号为NN的点.在这期间她可以穿过某个散步点(包括NN)和通过某条道路任意次,一旦她决定走某条道路她会坚持把它走完(不能中途返回).

请问是否存在一种走法使得她恰好在TT时间的时候在最终目的地呢?

Input

第一个数字CaseCase表示样例数

对于每个样例 第一行三个数字NN MM TT 表示有NN个散步点 (2N502 \le N \le 50 ) MM条道路 (1M501 \le M \le 50 ) 和时间TT (1T10181 \le T \le 10^{18} )

接下来MM行 每行有AiA_i BiB_i CiC_i 表示标号为AiA_iBiB_i的两个不同点之间(1Ai,BiN1 \le A_i,B_i \le N )有一条道路 通过它一次需要CiCi (1Ci100001 \le C_i \le 10000 )的时间.

Output

对于每个样例存在满足条件的走法则输出 Yes 否则输出 No

Samples

1
3 3 25
2 3 5
1 2 6
1 3 7
Yes

Note

121\to 2,232\to 3,313\to 1,131\to 3

Resources

2018 UESTC ACM Training for Graph Theory