{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eDo not sincere non-interference。\u003cbr\u003eLike that show, now starvae also take part in a show, but it take place between city A and B. Starvae is in city A and girls are in city B. Every time starvae can get to city B and make a data with a girl he likes. But there are two problems with it, one is starvae must get to B within least time, it\u0027s said that he must take a shortest path. Other is no road can be taken more than once. While the city starvae passed away can been taken more than once. \u003cbr\u003e\u003cbr\u003e\u003cbr\u003eSo, under a good RP, starvae may have many chances to get to city B. But he don\u0027t know how many chances at most he can make a data with the girl he likes . Could you help starvae?\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line is an integer T indicating the case number.(1\u0026lt;\u003dT\u0026lt;\u003d65)\u003cbr\u003eFor each case,there are two integer n and m in the first line ( 2\u0026lt;\u003dn\u0026lt;\u003d1000, 0\u0026lt;\u003dm\u0026lt;\u003d100000 ) ,n is the number of the city and m is the number of the roads.\u003cbr\u003e\u003cbr\u003eThen follows m line ,each line have three integers a,b,c,(1\u0026lt;\u003da,b\u0026lt;\u003dn,0\u0026lt;c\u0026lt;\u003d1000)it means there is a road from a to b and it\u0027s distance is c, while there may have no road from b to a. There may have a road from a to a,but you can ignore it. If there are two roads from a to b, they are different.\u003cbr\u003e\u003cbr\u003eAt last is a line with two integer A and B(1\u0026lt;\u003dA,B\u0026lt;\u003dN,A!\u003dB), means the number of city A and city B.\u003cbr\u003eThere may be some blank line between each case."}},{"title":"Output","value":{"format":"HTML","content":"Output a line with a integer, means the chances starvae can get at most."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n7 8\r\n1 2 1\r\n1 3 1\r\n2 4 1\r\n3 4 1\r\n4 5 1\r\n4 6 1\r\n5 7 1\r\n6 7 1\r\n1 7\r\n\r\n6 7\r\n1 2 1\r\n2 3 1\r\n1 3 3\r\n3 4 1\r\n3 5 1\r\n4 6 1\r\n5 6 1\r\n1 6\r\n\r\n2 2\r\n1 2 1\r\n1 2 2\r\n1 2\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n1\r\n1\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}