Sitting in front of the computer for too long is no good for your health. Keeping this in mind, the MaratonIME coaches decided to motivate the contestants to practice sports, not just programming. They didn't want to stick with the basics, so they chose the bow and arrow.
However, they noticed that too many people showed up at practice sessions just to shoot arrows. To discourage people with no interest in programming, they decided to add a requirement for shooting arrows: one would have to code a program that takes the coordinates of 3 arrows and record the final score. The target is made of ten concentric circles of proportional radii, that is, the smallest circle has radius R, the second one has radius 2R, the third one has radius 3R, and so on. The circle with smallest radius grants 10 points, and the largest one awards only 1 point. An arrow that hits the boundary between two circles grants the largest of the two scores.
Don't miss your opportunity to participate at the programming contest: write this program.
The input has a line that has an integer R, the radius of the smallest circle. Next there are three lines with pairs of integers, x and y, the points in the target hit by each arrow. The target center is at coordinate (0, 0).
The output has a single integer: the final score.
## Input
The input has a line that has an integer R, the radius of the smallest circle. Next there are three lines with pairs of integers, x and y, the points in the target hit by each arrow. The target center is at coordinate (0, 0). 1 ≤ R ≤ 102 - 103 ≤ x, y ≤ 103
## Output
The output has a single integer: the final score.
[samples]
**Definitions**
Let $ T \in \mathbb{Z} $ be the number of test cases.
For each test case $ k \in \{1, \dots, T\} $:
- Let $ n_k \in \mathbb{Z} $ be the number of ingredients needed.
- Let $ k_k \in \mathbb{Z} $ be the maximum number of ingredients allowed outside the refrigerator.
- Let $ A_k = (a_{k,1}, a_{k,2}, \dots, a_{k,n_k}) $ be the sequence of ingredient IDs in usage order.
**Constraints**
1. $ 1 \le T \le 100 $
2. For each $ k \in \{1, \dots, T\} $:
- $ 1 \le n_k, k_k \le 10^5 $
- $ 1 \le a_{k,i} \le 10^9 $ for all $ i \in \{1, \dots, n_k\} $
**Objective**
Minimize the number of refrigerator openings.
An ingredient must be taken from the refrigerator if and only if it is not currently outside.
If the set of outside ingredients has size $ k_k $ and a new ingredient is needed, one must be returned to the refrigerator before taking the new one.
The choice of which ingredient to return is optimal to minimize future openings.
Let $ S \subseteq \mathbb{Z}^+ $ denote the set of ingredients currently outside the refrigerator.
Initialize $ S = \emptyset $, and $ \text{openings} = 0 $.
For each $ i = 1 $ to $ n_k $:
- If $ a_{k,i} \notin S $:
- If $ |S| < k_k $: add $ a_{k,i} $ to $ S $, increment $ \text{openings} $.
- Else: remove one element from $ S $ (optimally chosen), add $ a_{k,i} $, increment $ \text{openings} $.
Compute $ \text{openings} $ for each test case.