UVA11090 Going in Cycle!!

Description

The original [PDF](https://uva.onlinejudge.org/external/110/p11090.pdf). You are given a weighted directed graph with $n$ vertices and $m$ edges. Each cycle in the graph has a weight, which equals to sum of its edges. There are so many cycles in the graph with different weights. In this problem we want to find a cycle with the minimum mean.

Input Format

The first line of input gives the number of cases, $N$. $N$ test cases follow. Each one starts with two numbers $n$ and $m$. $m$ lines follow, each has three positive number $a$, $b$, $c$ which means there is an edge from vertex $a$ to $b$ with weight of $c$.

Output Format

For each test case output one line containing $\tt{Case\;\#}\textit{\textmd x}\:\tt:$ followed by a number that is the lowest mean cycle in graph with $2$ digits after decimal place, if there is a cycle. Otherwise print $\tt{No\;cycle\;found.}$.

Explanation/Hint

For all test case: $n\le50$, $a,b\le n$, $c\le10^7$.