dear all,
pls give the c code for problem below
Testing the traversal through different screens Mr. Ajay is a test expert and he has an innovative approach to testing. His current assignment is to test a particular application which traverses through multiple screens.
One screen can be traversed in multiple ways. The server response time to traverse between screens is different.
The circles in the diagram represent the screens and if the screens are connected by edges, it means that the screen can be traversed from the connecting screen. The numbers associated with the edges represent the minimum response time in microseconds between the screens.
He has to navigate from one screen to a destination screen and return to origin screen, visiting each screen exactly once.. What is the fastest way to perform this traversal.
If he has to navigate from 1 to 7, the navigation path he takes is 1-4-6-7-5-2-1
But, Mr. Ajay finds it difficult to find the fastest route himself so he seeks help.
PS: always calculate the path from the first node to the last node and back
Input The first line of test case will contain two integers: N(N<= 100) and R representing respectively the number of screens and the connection between screens. Then R lines will follow each containing three integers: C1, C2 and P. C1 and C2 are the screen numbers and P (P>1) is the limit on the minimum server response time to navigate to the screen. Screen numbers are positive integers ranging from 1 to N.
Output For each test case in the input first output the scenario number. Then output the fastest way to traverse the screen exactly once and return to the origin screen.
Sample Input 7 10
1 2 30
1 3 20
1 4 10
2 4 25
2 5 60
3 6 70
4 7 35
4 6 20
5 7 10
6 7 15
Sample Output 145