Abdullah, Biswas and Cijsan all have been in big trouble. They are invited into a dying game by Thanos. If they lose in that game, they will die and the world will suffer a lot. The game is completely mathematical. Abdullah, Biswas and Cijsan are standing at three different places in a field. Thanos is at the center of the distance of any two of them. Seeing this, the other person has to tell how far he is from Thanos. If he can’t, their situation will be worse. But Thanos will leave the world if he can. Sadly, none of them have much mathematical intelligence and I don’t want to say about their guessing ability! Now you can save them and the world.
At first, a number T will be given as input, which will indicate the case number. There will be two lines of input for each case. In the first line, a total of six numbers Ax , Ay , Bx , By , Cx , Cy will be given as input which will indicate the position of Abdullah, Biswas and Cijsan respectively. In the second line, one of the characters
C will be given as input, which will indicate who should calculate distance from Thanos, whether it’s Abdullah, Biswas or Cijsan.
The format of the output is like this-
Case X: Y. Where X is the case number and Y is the calculated distance. Print the distance value up to three decimal places for the accuracy of the answer.
2 3 4 6 7 8 9 B -2 2 -4 -4 3 -3 C
Case 1: 0.707 Case 2: 6.325
Problemsetter: Mushfiqur Rahman (mdvirus)