There will be at most 25 test cases. Each test case begins with two integers C and R (2<=C<=100, 1<=R<=500). Each of the next R lines contains two integers xi, yi (1<=xi, yi<=C) and two positive floating-point numbers vi and ai (1<=vi<=20,1<=ai<=5), indicating that there is a bidirectional road connecting crossing xi and yi, with parameters vi and ai (see above). Each pair of crossings can be connected by at most one road. The input is terminated by a test case with C=R=0, you should not process it.
For each test case, print the smallest time it takes to reach crossing C from crossing 1, rounded to 3 digitsafter decimal point. It’s always possible to reach crossing C from crossing 1.
3 2 1 2 1.5 1.8 2 3 2.0 1.5 2 1 1 2 2.0 1.8 0 0
2.589 1.976
Tips:
請(qǐng)對(duì)本次比賽進(jìn)行一些描述,公告內(nèi)容應(yīng)當(dāng)包含:
比賽的創(chuàng)辦者或組織;
本次比賽的目的或意義;
本次比賽的考點(diǎn)、語(yǔ)言或類型;或其他注意事項(xiàng)及描述等。
至少保證30個(gè)漢字長(zhǎng)度。