One day, God Sheep would like to play badminton but he can’t find an opponent. So he request Mr. Panda to play with him. He said: “Each time I win one point, I’ll pay you XX dollars. For each time I lose one point, you should give me YY dollars back.”
God Sheep is going to play KK sets of badminton games. For each set, anyone who wins at least 11 points and leads by at least 2 points will win this set. In other words, normally anyone who wins 11 points first will win the set. In case of deuce (E.g. 10 points to 10 points), it’s necessary to lead by 2 points to win the set.
Mr. Panda is really good at badminton so he could make each point win or lose at his will. But he has no money at the beginning. He need to earn money by losing points and using the money to win points.
Mr. Panda cannot owe God Sheep money as god never borrowed money. What’s the maximal number of sets can Mr. Panda win if he plays cleverly?

Input

The first line of the input gives the number of test cases, TT. TT test cases follow.
Each test case contains 3 numbers in one line, XX, YY , KK, the number of dollars earned by losing a point, the number of dollars paid by winning a point, the number of sets God Sheep is going to play.
1≤T≤105.1≤T≤105.
1≤X,Y,K≤1000.1≤X,Y,K≤1000.

Output

For each test case, output one line containing “Case #x: y”, where xx is the test case number (starting from 1) and yy is the maximal number of sets Mr. Panda could win.

Sample Input

2
10 10 1
10 10 2

Sample Output

Case #1: 0
Case #2: 1

        
  

Hint

In the first test case, Mr. Panda don’t have enough money to win the only set, so he must lose the only set.
In the second test case, Mr. Panda can lose the first set by 0:11 and he can earn 110 dollars. Then winning the second set by 11:0 and spend 110 dollars.

题意:

羊和熊猫打k局羽毛球,每局的获胜者可以以11分:9分获胜,如果是平局,则需要不断进行比赛直到某人比其他人高出两分。羊赢一分需要给熊猫x元,熊猫赢一分需要给羊y元。熊猫可以随意决定这句的输赢,它一开始没有钱,并且熊猫不能欠羊的钱,问熊猫最多能赢几局?

(我没有想到的地方)如果x>y:熊猫肯定能赢每一局。赢一分输一分地比赛,慢慢攒钱,攒到能多两分。(我太菜了!!!!)

如果x<=y:熊猫需要以0:11输掉一局的比赛来攒钱。列一个不等式解就好了

太惨了 WA了4次

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int t,k,kcase=0;
    int x,y;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d%d%d",&x,&y,&k);
        int ans;
        if(x>y)
            ans=k;
        else
            ans=11*x*k/(2*x+11*y);
        cout<<"Case #"<<++kcase<<": "<<ans<<'\n';
    }
    return 0;
}