Company: Flipkart_12july
Difficulty: medium
Graph Shortest Path by Color Query Problem Description You are given an undirected weighted graph G(V,E), with V vertices and E edges. Every vertex carries a colour, and the vertices are grouped into colour-matched pairs: since each pair shares one colour and every pair uses a colour of its own, there are V/2 pairs (when V is even) or (V+1)/2 pairs (when V is odd). You will then receive a query naming one of the colours used among these pairs. Write a program that finds the shortest path, by total weight, connecting the two vertices that share the queried colour. Read the input from STDIN and print the output to STDOUT. Do not write arbitrary strings anywhere in the program, as these contribute to the standard output and testcases will fail. Constraints 2 ≤ V ≤ 100 1 ≤ E ≤ 100 Input Format The first line of input contains two integers V and E separated by single white space, where V is the number of vertices and E is the number of edges. Next E lines of input contain three