#Lutece0683. Eating Fish is Fun
Eating Fish is Fun
Migrated from Lutece 683 Eating Fish is Fun
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Bearchild loves eating fish. And fish is cheap and easy to buy. Now bearchild is at the market, he has three kinds of coins. Higurashicoin – one for a piece of fish. Uminekocoin – one for two pieces of fish. And Higanbanacoin – one for five pieces of fish.
Currently the boss selling fish is short of money, so he cannot give changes back. This makes bearchild wonder: what is the minimum number of the fish pieces he cannot buy exactly, using those coins in hand?
Input
The first line of input contains a number , indicating the number of test cases. ()
For each case, there are three numbers: , and . Which is the number of Higurashicoins, Uminekocoins, and Higanbanacoins, which bearchild has in hand.
Output
For each case, output Case #i:
first. ( is the number of the test case, from to ). Then output the answer for bearchild’s question.
Samples
2
1 2 0
2 1 1
Case #1: 6
Case #2: 10
Resources
11th UESTC Programming Contest Preliminary