{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003ctable align\u003d\"right\" border\u003d\"0\" cellpadding\u003d\"0\"\u003e\r\n\t\u003ctbody\u003e\r\n\t\t\u003ctr\u003e\r\n\t\t\t\u003ctd\u003e\r\n\t\t\t\t\u003cp\u003e\r\n\t\t\t\t\t\u003cem\u003e-- 3 spring rolls please.\u003cbr /\u003e\r\n\t\t\t\t\t-- MSG\u0026#39;D!!\u003cbr /\u003e\r\n\t\t\t\t\t-- Oh! My stomach lining! \u003c/em\u003e\u003c/p\u003e\r\n\t\t\t\u003c/td\u003e\r\n\t\t\u003c/tr\u003e\r\n\t\u003c/tbody\u003e\r\n\u003c/table\u003e\r\n\u003cdiv style\u003d\"clear:both;\"\u003e\r\n\t\u0026nbsp;\u003c/div\u003e\r\n\u003cp align\u003d\"right\"\u003e\r\n\t\u003ctt\u003eStrong Bad\u003c/tt\u003e\u003c/p\u003e\r\n\u003cp\u003e\r\n\tYou are part of a group of \u003cstrong\u003en\u003c/strong\u003e teenage girls armed with cellphones. You have some news you want to tell everyone in the group. The problem is that no two of you are in the same room, and you must communicate using only cellphones. What\u0026#39;s worse is that due to excessive usage, your parents have refused to pay your cellphone bills, so you must distribute the news by calling each other in the cheapest possible way. You will call several of your friends, they will call some of their friends, and so on until everyone in the group hears the news.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tEach of you is using a different phone service provider, and you know the price of girl A calling girl B for all possible A and B. Not all of your friends like each other, and some of them will never call people they don\u0026#39;t like. Your job is to find the cheapest possible sequence of calls so that the news spreads from you to all \u003cstrong\u003en\u003c/strong\u003e-1 other members of the group.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tThe first line of input gives the number of cases, \u003cstrong\u003eN \u003c/strong\u003e(N\u0026lt;150). \u003cstrong\u003eN\u003c/strong\u003e test cases follow. Each one starts with two lines containing \u003cstrong\u003en\u003c/strong\u003e\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003cnobr\u003e(0\u0026lt;\u003d\u003cstrong\u003en\u003c/strong\u003e\u0026lt;\u003d1000)\u003c/nobr\u003e and \u003cstrong\u003em\u003c/strong\u003e \u003cnobr\u003e(0 \u0026lt;\u003d \u003cstrong\u003em\u003c/strong\u003e \u0026lt;\u003d 40,000)\u003c/nobr\u003e. Girls are numbered from 0 to \u003cnobr\u003e\u003cstrong\u003en\u003c/strong\u003e-1\u003c/nobr\u003e, and you are girl 0. The next \u003cstrong\u003em\u003c/strong\u003e lines will each contain 3 integers, \u003cstrong\u003eu\u003c/strong\u003e, \u003cstrong\u003ev\u003c/strong\u003e and \u003cstrong\u003ew\u003c/strong\u003e, meaning that a call from girl \u003cstrong\u003eu\u003c/strong\u003e to girl \u003cstrong\u003ev\u003c/strong\u003e costs \u003cstrong\u003ew\u003c/strong\u003e cents \u003cnobr\u003e(0 \u0026lt;\u003d \u003cstrong\u003ew\u003c/strong\u003e \u0026lt;\u003d 1000)\u003c/nobr\u003e. No other calls are possible because of grudges, rivalries and because they are, like, lame. The input file size is around 1200 KB.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tFor each test case, output one line containing \u0026quot;Case #\u003cb\u003ex\u003c/b\u003e:\u0026quot; followed by the cost of the cheapest method of distributing the news. If there is no solution, print \u0026quot;Possums!\u0026quot; instead.\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e4\r\n2\r\n1\r\n0 1 10\r\n2\r\n1\r\n1 0 10\r\n4\r\n4\r\n0 1 10\r\n0 2 10\r\n1 3 20\r\n2 3 30\r\n4\r\n4\r\n0 1 10\r\n1 2 20\r\n2 0 30\r\n2 3 100\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003eCase #1: 10\r\nCase #2: Possums!\r\nCase #3: 40\r\nCase #4: 130\u003c/pre\u003e"}}]}