#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 TT, indicating the number of test cases. (T100000T\leq 100000)

For each case, there are three numbers: xx, yy and zz. Which is the number of Higurashicoins, Uminekocoins, and Higanbanacoins, which bearchild has in hand.

0x,y,z100,000,0000\leq x, y, z \leq 100,000,000

Output

For each case, output Case #i: first. (ii is the number of the test case, from 11 to TT). 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