We all know, Argentina and Brazil supporters cannot stand each other. An organization decided to arrange a seminar about the importance of peace between football supporters. They invited Brazil supporters and Argentina supporters. They sat in a row. But if a Brazil and an Argentina supporter sat together, they fought. Even these supporters were so energetic that if one fought with his opponent on the left side and there was an opponent on the right side, he again fought. Each day the organization arranged sit differently from any previous arrangement hoping that there would be no fight. They stopped this seminar when they ran out of new permutations and realized there would never be peace between Argentina and Brazil supporters. Your task is to find out on average how many fights were there daily.
Consider all Brazil supporters are indistinguishable and the same for all Argentina supporters.
First line of the input is an integer, number of test cases.
Each test case contains two integers, and , number of Brazil and Argentina supporters.
For each test case, print the average fights per day. Absolute or Relative error should be .
Formally, let your answer be and the jury’s answer be . Your answer is accepted if and only if .
1 2 2
BBAA = 1
BABA = 3
BAAB = 2
ABAB = 3
AABB = 1
ABBA = 2
So average fight
Login to submit
Suppose there are MMM supporters of Brazil and NNN supporters of Argentina. If all of them are made ...