407342: GYM102769 A A Greeting from Qinhuangdao

Memory Limit:512 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. A Greeting from Qinhuangdaotime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard output

Welcome to the CCPC Qinhuangdao Site!

Qinhuangdao is a beautiful coastal city full of charm, integrating historical heritage and modern civilization. It was named after the Emperor QinShiHuang's east tour in 215 BC for seeking immortals.

The infiltration of more than 2000 years of history has left a rich cultural treasure here. Bo Yi, Shu Qi, Qi Jiguang, Cao Cao, and Mao Zedong, Many Heroes throughout the ages have endowed Qinhuangdao with the thousand-year cultural context, the unique and precious heritage, and the profound historical memory.

Pleasant natural scenery has shaped her beautiful appearance. Thousands of miles of Yan Mountains, the Great Wall, and the vast seas are miraculously met here. The blue sky, green land, blue sea, and golden sand gather together to welcome guests.

To toast your arrival, Alex prepared a simple problem to help you warm up.

Alex has $$$r$$$ red balls and $$$b$$$ blue balls. Then, Alex randomly chose two of these balls with equal probability. What is the probability that he chose two red balls?

Output the required probability in the form of irreducible fraction.

Input

The first line of input gives the number of test cases, $$$T\ (1 \le T \le 10)$$$. $$$T$$$ test cases follow.

For each test case, the only line contains two integers $$$r,b\ (1 \le r,b \le 100)$$$, where $$$r$$$ is the number of red balls and $$$b$$$ is the number of blue balls.

Output

For each test case, output one line containing "Case #x: y", where $$$\texttt{x}$$$ is the test case number (starting from $$$1$$$), and $$$\texttt{y}$$$ is the answer in the form of irreducible fraction in format A/B.

If the required probability equals to zero, output 0/1. If the required probability equals to $$$1$$$, output 1/1.

ExampleInput
3
1 1
2 1
8 8
Output
Case #1: 0/1
Case #2: 1/3
Case #3: 7/30

加入题单

上一题 下一题 算法标签: