문제
Problem 2: Crowded Cows [Brian Dean, 2013]
Farmer John's N cows
A cow feels "crowded" if there is another cow at least twice her height within distance D on her left, and also another cow at least twice her height within distance D on her right
입력
Line 1: Two integers, N and D.
Lines
출력
* Line 1: The number of crowded cows.
예제1
64
10 3
6 2
5 3
9 7
3 6
11 2
2
INPUT DETAILS:
There are 6 cows, with a distance threshold of 4 for feeling crowded. Cow #1 lives at position x=10 and has height h=3, and so on.
OUTPUT DETAILS: The cows at positions x=5 and x=6 are both crowded.