404389: GYM101492 F Hitting the target

Memory Limit:512 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

F. Hitting the targettime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard output

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.

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.

ExamplesInput
1
0 0
0 1
0 0
Output
30
Input
2
0 0
0 2
0 3
Output
29

Source/Category

加入题单

上一题 下一题 算法标签: