Gun Fight

Here we are in a gun fight again. We have a battlefield similar to a 2-dimensional Cartesian plane. In some of the grid points there are some watch towers. Some of the watch towers have gunmen inside them. Let us denote them as gun towers. The power of each gun tower is given as an integer number P. When a fight takes place between two gun towers, the tower with higher P wins (No result in case of equal P ). Now, there are two opposing groups in the bat- tle. The groups are separated by a boundary line. This boundary line is an imaginary infinite line drawn through two given free watch towers (watch towers without gunmen). The two groups stay in either side of the field. Interestingly, there are always an odd number of gun towers in the field at the start of a battle. This implies that the two groups will be of unequal size. The smaller group wants to adopt a strategy to ensure maximum possible success. A gun tower can fight with at most one of the opposing gun towers. Again, a gun tower can attack an enemy gun tower if the Euclidean distance between them is not greater than a particular distance R. Each gun tower of the smaller group is given the choice to select its opponent. The above diagram illustrates sample #1. The imaginary line is represented by the red line passing through two watch towers shown in red. There are 5 gun towers in total. The two groups are represented by two colors blue and black of which blue group is smaller in size. The yellow arrows show the two fights where the black ones get defeated. What is the maximum number of fight the smaller group can win? Input There are at most 60 test cases in the input. Every test case starts with an integer N (5 ≤ N ≤ 300), the number of watch towers. Each of the next N lines contains 3 non-negative integers x, y and P . The first two integers (0 ≤ x, y ≤ 10000) denote co-ordinates of the tower. The final integer P (0 ≤ P ≤ 10000) denotes the power of the tower. Note that, a watch tower with P = 0 means a free watch tower. The (i+1)-th line corresponds to watch tower number i (1 ≤ i ≤ N). Two watch towers will never be placed in the same location. The next line contains three integers a, b (1 ≤ a,b ≤ N, a ̸= b) and R (1 ≤ R ≤ 10000), here a and b are the IDs of two free towers to draw the separation line through and meaning of R is given in the problem statement. There will be at least two free towers in the field. There will be no gun towers on the separation line. The end of input is denoted by a case with N = 0. This case should not be processed. Output For each test case, print a line in this format, ‘Case X: Y ’, where X is the case number and Y is the maximum possible number of fight the smaller group can win.

2/2 Sample Input 7 233 312 320 444 740 621 736 3 5 50 7 231 314 320 442 530 625 736 3 5 50 0 Sample Output Case 1: 2 Case 2: 0