Fisa Flood

This is the story of a distant country called Udesc. No one in this world actually knows about it. Nobody knows its geographical position or any road that leads to this country. Nobody even knows the language of Udesc. They are truly separated from the world! As they are separated from the world, they don’t know about modern technologies. But the people of Udesc are very brilliant. They already invented many of the technologies by themselves. For example, they can produce electricity and use electric machines. They have invented cars, aero planes, submarines and trains. They use sophisticated computers, digital cameras, mobile phones, televisions, air conditioners, refrigerators, energy saving lights, microwave ovens, washing machines and many more useful stuffs in their day to day life. They also use internet which is not like ours. They can browse and download any amount of data without any charge! Recently they are trying to grab the nuclear technology. The people of Udesc are very honest and hardworking. They work hard from dawn to dusk. Nobody remains idle. Everybody keeps busy with his or her own work. The social security of the land is very high. Nobody dies for the lack of medical treatment. There are universities, colleges, schools, banks, parks, theaters, supermarkets, and many other amusement centers. There is no corruption or crime. All through the year, the cops and the judges pass their vacation time. The only drawback of this country is, they have given all their efforts to mechanical improvements, and so, they forgot to improve their food habit. They have no fast food restaurant! They never took a sip of soft drinks or a bite from a crispy cheese burger. They even don’t know the name of French fries. But things have been changing lately. Fisa, a cormorant citizen of Udesc, privately invented how to make soft drinks. And he has established ‘Fisa Flood’, the first ever factory in Udesc, which only produces soft drinks. Fisa Flood started producing soft drinks of two flavors. The first one is named ‘Fisadasa’ which is white in color. The second one is named ‘Fisaloca’, which is dark red. Each type is available in different sized cans i.e. 250ml, 500ml, 1 liter, 1.5 liters, 2 liters and 5 liters (really big ones). The price of Fisadasa and Fisaloca are same. As the people of Udesc don’t know about soft drinks, Biqar, the cunning CEO of Fisa Flood takes an innovative marketing approach. Fisa Flood started giving their consumers a promotional offer. If someone returns two empty cans of Fisa Flood product, he will get one new can in return. But things are not as easy as you may think. Here are some details of the promotional offer. If you give two cans of Fisadasa, you will get one can of Fisadasa. But if you give two cans of Fisaloca, you will not get one can of Fisaloca. Instead, you will still get one can of Fisadasa. If you want to get one can of Fisaloca, you have to return one can of Fisadasa and one can of Fisaloca. One more thing, the promotional cans are specially labeled to separate from normal cans without offer. That means, if you submit two cans after the promotion period, still you will get one new specially labeled can. Soon, Fisa Flood products become very popular among the people. They got used to it so much that, they hardly drink any water now. Nikas, a young boy, is very fond of this as well. As he does not have much money, and the offer will not last forever, he planned to buy as much cans as possible. So he gathers all his money and buys a lot of Fisadasa and Fisaloca. After that, Nikas starts to drink the cans one by one. Suddenly a thought strikes his mind. He becomes aware of how many cans in total he could drink. He knows, if he has two Fisadasa can, then he will get the third one by returning the first two. Thus he can drink three cans in total. If he has two Fisadasa and one Fisaloca, then he can drink five cans in total (after drinking two Fisadasa cans, gets a new Fisadasa can back. Now he has two new cans, which he can submit to get a new one, totaling five cans). First, Nikas was only aware of the number of cans of each type he could get. But soon he realizes

2/2 that, the number of each type may leads to various results depending on the order he drinks the cans. Now, he is wondering what the last can would be, will it be Fisadasa or Fisaloca? Nikas doesn’t have time for this, and not really good with math, so he has asked you to find the probability of the last can being Fisadasa or Fisaloca. Input The input starts with a line containing an integer T (1 ≤ T ≤ 111), which denotes the number of test cases. Each of the next T lines describes one test case containing two integers, A and B (0 ≤ A, B ≤ 1000), separated by a single space. A is the number of Fisadasa cans Nikas bought, and B is the number of Fisaloca. Output For each case, you have to produce exactly one line of output. This line contains the test case number starting from 1 along with two floating point numbers, p and q, separated by a single space. Here, p denotes the probability that the last can will be Fisadasa, and q denotes the probability that the last can will be Fisaloca. You have print them rounding off to three decimal places after the point. Check sample input and output for details. Sample Input 3 10 02 11 Sample Output Case 1: 1.000 0.000 Case 2: 1.000 0.000 Case 3: 0.000 1.000